From 6e3fb2f26e3930a393f3604f30cea0818b5adf94 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Wed, 10 Jul 2013 18:35:48 +0200 Subject: [PATCH] Move dependencies call to boot method --- .../Core/Provider/ConfigurationServiceProvider.php | 10 ++++++---- .../Core/Provider/FileServeServiceProvider.php | 13 ++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/Alchemy/Phrasea/Core/Provider/ConfigurationServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/ConfigurationServiceProvider.php index 9da4ebfe5b..7fb7ca1b11 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/ConfigurationServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/ConfigurationServiceProvider.php @@ -41,7 +41,13 @@ class ConfigurationServiceProvider implements ServiceProviderInterface $app['debug'] ); }); + } + /** + * {@inheritDoc} + */ + public function boot(SilexApplication $app) + { $app['dispatcher'] = $app->share( $app->extend('dispatcher', function($dispatcher, SilexApplication $app){ $dispatcher->addSubscriber(new TrustedProxySubscriber($app['phraseanet.configuration'])); @@ -50,8 +56,4 @@ class ConfigurationServiceProvider implements ServiceProviderInterface }) ); } - - public function boot(SilexApplication $app) - { - } } diff --git a/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php index 3125e12ff2..8327f0ba6d 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php @@ -31,7 +31,13 @@ class FileServeServiceProvider implements ServiceProviderInterface $app['phraseanet.file-serve'] = $app->share(function (Application $app) { return ServeFileResponseFactory::create($app); }); + } + /** + * {@inheritDoc} + */ + public function boot(Application $app) + { $app['dispatcher'] = $app->share( $app->extend('dispatcher', function($dispatcher, Application $app){ $dispatcher->addSubscriber(new XSendFileSubscriber($app)); @@ -40,11 +46,4 @@ class FileServeServiceProvider implements ServiceProviderInterface }) ); } - - /** - * {@inheritDoc} - */ - public function boot(Application $app) - { - } }