A Symfony bundle that provides a files repository interface with error handling. Files repository allows to store static files on a cheapest storage (e.g. from $1/mo). The file repository responsibility is to redistribute the files, handle recognition and validation, de-duplication, so the main application could take only the minimum of sending files, and removing them if necessary.
- Symfony
- Register the bundle
new Wolnosciowiec\FileRepositoryBundle\FileRepositoryBundle(),
- In configuration step you need to put your server address, secret token and cache class name
file_repository:
cache_class: "Doctrine\\Common\\Cache\\VoidCache"
url: "https://image-repository-test.herokuapp.com"
token: "api-key-here-for-external-remote-control"
// upload an image to the file repository
// the repository handles itself de-duplication, so we don't need to take care of it
// in the application
$this->uploader->uploadFromUrl($event->getBackgroundImage());