refactor(storage): introduce the storage port and the disk registry
Johncms\Files\Filesystem handed out League\Flysystem\Filesystem itself, so every caller programmed against the library, and its switch had a single default branch: any driver name but a local directory was silently treated as one. It also ignored the 'default' key of the configuration and defaulted to a hard-coded disk name.
StorageInterface is now the port, FlysystemStorage the only class that names the library, and StorageRegistry resolves disks by name for the callers that learn it at runtime. Drivers come from the StorageDriver enum through StorageFactory, following CacheDriver/CachePoolFactory; an unknown one is refused where the settings are read.
Fixes the permissions of what is stored: the local adapter applies its permission map only when the write tells it the visibility, and it creates directories with plain mkdir(), which subtracts umask. Files are now written with the visibility of the disk, and the directories a write creates get it afterwards, so a strict umask no longer produces files the web server cannot read.
The configuration moves from storages/type/root_dir to disks/driver/root, gaining url, visibility and permissions per disk.
StorageInterface is now the port, FlysystemStorage the only class that names the library, and StorageRegistry resolves disks by name for the callers that learn it at runtime. Drivers come from the StorageDriver enum through StorageFactory, following CacheDriver/CachePoolFactory; an unknown one is refused where the settings are read.
Fixes the permissions of what is stored: the local adapter applies its permission map only when the write tells it the visibility, and it creates directories with plain mkdir(), which subtracts umask. Files are now written with the visibility of the disk, and the directories a write creates get it afterwards, so a strict umask no longer produces files the web server cannot read.
The configuration moves from storages/type/root_dir to disks/driver/root, gaining url, visibility and permissions per disk.