Description
User Story
As a developer, I want to store my assets on an object store like AWS S3, GCP or DigitalOcean Spaces so that I can benefit from their tools and help my server to be stateless.
Context
As discussed in issue #1681, Bolt could benefit from support for external object stores using PHPLeague's Flysystem V2 (Currently in beta). This would help servers with scaling options like load balancing containers or Kubernetes as all container instances could refer to the same external filesystem. It makes unit testing easier and faster, as mock/memory adapters can be used to replace local operations.
What is Required
Classes which talk to the local filesystem using methods such as file_get_contents
or Symphony's Filesystem component would need to be swapped out in favour of Filesystem objects. This would only need to be done for media files that the user uploads. Operations like image processing or video compressing can still be done using the local filesystem, as long as they are uploaded to the remote storage at the end.
The chosen Filesystem should be configured using the project config, like the .env
file and default to local operations as it does currently.
How can you help?
I'm happy to create a PR for this work, I've worked with PHP on our own framework for nearly 4 years. I've had plenty of experience with Flysystem and I've been looking to contribute to open source.. This is my first RFC so let me know if I've missed anything.