mirror of
https://github.com/Intervention/image.git
synced 2025-08-11 16:34:00 +02:00
moved manipulator route registration to boot() method
This commit is contained in:
@@ -20,24 +20,12 @@ class ImageServiceProvider extends ServiceProvider
|
|||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
$this->package('intervention/image');
|
$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
|
// try to create imagecache route only if imagecache is present
|
||||||
if (class_exists('Intervention\Image\ImageCache')) {
|
if (class_exists('Intervention\Image\ImageCache')) {
|
||||||
|
|
||||||
|
$app = $this->app;
|
||||||
|
|
||||||
// load imagecache config
|
// load imagecache config
|
||||||
$app['config']->package('intervention/imagecache', __DIR__.'/../../../../imagecache/src/config', 'imagecache');
|
$app['config']->package('intervention/imagecache', __DIR__.'/../../../../imagecache/src/config', 'imagecache');
|
||||||
$config = $app['config'];
|
$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.
|
* Get the services provided by the provider.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user