boxuk / describr-bundle
A Symfony2 bundle that integrates the Describr library
Installs: 27 415
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 1
Open Issues: 1
Requires
- php: >=5.3.0
- ext-fileinfo: *
- boxuk/describr: 1.3.*
Requires (Dev)
- symfony/config: 2.*
- symfony/dependency-injection: 2.*
- symfony/http-foundation: 2.*
- symfony/http-kernel: 2.*
- symfony/yaml: 2.*
This package is auto-updated.
Last update: 2024-11-26 17:08:48 UTC
README
This bundle integrates the Describr library into your Symfony2 project, allowing it to examine files and extract metadata from them.
Installation
Download the bundle
You can download an archive of the bundle and unpack it in the vendor/bundles/BoxUK/Bundles/DescribrBundle
directory of your application.
Installing via Composer (recommended)
The bundle can be installed using Composer by adding the following to your composer.json
:
require: {
"boxuk/describr-bundle": "dev-master"
}
Register the bundle
You must register the bundle in your kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new \BoxUK\Bundle\DescribrBundle\BoxUKDescribrBundle() ); // ... }
Usage
The bundle provides a boxuk_describr.analyzer
service which can be used to determine metadata for any instance of Symfony\Component\HttpFoundation\File\File
:
<?php public function analyzeMetadata(File $file) { $service = $this->getContainer()->get('boxuk_describr.analyzer'); $metadata = $service->analyze($file); // Instance of BoxUK\Describr\MediaFileAttributes return $metadata; }
See the Describr documentation for more details.