[Foundation] moved event_dispatcher debug mode to Foundation

This commit is contained in:
Fabien Potencier 2010-02-24 15:28:56 +01:00
parent c9211d9300
commit 45e6573774
4 changed files with 28 additions and 8 deletions

View File

@ -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)

View File

@ -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']);

View File

@ -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']);

View File

@ -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;
}