digitalpoint
Well-known member
I found a little time to start building an add-on today that seems like it will do what I'm talking about. It maintains backward compatibility like so...
XenForo's default 3 adapter overrides can still be used like normal:
Except now instead of allowing exactly 3 adapters in the mount manager (which is
So in that example, the 3 existing allowed adapters become "defaults" for their respective locations and appending a directory to the default name allows you to override whatever the default is for just that directory. So right there, you could have internal-data stored in AWS S3, the image_cache within there is kept in the local file system and your DKIM key stored in the data registry (that's already an Adapter I created, although I haven't tested it yet).
It works without having a defined default as well... so if someone wanted to JUST move their DKIM key to the registry, you can just add that one line and everything else stays in the default local file system.
So far it's only taken a single XenForo class extension (and only altering a single method in that class).
There's more to do, but that's how I have it working so far. If anyone has any ideas, feel free to toss them in.
XenForo's default 3 adapter overrides can still be used like normal:
PHP:
$config['fsAdapters']['data'] = 'Your\Adapter::getAdapter';
$config['fsAdapters']['internal-data'] = 'Your\Adapter::getAdapter';
$config['fsAdapters']['code-cache'] = 'Your\Adapter::getAdapter';
Except now instead of allowing exactly 3 adapters in the mount manager (which is
\XF::fs()
), you can have optional "sub-adapters". For example, if your config was like so:
PHP:
$config['fsAdapters']['internal-data'] = 'Your\Adapter::AwsS3';
$config['fsAdapters']['internal-data/image_cache'] = 'XF\FsMounts::getLocalAdapter';
$config['fsAdapters']['internal-data/keys'] = 'DigitalPoint\FileSystem\Adapter\DataRegistry::getAdapter';
So in that example, the 3 existing allowed adapters become "defaults" for their respective locations and appending a directory to the default name allows you to override whatever the default is for just that directory. So right there, you could have internal-data stored in AWS S3, the image_cache within there is kept in the local file system and your DKIM key stored in the data registry (that's already an Adapter I created, although I haven't tested it yet).
It works without having a defined default as well... so if someone wanted to JUST move their DKIM key to the registry, you can just add that one line and everything else stays in the default local file system.
So far it's only taken a single XenForo class extension (and only altering a single method in that class).
There's more to do, but that's how I have it working so far. If anyone has any ideas, feel free to toss them in.