From a9f60f70a6d87cc52f1ff5da46afb1b6f2a0a58a Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 15 Feb 2013 08:28:01 +0100 Subject: [PATCH] [WebProfilerBundle] removed dependency on FrameworkBundle (closes #6949) --- .../Controller/ProfilerController.php | 12 ++++++++++++ .../Resources/config/routing/profiler.xml | 14 ++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php index 7e04c70729..1b2d8ded1f 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -52,6 +52,18 @@ class ProfilerController $this->toolbarPosition = $toolbarPosition; } + /** + * Redirects to the last profiles. + * + * @return RedirectResponse A RedirectResponse instance + */ + public function homeAction() + { + $this->profiler->disable(); + + return new RedirectResponse($this->generator->generate('_profiler_search_results', array('token' => 'empty', 'limit' => 10))); + } + /** * Renders a profiler panel for the given token. * diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml index 968ab8f3cb..1819e481c8 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml @@ -4,6 +4,10 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> + + web_profiler.controller.profiler:homeAction + + web_profiler.controller.profiler:searchAction @@ -52,14 +56,4 @@ web_profiler.controller.exception:cssAction - - FrameworkBundle:Redirect:redirect - _profiler_search_results - empty - - - - 10 - -