It might be worth looking at how my
Cloudflare addon is doing abstracted filesystem mount points. One of the things is handles (with full backward compatibility) is the ability to do "sub-adapters".
So instead of having adapters for:
- data
- internal-data
- local-data
- code-cache
You could have adapters for:
- data
- internal-data
- data/local
- internal-data/code-cache
It gives you some extra flexibility. Some ways I use it:
- My FileSystem addon allows
internal-data/keys
to reside in the XenForo data registry without needing to create different static adapters, while leaving the rest of internal-data with the local adapter
- My Cloudflare addon allows someone to have
internal-data/attachments
stored in R2, but the rest of internal-data stays in the local adapter (normally with XenForo, it's an all or nothing... send everything in internal-data to a specific adapter, or nothing).
Did I mention it maintains backward compatibility (there are a lot of XenForo sites using my Cloudflare addon without any issues... all of them have "sub-adapter" support underneath it all with the abstracted filesystem even if they aren't using R2... without issue).
My version of FsMounts adds a few other thing as well:
PHP:
/**
* This is based on the XenForo standard method, with some extra stuff:
* - Ability to add adapters based on admin options with static::getDpFsAdapters() method (allows setup of adapters via UI)
* - Allows disable_asserts to be set on a per-adapter basis
* - Automatically merging "sub-adapters" from config.php
* - Returning an extended version of \League\Flysystem\MountManager (sub-adapter support)
*/
Basically when the MountManager handles a request, it looks to see if we have a specific adapter for the sub-directory we are in... if there is, use that... if not, fall back to the adapter for the root path.
As a bonus, if
local-data
was done as a sub-adapter (
data/local
) rather than a new full adapter, nothing would have broken between 2.2 and 2.3.
It would also allow you guys to inject your own adapters without the need to edit config.php (R2 support in XenForo Cloud for example) and (probably) wouldn't need you guys to have a special FsMount class for XF Cloud.