Download the PHP package sokil/file-storage-bundle without Composer
On this page you can find all versions of the php package sokil/file-storage-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package file-storage-bundle
FileStorageBundle
Working with different filesystems, managing file metadata in Doctrine ORM. Storing metadata allows to prevent loading same file twice by checking file hash.
Installation
Add composer dependency:
Add bundle to AppKernel:
Configuration
- Read about Gaufrette at https://github.com/KnpLabs/Gaufrette.
- Read abount configuring Gaufrette filesystems in Symfony at https://github.com/KnpLabs/KnpGaufretteBundle.
Configuration of supported filesystems
This bundle uses gaufrette as filesystem abstraction, so you need to configure filesystem in app config:
You need then pass this filesystem name to your code. For example define parameter in extension of your bundle:
And then in application config:
Now you may use configured filesystems in your controller:
Move local file to filesystem
This bundle usefull for moving local files into some external filesystems and add record to database about file. First we need to create some file entity. File entity holds useful metadata about stored file.
See also
- See how to easy handle uploaded files at https://github.com/sokil/php-upload
All versions of file-storage-bundle with dependencies
knplabs/knp-gaufrette-bundle Version ~0.2
doctrine/doctrine-bundle Version ~1.2
doctrine/orm Version ~2.2,>=2.2.3