Permalink
Browse files

Merge pull request #3 from peschehimself/silex-updates

Removed the autoloader service since this has been removed in Silex
  • Loading branch information...
GromNaN committed Jun 3, 2012
2 parents 3b1de75 + fea606b commit 1d37fa54aaecfacb68fde4c60392da0c1ca6300d
Showing with 7 additions and 28 deletions.
  1. +2 −8 doc/imagine.md
  2. +2 −9 doc/snappy.md
  3. +2 −6 src/Grom/Silex/ImagineServiceProvider.php
  4. +1 −5 src/Grom/Silex/SnappyServiceProvider.php
View
@@ -6,26 +6,20 @@ in [Silex](http://silex-project.org/).
## Parameters
* __imagine.factory (optional):__ Image factory to use (_Gd_, Gmagick, Imagick)
-* __imagine.class_path (optional):__ Path to where the Imagine library is located.
## Services
* __imagine:__ Imagine service to load/create images ([see the API](http://imagine.readthedocs.org/en/latest/usage/introduction.html#basic-usage))
## Registering
-Make sure you place a copy of _Imagine_ in the `vendor/imagine directory.
+If you are using [composer](http://getcomposer.org) to include the SilexServiceProvider in your project, you do not need to register anything. Composer automatically adds the appropriate namespaces to the autoloader.
-```
-git submodule add git://github.com/GromNaN/SilexServiceProvider.git vendor/SilexServiceProvider
-git submodule add git://github.com/avalanche123/Imagine.git vendor/imagine
-```
+In case you're not using composer, you will need to register the `Imagine` namespace in your autoloader yourself. Make sure you place a copy of _Imagine_ in the `vendor/imagine` directory.
Register the service provider in your Silex application.
```php
-$app['autoloader']->registerNamespace('Grom\\Silex', __DIR__.'/vendor/SilexServiceProvider/src/');
-
$app->register(new Grom\Silex\ImagineServiceProvider(), array(
'imagine.factory' => 'Gd',
'imagine.base_path' => __DIR__.'/vendor/imagine',
View
@@ -8,7 +8,6 @@ The SnappyProvider provides integration with [Snappy](https://github.com/knplabs
* __snappy.image_options:__ Array of options to give to Snappy (see [wkhtmltoimage doc](http://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltoimage_0.10.0_rc2-doc.html)).
* __snappy.pdf_binary:__ Absolute path to `wkhtmltopdf`.
* __snappy.pdf_options:__ Array of options to give to Snappy (see [wkhtmltopdf doc](http://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf_0.10.0_rc2-doc.html)).
-* __snappy.class_path:__ (optional) Path to where the Snappy library is located.
## Services
@@ -17,20 +16,14 @@ The SnappyProvider provides integration with [Snappy](https://github.com/knplabs
## Registering
-Make sure you place a copy of Snappy in the `vendor/snappy` directory and a copy of SilexServiceProvider in `vendor/SilexServiceProvider`.
+If you are using [composer](http://getcomposer.org) to include the SilexServiceProvider in your project, you do not need to register anything. Composer automatically adds the appropriate namespaces to the autoloader.
-```
-git submodule add git://github.com/knplabs/snappy.git vendor/snappy
-git submodule add git://github.com/GromNaN/SilexServiceProvider.git vendor/SilexServiceProvider
-```
+In case you're not using composer, you will need to register the `Knp\Snappy` namespace in your autoloader yourself. Make sure you place a copy of _Snappy_ in the `vendor/snappy` directory.
```php
-$app['autoloader']->registerNamespace('Grom\\Silex', __DIR__.'/vendor/SilexServiceProvider/src/');
-
$app->register(new Grom\Silex\SnappyServiceProvider(), array(
'snappy.image_binary' => '/usr/local/bin/wkhtmltoimage',
'snappy.pdf_binary' => '/usr/local/bin/wkhtmltopdf',
- 'snappy.class_path' => __DIR__.'/vendor/snappy/src',
));
```
@@ -13,9 +13,9 @@
class ImagineServiceProvider implements ServiceProviderInterface
{
public function boot(Application $app)
- {
+ {
}
-
+
public function register(Application $app)
{
if(!isset($app['imagine.factory'])) {
@@ -26,9 +26,5 @@ public function register(Application $app)
$class = sprintf('\Imagine\%s\Imagine', $app['imagine.factory']);
return new $class();
});
-
- if (isset($app['imagine.class_path'])) {
- $app['autoloader']->registerNamespace('Imagine', $app['imagine.class_path']);
- }
}
}
@@ -17,7 +17,7 @@ class SnappyServiceProvider implements ServiceProviderInterface
public function boot(Application $app)
{
}
-
+
public function register(Application $app)
{
$app['snappy.image'] = $app->share(function ($app) {
@@ -33,9 +33,5 @@ public function register(Application $app)
isset($app['snappy.pdf_options']) ? $app['snappy.pdf_options'] : array()
);
});
-
- if (isset($app['snappy.class_path'])) {
- $app['autoloader']->registerNamespace('Knp\\Snappy', $app['snappy.class_path']);
- }
}
}

0 comments on commit 1d37fa5

Please sign in to comment.