Move dependencies call to boot method

This commit is contained in:
Romain Neutron
2013-07-10 18:35:48 +02:00
parent 0f1d2551bb
commit 6e3fb2f26e
2 changed files with 12 additions and 11 deletions

View File

@@ -41,7 +41,13 @@ class ConfigurationServiceProvider implements ServiceProviderInterface
$app['debug'] $app['debug']
); );
}); });
}
/**
* {@inheritDoc}
*/
public function boot(SilexApplication $app)
{
$app['dispatcher'] = $app->share( $app['dispatcher'] = $app->share(
$app->extend('dispatcher', function($dispatcher, SilexApplication $app){ $app->extend('dispatcher', function($dispatcher, SilexApplication $app){
$dispatcher->addSubscriber(new TrustedProxySubscriber($app['phraseanet.configuration'])); $dispatcher->addSubscriber(new TrustedProxySubscriber($app['phraseanet.configuration']));
@@ -50,8 +56,4 @@ class ConfigurationServiceProvider implements ServiceProviderInterface
}) })
); );
} }
public function boot(SilexApplication $app)
{
}
} }

View File

@@ -31,7 +31,13 @@ class FileServeServiceProvider implements ServiceProviderInterface
$app['phraseanet.file-serve'] = $app->share(function (Application $app) { $app['phraseanet.file-serve'] = $app->share(function (Application $app) {
return ServeFileResponseFactory::create($app); return ServeFileResponseFactory::create($app);
}); });
}
/**
* {@inheritDoc}
*/
public function boot(Application $app)
{
$app['dispatcher'] = $app->share( $app['dispatcher'] = $app->share(
$app->extend('dispatcher', function($dispatcher, Application $app){ $app->extend('dispatcher', function($dispatcher, Application $app){
$dispatcher->addSubscriber(new XSendFileSubscriber($app)); $dispatcher->addSubscriber(new XSendFileSubscriber($app));
@@ -40,11 +46,4 @@ class FileServeServiceProvider implements ServiceProviderInterface
}) })
); );
} }
/**
* {@inheritDoc}
*/
public function boot(Application $app)
{
}
} }