1
0
mirror of https://github.com/Intervention/image.git synced 2025-02-06 22:00:38 +01:00

moved manipulator route registration to boot() method

This commit is contained in:
Oliver Vogel 2014-08-02 11:18:02 +02:00
parent 7791197ada
commit a64007afa6

View File

@ -20,24 +20,12 @@ class ImageServiceProvider extends ServiceProvider
public function boot()
{
$this->package('intervention/image');
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$app = $this->app;
$app['image'] = $app->share(function ($app) {
return new ImageManager($app['config']);
});
// try to create imagecache route only if imagecache is present
if (class_exists('Intervention\Image\ImageCache')) {
$app = $this->app;
// load imagecache config
$app['config']->package('intervention/imagecache', __DIR__.'/../../../../imagecache/src/config', 'imagecache');
$config = $app['config'];
@ -100,6 +88,20 @@ class ImageServiceProvider extends ServiceProvider
}
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$app = $this->app;
$app['image'] = $app->share(function ($app) {
return new ImageManager($app['config']);
});
}
/**
* Get the services provided by the provider.
*