diff --git a/src/Symfony/Foundation/Bundle/KernelBundle.php b/src/Symfony/Foundation/Bundle/KernelBundle.php index 669cd9bea5..d10e0ed84e 100644 --- a/src/Symfony/Foundation/Bundle/KernelBundle.php +++ b/src/Symfony/Foundation/Bundle/KernelBundle.php @@ -6,6 +6,8 @@ use Symfony\Foundation\Bundle\Bundle; use Symfony\Foundation\ClassCollectionLoader; use Symfony\Components\DependencyInjection\ContainerInterface; use Symfony\Components\DependencyInjection\Loader\Loader; +use Symfony\Components\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Components\DependencyInjection\BuilderConfiguration; /* * This file is part of the symfony framework. @@ -27,6 +29,18 @@ class KernelBundle extends Bundle public function buildContainer(ContainerInterface $container) { Loader::registerExtension(new KernelExtension()); + + $configuration = new BuilderConfiguration(); + + $loader = new XmlFileLoader(array(__DIR__.'/../Resources/config', __DIR__.'/Resources/config')); + $configuration->merge($loader->load('services.xml')); + + if ($container->getParameter('kernel.debug')) + { + $configuration->setDefinition('event_dispatcher', $configuration->findDefinition('debug.event_dispatcher')); + } + + $container->merge($configuration); } public function boot(ContainerInterface $container) diff --git a/src/Symfony/Foundation/Bundle/KernelExtension.php b/src/Symfony/Foundation/Bundle/KernelExtension.php index 6382d4d3fa..e5e316ef3a 100644 --- a/src/Symfony/Foundation/Bundle/KernelExtension.php +++ b/src/Symfony/Foundation/Bundle/KernelExtension.php @@ -26,9 +26,6 @@ class KernelExtension extends LoaderExtension { $configuration = new BuilderConfiguration(); - $loader = new XmlFileLoader(array(__DIR__.'/../Resources/config', __DIR__.'/Resources/config')); - $configuration->merge($loader->load('services.xml')); - if (isset($config['charset'])) { $configuration->setParameter('kernel.charset', $config['charset']); diff --git a/src/Symfony/Foundation/bootstrap.php b/src/Symfony/Foundation/bootstrap.php index 729a922613..4fafc9da4f 100644 --- a/src/Symfony/Foundation/bootstrap.php +++ b/src/Symfony/Foundation/bootstrap.php @@ -40,6 +40,8 @@ use Symfony\Foundation\Bundle\Bundle; use Symfony\Foundation\ClassCollectionLoader; use Symfony\Components\DependencyInjection\ContainerInterface; use Symfony\Components\DependencyInjection\Loader\Loader; +use Symfony\Components\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Components\DependencyInjection\BuilderConfiguration; @@ -49,6 +51,18 @@ class KernelBundle extends Bundle public function buildContainer(ContainerInterface $container) { Loader::registerExtension(new KernelExtension()); + + $configuration = new BuilderConfiguration(); + + $loader = new XmlFileLoader(array(__DIR__.'/../Resources/config', __DIR__.'/Resources/config')); + $configuration->merge($loader->load('services.xml')); + + if ($container->getParameter('kernel.debug')) + { + $configuration->setDefinition('event_dispatcher', $configuration->findDefinition('debug.event_dispatcher')); + } + + $container->merge($configuration); } public function boot(ContainerInterface $container) @@ -75,9 +89,6 @@ class KernelExtension extends LoaderExtension { $configuration = new BuilderConfiguration(); - $loader = new XmlFileLoader(array(__DIR__.'/../Resources/config', __DIR__.'/Resources/config')); - $configuration->merge($loader->load('services.xml')); - if (isset($config['charset'])) { $configuration->setParameter('kernel.charset', $config['charset']); diff --git a/src/Symfony/Framework/WebBundle/DependencyInjection/WebExtension.php b/src/Symfony/Framework/WebBundle/DependencyInjection/WebExtension.php index dca77c47c7..45c39926c2 100644 --- a/src/Symfony/Framework/WebBundle/DependencyInjection/WebExtension.php +++ b/src/Symfony/Framework/WebBundle/DependencyInjection/WebExtension.php @@ -166,8 +166,6 @@ class WebExtension extends LoaderExtension $configuration->setParameter('web_debug.file_link_format', 'txmt://open?url=file://%%f&line=%%l'); } - $configuration->setAlias('event_dispatcher', 'debug.event_dispatcher'); - return $configuration; }