added a note about why the debug dispatcher cannot be used everywhere

This commit is contained in:
Fabien Potencier 2013-09-23 18:04:04 +02:00
parent 5ed1d01449
commit 5ebaad33e6
1 changed files with 5 additions and 1 deletions

View File

@ -57,7 +57,11 @@ class FrameworkExtension extends Extension
if ($container->getParameter('kernel.debug')) {
$loader->load('debug.xml');
// only HttpKernel needs the debug event dispatcher
// we can't replace the event_dispatcher service with the debug
// one as it would lead to circular references (mainly because the debug
// event dispatcher needs the profiler, which triggers the creation of many
// other services that can depend on the dispatcher itself -- CLI commands
// like assetic:dump and twig:lint exhibits this issue for instance)
$definition = $container->findDefinition('http_kernel');
$arguments = $definition->getArguments();
$arguments[0] = new Reference('debug.event_dispatcher');