One of the goals of the Shopsys Framework is to give you tools to make your e-commerce platform scalable. One of the requirements for scalable application is separated file storage that is accessible from all application instances. We use abstract filesystem - Flysystem via OneUpFlysystemBundle to fulfill this requirement.
Flysystem allows you to easily swap out a local filesystem for a remote one like Redis, Amazon S3, Dropbox etc.
In Shopsys Framework we currently use Flysystem to store:
- uploaded files and images
- uploaded files and images via WYSIWYG
- generated feeds
- generated sitemaps
Flysystem supports a huge number of storage adapters. You can find full list here.
You can change the setting of the adapter in app/config/packages/oneup_flysystem.yml
file.
There you find two adapters by default.
The first one main_filesystem
is the one that application uses for storing files.
In order to change the storage of your files update the main_adapter
adapter appropriately.
For more information how to set up adapter visit OneUpFlysystem documentation.
WYSIWYG configuration is stored in app/config/packages/fm_elfinder.yml
file in fm_elfinder\instances\default\connector\roots
section.
For more information how to set up Flysystem with WYSIWYG visit FMElfinderBundle Documentation.
If you changed the file storage, you have to change also loading of these files to be accessible from the frontend of your application. You need to update your Nginx proxy to access your new storage.
In some cases, you need to download/upload files to your local filesystem, do some job with them and then upload the result via the abstract filesystem.