Permalink
Browse files

Add silex service provider

  • Loading branch information...
1 parent 5308109 commit ddebfa8d4a0c64f604b4e275e18b708d61e784eb @romainneutron committed Aug 30, 2012
Showing with 101 additions and 17 deletions.
  1. +2 −1 composer.json
  2. +65 −16 composer.lock
  3. +34 −0 lib/PHPExiftool/PHPExiftoolServiceProvider.php
View
@@ -23,7 +23,8 @@
"symfony/console": "2.1.*",
"symfony/dom-crawler": "2.1.*",
"fabpot/php-cs-fixer": "dev-master",
- "sami/sami": "dev-master"
+ "sami/sami": "dev-master",
+ "silex/silex": "dev-master"
},
"minimum-stability": "dev",
"autoload": {
View
Oops, something went wrong.
@@ -0,0 +1,34 @@
+<?php
+
+namespace PHPExiftool;
+
+use Silex\Application;
+use Silex\ServiceProviderInterface;
+
+class PHPExiftoolServiceProvider implements ServiceProviderInterface
+{
+
+ public function register(Application $app)
+ {
+ $app['exiftool.processor'] = $app->share(function(Application $app) {
+ return new Exiftool();
+ });
+
+ $app['exiftool.reader'] = $app->share(function(Application $app) {
+ return new Reader($app['exiftool.processor'], new RDFParser());
+ });
+
+ $app['exiftool.writer'] = $app->share(function(Application $app) {
+ return new Writer($app['exiftool.processor']);
+ });
+
+ $app['exiftool.preview-extractor'] = $app->share(function(Application $app) {
+ return new PreviewExtractor($app['exiftool.processor']);
+ });
+ }
+
+ public function boot(Application $app)
+ {
+
+ }
+}

0 comments on commit ddebfa8

Please sign in to comment.