You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ideal solution would allow declaring multiple filesystems, and easy migrating of files between filesystem implementations. I see this as happening like so:
ResourceFileManager - takes several "tagged" implementations of file systems, extra methods for migrating specific files across systems, and migrating entire resources. GaufretteFilesystem - Implements FilesystemInterface for any Gaufrette instance.
In dev and testing, all of these can be overridden to simply point to different directories on a local filesystem.
Managing what files belong where, and when they get moved would be fairly straight forward:
on upload, file is moved to upload storage
before transcode, file is moved from upload to transcode, and new files are created in transcode storage
if transcoding is successful, a listener will migrate files to the web storage pool
A few things may need to be refactored for this to work well, but none of them major. Rather than storing an internalUri for files (which assumed they were on local storage, the database should also store a boolean for managed, and internalUri will need to support multiple "schemes" that the manager understands. If the file reference in the database is "managed", then the ResourceFileManager should know how to find it, if not, we must assume it's a reference to a file not under the systems control.
The text was updated successfully, but these errors were encountered:
Aside from the underlying library, the concept remains basically the same, but Flysystem already does a lot of it. Flysystem also allows registering custom schemes, so storing the full scheme urls, such as web:///path/to/file.mp3 or cdn:///path/to/file.mp3 would probably be a viable solution.
The ideal solution would allow declaring multiple filesystems, and easy migrating of files between filesystem implementations. I see this as happening like so:
ResourceFileManager
- takes several "tagged" implementations of file systems, extra methods for migrating specific files across systems, and migrating entire resources.GaufretteFilesystem
- ImplementsFilesystemInterface
for any Gaufrette instance.I would use https://github.com/KnpLabs/KnpGaufretteBundle to configure multiple storage locations, and configure them to power multiple instances of
FilesystemManager
.The end result would let configuration be declared for separate pools of files, for example:
This would let me implement an interface such as:
In dev and testing, all of these can be overridden to simply point to different directories on a local filesystem.
Managing what files belong where, and when they get moved would be fairly straight forward:
A few things may need to be refactored for this to work well, but none of them major. Rather than storing an
internalUri
for files (which assumed they were on local storage, the database should also store a boolean formanaged
, andinternalUri
will need to support multiple "schemes" that the manager understands. If the file reference in the database is "managed", then theResourceFileManager
should know how to find it, if not, we must assume it's a reference to a file not under the systems control.The text was updated successfully, but these errors were encountered: