diff --git a/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php b/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php index 27a0be46c5..6d4873087b 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php +++ b/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php @@ -12,10 +12,12 @@ namespace Symfony\Bundle\WebProfilerBundle\EventListener; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag; use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\Event\FilterResponseEvent; +use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Bundle\TwigBundle\TwigEngine; -use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag; /** * WebDebugToolbarListener injects the Web Debug Toolbar. @@ -27,7 +29,7 @@ use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag; * * @author Fabien Potencier */ -class WebDebugToolbarListener +class WebDebugToolbarListener implements EventSubscriberInterface { const DISABLED = 1; const ENABLED = 2; @@ -124,4 +126,11 @@ class WebDebugToolbarListener $response->setContent($content); } } + + public static function getSubscribedEvents() + { + return array( + KernelEvents::RESPONSE => array('onKernelResponse', -128), + ); + } } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/toolbar.xml b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/toolbar.xml index 5ce61a0889..908a32d1c1 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/toolbar.xml +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/toolbar.xml @@ -10,7 +10,7 @@ - + %web_profiler.debug_toolbar.intercept_redirects% %web_profiler.debug_toolbar.mode%