MediaStorageBundle is a Symfony2 bundle that aims to provide a solid, extendible infrastructure to handle media storage and retrieval. It's built for Doctrine2 and allows to store files (simple files, images, videos, documents) and related metadata as Doctrine entities (Doctrine ORM) or documents (Doctrine ODM). It internally adopt Gaufrette to abstract the filesystem and allows to store files on many external filesystem like Amazon and Rackspace or through FTP or SFTP. It is freely inspired to some famouse Symfony2 media management bundles such as SonataMediaBundle, AnoMediaBundle and VichUploaderBundle but it introduces several different peculiarities and tries to be more extensible and configurable.
WARNING: This bundle version (2.0) is still experimental. It's heavily untested and undocumented, so please do not use it in production. If you prefer a more stable release checkout the 1.0 version at the master branch.
MediaStorageBundle is based on the concept of provider. A provider is a way to abstract the logic behind a certain type of media. The bundle offers a series of default providers to store the following media types (and their metadata):
- Files
- Images (that can be automatically stretched, shrunk, cropped and converted)
- Youtube and Vimeo videos (preview image is locally downloaded and che be elaborated as an image)
So if your environment is built on top of Symfony2/Doctrine2 need to work with external files, images, and online videos (Youtube/Vimeo) the bundle should offer everything you need to get the job done. If you need some custom logic (e.g. video conversion, pdf preview generation, etc.) you can easily implement your custom provider.
As every Symfony 2.1 bundle, MediaStorageBundle can be installed through Composer. Just add the following dependency
inside the require
block of your composer.json
file:
"oryzone/media-storage-bundle": "2.0.x-dev"
So tell composer to download and install the new bundle:
php composer.phar update oryzone/media-storage-bundle
Then you must enable the bundle in your AppKernel.php
file by adding the following line in your $bundles
array:
new \Oryzone\Bundle\MediaStorageBundle\OryzoneMediaStorageBundle(),
Refer to the documentation
- GaufretteBundle (required, automatically installed by Composer)
- ImagineBundle (optional, needed if you want to use Image, Vimeo and Youtube providers)
- BuzzBundle (optional, needed if you want to use Youtube and Vimeo providers)
To install the optional dependencies please refer to the official documentation of each bundle.
Full documentation (still incomplete) is available here: /Resources/doc/index.rst
Contributions are always welcome! If you need to report a bug you can use the github issues for the repository (please specify that it's referred to the version 2 of the bundle). Otherwise you can easily introduce new features, improvements or fixes by forking the repository and submitting a pull request. This list provides the next thing Oryzone would like to implement in the bundle. So if you want to contribute and don't know where to begin here's some hints ;)
- PhpUnit tests
- Travis CI integration
- Improve documentation
- Build providers for famous external services like DailyMotion, Twitter, SlideShare, etc...
- Integrate different ways of processing media (on demand and background)
Thanks