From 4e57899374edd84bab3c98f852035a5626f7fa7b Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 29 Aug 2010 12:37:12 +0200 Subject: [PATCH] [WebProfilerBundle] added the bundle --- .../Resources/views/Profiler/db_bar.php | 2 + .../Resources/views/Profiler/db_menu.php | 4 + .../Resources/views/Profiler/db_panel.php | 19 ++ .../Resources/views/Profiler/mongodb_bar.php | 2 + .../Resources/views/Profiler/mongodb_menu.php | 2 + .../Resources/views/Exception/exception.php | 2 +- .../Controller/ExceptionController.php | 44 +++ .../Controller/ProfilerController.php | 317 ++++++++++++++++++ .../WebProfilerExtension.php | 83 +++++ .../Resources/ICONS_LICENSE.txt | 6 + .../Resources/config/routing/profiler.xml | 34 ++ .../config/schema/webprofiler-1.0.xsd | 14 + .../Resources/config/toolbar.xml | 19 ++ .../Resources/config/web_profiler.xml | 20 ++ .../Resources/public/css/profiler.css | 203 +++++++++++ .../Resources/public/css/toolbar.css | 23 ++ .../Resources/public/images/config.png | Bin 0 -> 473 bytes .../Resources/public/images/db.png | Bin 0 -> 394 bytes .../Resources/public/images/events.png | Bin 0 -> 841 bytes .../Resources/public/images/exception.png | Bin 0 -> 1240 bytes .../Resources/public/images/import.png | Bin 0 -> 1282 bytes .../Resources/public/images/logger.png | Bin 0 -> 750 bytes .../Resources/public/images/memory.png | Bin 0 -> 436 bytes .../Resources/public/images/profiler.png | Bin 0 -> 841 bytes .../Resources/public/images/request.png | Bin 0 -> 1276 bytes .../Resources/public/images/search.png | Bin 0 -> 1006 bytes .../Resources/public/images/timer.png | Bin 0 -> 1022 bytes .../Resources/views/Profiler/admin.php | 18 + .../Resources/views/Profiler/bag.php | 12 + .../Resources/views/Profiler/base.php | 13 + .../Resources/views/Profiler/config_bar.php | 8 + .../Resources/views/Profiler/events_menu.php | 2 + .../Resources/views/Profiler/events_panel.php | 33 ++ .../views/Profiler/exception_menu.php | 5 + .../views/Profiler/exception_panel.php | 10 + .../Resources/views/Profiler/index.php | 3 + .../Resources/views/Profiler/layout.php | 23 ++ .../Resources/views/Profiler/logger_bar.php | 2 + .../Resources/views/Profiler/logger_menu.php | 3 + .../Resources/views/Profiler/logger_panel.php | 14 + .../Resources/views/Profiler/memory_bar.php | 2 + .../Resources/views/Profiler/menu.php | 15 + .../Resources/views/Profiler/notfound.php | 15 + .../Resources/views/Profiler/panel.php | 3 + .../Resources/views/Profiler/request_bar.php | 2 + .../Resources/views/Profiler/request_menu.php | 2 + .../views/Profiler/request_panel.php | 39 +++ .../Resources/views/Profiler/results.php | 20 ++ .../Resources/views/Profiler/search.php | 24 ++ .../Resources/views/Profiler/timer_bar.php | 2 + .../Resources/views/Profiler/toolbar.php | 30 ++ .../WebDebugToolbarListener.php | 97 ++++++ .../WebProfilerBundle/WebProfilerBundle.php | 23 ++ 53 files changed, 1213 insertions(+), 1 deletion(-) create mode 100644 src/Symfony/Bundle/DoctrineBundle/Resources/views/Profiler/db_bar.php create mode 100644 src/Symfony/Bundle/DoctrineBundle/Resources/views/Profiler/db_menu.php create mode 100644 src/Symfony/Bundle/DoctrineBundle/Resources/views/Profiler/db_panel.php create mode 100644 src/Symfony/Bundle/DoctrineMongoDBBundle/Resources/views/Profiler/mongodb_bar.php create mode 100644 src/Symfony/Bundle/DoctrineMongoDBBundle/Resources/views/Profiler/mongodb_menu.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/ICONS_LICENSE.txt create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/config/schema/webprofiler-1.0.xsd create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/config/toolbar.xml create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/config/web_profiler.xml create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/profiler.css create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/toolbar.css create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/config.png create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/db.png create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/events.png create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/exception.png create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/import.png create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/logger.png create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/memory.png create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler.png create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/request.png create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/search.png create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/timer.png create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/admin.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/bag.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/config_bar.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/events_menu.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/events_panel.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/exception_menu.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/exception_panel.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/index.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/logger_bar.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/logger_menu.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/logger_panel.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/memory_bar.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/menu.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/notfound.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/panel.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/request_bar.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/request_menu.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/request_panel.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/results.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/search.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/timer_bar.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/WebDebugToolbarListener.php create mode 100644 src/Symfony/Bundle/WebProfilerBundle/WebProfilerBundle.php diff --git a/src/Symfony/Bundle/DoctrineBundle/Resources/views/Profiler/db_bar.php b/src/Symfony/Bundle/DoctrineBundle/Resources/views/Profiler/db_bar.php new file mode 100644 index 0000000000..daa2c423a4 --- /dev/null +++ b/src/Symfony/Bundle/DoctrineBundle/Resources/views/Profiler/db_bar.php @@ -0,0 +1,2 @@ + +getQueryCount() ?>|getTime()) ?> ms diff --git a/src/Symfony/Bundle/DoctrineBundle/Resources/views/Profiler/db_menu.php b/src/Symfony/Bundle/DoctrineBundle/Resources/views/Profiler/db_menu.php new file mode 100644 index 0000000000..b78055ca49 --- /dev/null +++ b/src/Symfony/Bundle/DoctrineBundle/Resources/views/Profiler/db_menu.php @@ -0,0 +1,4 @@ +
getTime()) ?> ms
+
getQueryCount() ?>
+ +Doctrine diff --git a/src/Symfony/Bundle/DoctrineBundle/Resources/views/Profiler/db_panel.php b/src/Symfony/Bundle/DoctrineBundle/Resources/views/Profiler/db_panel.php new file mode 100644 index 0000000000..6c54daa559 --- /dev/null +++ b/src/Symfony/Bundle/DoctrineBundle/Resources/views/Profiler/db_panel.php @@ -0,0 +1,19 @@ +

Queries

+ +getQueryCount()): ?> + No queries. + + + diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/Resources/views/Profiler/mongodb_bar.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/Resources/views/Profiler/mongodb_bar.php new file mode 100644 index 0000000000..c3ed739172 --- /dev/null +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/Resources/views/Profiler/mongodb_bar.php @@ -0,0 +1,2 @@ + +getQueryCount() ?> diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/Resources/views/Profiler/mongodb_menu.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/Resources/views/Profiler/mongodb_menu.php new file mode 100644 index 0000000000..a9f0653990 --- /dev/null +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/Resources/views/Profiler/mongodb_menu.php @@ -0,0 +1,2 @@ + +Doctrine MongoDB \ No newline at end of file diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.php index f114c10995..eb32d7aa9b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.php @@ -5,7 +5,7 @@
- +

get('code')->formatFileFromText(str_replace("\n", '
', htmlspecialchars($exception->getMessage(), ENT_QUOTES, $view->getCharset()))) ?>

diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php new file mode 100644 index 0000000000..9bc534ed4a --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php @@ -0,0 +1,44 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +/** + * ExceptionController. + * + * @author Fabien Potencier + */ +class ExceptionController extends ContainerAware +{ + /** + * Converts an Exception to a Response. + * + * @param \Exception $exception An Exception instance + * + * @throws \InvalidArgumentException When the exception template does not exist + */ + public function showAction(FlattenException $exception, $format) + { + return $this->container->get('templating')->renderResponse( + 'FrameworkBundle:Exception:'.($this->container->get('kernel')->isDebug() ? 'exception' : 'error'), + array( + 'exception' => new SafeDecorator($exception), + 'logger' => null, + 'currentContent' => '', + 'embedded' => true, + ) + ); + } +} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php new file mode 100644 index 0000000000..1d0590cc35 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -0,0 +1,317 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +/** + * ProfilerController. + * + * @author Fabien Potencier + */ +class ProfilerController extends ContainerAware +{ + /** + * Renders the main profiler page for the given token. + * + * @param string $token The profiler token + * + * @return Response A Response instance + */ + public function indexAction($token) + { + $this->container->get('profiler')->disable(); + + $profiler = $this->container->get('profiler')->loadFromToken($token); + + if ($profiler->isEmpty()) { + return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:notfound', array( + 'token' => $token, + )); + } else { + return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:index', array( + 'token' => $token, + 'profiler' => new SafeDecorator($profiler), + 'collector' => $profiler->getCollector('request'), + 'template' => $this->getTemplate($profiler, '_panel', 'request'), + 'panel' => 'request', + )); + } + } + + /** + * Exports data for a given token. + * + * @param string $token The profiler token + * + * @return Response A Response instance + */ + public function exportAction($token) + { + $profiler = $this->container->get('profiler'); + $profiler->disable(); + + $profiler = $profiler->loadFromToken($token); + + if ($profiler->isEmpty()) { + throw new NotFoundHttpException(sprintf('Token "%s" does not exist.', $token)); + } + + $response = $this->container->get('response'); + $response->setContent($profiler->export()); + $response->headers->set('Content-Type', 'text/plain'); + $response->headers->set('Content-Disposition', 'attachment; filename= '.$token.'.txt'); + + return $response; + } + + /** + * Purges all tokens. + * + * @return Response A Response instance + */ + public function purgeAction() + { + $profiler = $this->container->get('profiler'); + $profiler->disable(); + $profiler->purge(); + + $response = $this->container->get('response'); + $response->setRedirect($this->container->get('router')->generate('_profiler', array('token' => '-'))); + + return $response; + } + + /** + * Imports token data. + * + * @return Response A Response instance + */ + public function importAction() + { + $profiler = $this->container->get('profiler'); + $profiler->disable(); + + $file = $this->container->get('request')->files->get('file'); + if (!$file || 0 !== $file['error']) { + throw new \RuntimeException('Problem uploading the data.'); + } + + $token = $profiler->import(file_get_contents($file['tmp_name'])); + + if (false === $token) { + throw new \RuntimeException('Problem uploading the data (token already exists).'); + } + + $response = $this->container->get('response'); + $response->setRedirect($this->container->get('router')->generate('_profiler', array('token' => $token))); + + return $response; + } + + /** + * Renders the Web Debug Toolbar. + * + * @param string $token The profiler token + * @param string $position The toolbar position (bottom, normal, or null -- automatically guessed) + * + * @return Response A Response instance + */ + public function toolbarAction($token = null, $position = null) + { + $profiler = $this->container->get('profiler'); + + if (null !== $token) { + $profiler = $profiler->loadFromToken($token); + + if ($profiler->isEmpty()) { + return $this->container->get('response'); + } + } + + if (null === $position) { + $position = false === strpos($this->container->get('request')->headers->get('user-agent'), 'Mobile') ? 'fixed' : 'absolute'; + } + + return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:toolbar', array( + 'position' => $position, + 'profiler' => new SafeDecorator($profiler), + 'templates' => $this->getTemplates($profiler, '_bar'), + )); + } + + /** + * Renders a profiler panel for the given token. + * + * @param string $token The profiler token + * + * @return Response A Response instance + */ + public function panelAction($token, $panel) + { + $this->container->get('profiler')->disable(); + + $profiler = $this->container->get('profiler')->loadFromToken($token); + if (!$profiler->hasCollector($panel)) { + throw new NotFoundHttpException(sprintf('Panel "%s" is not registered.', $panel)); + } + + if ($profiler->isEmpty()) { + return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:notfound', array( + 'token' => $token, + )); + } else { + return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:panel', array( + 'token' => $token, + 'profiler' => new SafeDecorator($profiler), + 'collector' => new SafeDecorator($profiler->getCollector($panel)), + 'template' => $this->getTemplate($profiler, '_panel', $panel), + 'panel' => $panel, + )); + } + } + + /** + * Renders the profiler menu for the given token. + * + * @param string $token The profiler token + * @param string $panel The current panel + * + * @return Response A Response instance + */ + public function listAction($token, $panel) + { + $profiler = $this->container->get('profiler')->loadFromToken($token); + + return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:menu', array( + 'token' => $token, + 'profiler' => new SafeDecorator($profiler), + 'templates' => $this->getTemplates($profiler, '_menu'), + 'panel' => $panel, + )); + } + + /** + * Renders the profiler search bar. + * + * @return Response A Response instance + */ + public function menuAction($token) + { + $profiler = $this->container->get('profiler'); + $profiler->disable(); + + $session = $this->container->get('request')->getSession(); + $ip = $session->get('_profiler_search_ip'); + $url = $session->get('_profiler_search_url'); + $limit = $session->get('_profiler_search_limit'); + + return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:search', array( + 'token' => $token, + 'profiler' => new SafeDecorator($profiler), + 'tokens' => $profiler->find($ip, $url, 10), + 'ip' => $ip, + 'url' => $url, + 'limit' => $limit, + )); + } + + /** + * Search results. + * + * @return Response A Response instance + */ + public function searchResultsAction($token) + { + $profiler = $this->container->get('profiler'); + $profiler->disable(); + + $session = $this->container->get('request')->getSession(); + $ip = $session->get('_profiler_search_ip'); + $url = $session->get('_profiler_search_url'); + $limit = $session->get('_profiler_search_limit'); + + return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:results', array( + 'token' => $token, + 'profiler' => new SafeDecorator($this->container->get('profiler')->loadFromToken($token)), + 'tokens' => $profiler->find($ip, $url, 10), + 'ip' => $ip, + 'url' => $url, + 'limit' => $limit, + 'panel' => null, + )); + } + + /** + * Narrow the search bar. + * + * @return Response A Response instance + */ + public function searchAction() + { + $profiler = $this->container->get('profiler'); + $profiler->disable(); + + $request = $this->container->get('request'); + + if ($token = $request->query->get('token')) { + $response = $this->container->get('response'); + $response->setRedirect($this->container->get('router')->generate('_profiler', array('token' => $token))); + + return $response; + } + + $session = $request->getSession(); + $session->set('_profiler_search_ip', $ip = preg_replace('/[^\d\.]/', '', $request->query->get('ip'))); + $session->set('_profiler_search_url', $url = $request->query->get('url')); + $session->set('_profiler_search_limit', $limit = $request->query->get('limit')); + + $profiler = $this->container->get('profiler'); + $profiler->disable(); + $tokens = $profiler->find($ip, $url, $limit); + + $response = $this->container->get('response'); + $response->setRedirect($this->container->get('router')->generate('_profiler_search_results', array('token' => $tokens[0]['token']))); + + return $response; + } + + protected function getTemplates($profiler, $suffix) + { + $templates = array(); + foreach ($this->container->getParameter('data_collector.templates') as $name => $template) { + if ($profiler->hasCollector($name)) { + if (!$this->container->get('templating')->exists($template.$suffix)) { + continue; + } + + $templates[$name] = $template.$suffix; + } + } + + return $templates; + } + + protected function getTemplate($profiler, $suffix, $panel) + { + $templates = $this->getTemplates($profiler, $suffix); + + if (!isset($templates[$panel])) { + throw new NotFoundHttpException(sprintf('Panel "%s" is not registered.', $panel)); + } + + return $templates[$panel]; + } +} diff --git a/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php b/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php new file mode 100644 index 0000000000..b34dda7683 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php @@ -0,0 +1,83 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +/** + * WebProfilerExtension. + * + * Usage: + * + * + * + * @author Fabien Potencier + */ +class WebProfilerExtension extends Extension +{ + /** + * Loads the web profiler configuration. + * + * @param array $config An array of configuration settings + * @param ContainerBuilder $container A ContainerBuilder instance + */ + public function configLoad($config, ContainerBuilder $container) + { + $loader = new XmlFileLoader($container, __DIR__.'/../Resources/config'); + + if (isset($config['toolbar'])) { + if ($config['toolbar']) { + if (!$container->hasDefinition('debug.toolbar')) { + $loader = new XmlFileLoader($container, __DIR__.'/../Resources/config'); + $loader->load('toolbar.xml'); + $loader->load('web_profiler.xml'); + } + } elseif ($container->hasDefinition('debug.toolbar')) { + $container->getDefinition('debug.toolbar')->clearTags(); + } + } + + if (isset($config['intercept-redirects'])) { + $container->setParameter('debug.toolbar.intercept_redirects', (Boolean) $config['intercept-redirects']); + } elseif (isset($config['intercept_redirects'])) { + $container->setParameter('debug.toolbar.intercept_redirects', (Boolean) $config['intercept_redirects']); + } + } + + /** + * Returns the base path for the XSD files. + * + * @return string The XSD base path + */ + public function getXsdValidationBasePath() + { + return __DIR__.'/../Resources/config/schema'; + } + + public function getNamespace() + { + return 'http://www.symfony-project.org/schema/dic/webprofiler'; + } + + public function getAlias() + { + return 'webprofiler'; + } +} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/ICONS_LICENSE.txt b/src/Symfony/Bundle/WebProfilerBundle/Resources/ICONS_LICENSE.txt new file mode 100644 index 0000000000..7d5fff7936 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/ICONS_LICENSE.txt @@ -0,0 +1,6 @@ +Icons License +============= + +Glyphish icons (http://glyphish.com/) created by Joseph Wain +(http://www.penandthink.com/) are shared under a Creative Commons Attribution +license (http://creativecommons.org/licenses/by/3.0/us/). \ No newline at end of file diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml new file mode 100644 index 0000000000..ddeb9ad341 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml @@ -0,0 +1,34 @@ + + + + + + WebProfilerBundle:Profiler:search + + + + WebProfilerBundle:Profiler:purge + + + + WebProfilerBundle:Profiler:import + + + + WebProfilerBundle:Profiler:export + + + + WebProfilerBundle:Profiler:searchResults + + + + WebProfilerBundle:Profiler:index + + + + WebProfilerBundle:Profiler:panel + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/schema/webprofiler-1.0.xsd b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/schema/webprofiler-1.0.xsd new file mode 100644 index 0000000000..63c50ae5d1 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/schema/webprofiler-1.0.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/toolbar.xml b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/toolbar.xml new file mode 100644 index 0000000000..316c65cd7e --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/toolbar.xml @@ -0,0 +1,19 @@ + + + + + + Symfony\Bundle\WebProfilerBundle\WebDebugToolbarListener + false + + + + + + + %debug.toolbar.intercept_redirects% + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/web_profiler.xml b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/web_profiler.xml new file mode 100644 index 0000000000..8135054e79 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/web_profiler.xml @@ -0,0 +1,20 @@ + + + + + + + WebProfilerBundle:Profiler:config + WebProfilerBundle:Profiler:request + WebProfilerBundle:Profiler:exception + WebProfilerBundle:Profiler:events + WebProfilerBundle:Profiler:logger + WebProfilerBundle:Profiler:timer + WebProfilerBundle:Profiler:memory + DoctrineBundle:Profiler:db + DoctrineMongoDBBundle:Profiler:mongodb + + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/profiler.css b/src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/profiler.css new file mode 100644 index 0000000000..2e380f267c --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/profiler.css @@ -0,0 +1,203 @@ +/* +Copyright (c) 2010, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.com/yui/license.html +version: 3.1.2 +build: 56 +*/ +html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;} + +.clearfix:after { + content: "\0020"; + display: block; + height: 0; + clear: both; + visibility: hidden; + overflow: hidden; +} +.clearfix {display: inline-block;} +* html .clearfix {height: 1%;} +.clearfix {display: block;} + +html { + background: #fff; +} + +body { + font: 11px Verdana, Arial, sans-serif; + color: #222; +} + +strong { + font-weight: bold; +} + +em { + font-style: italic; +} + +a { + color: #222; +} + +abbr { + border-bottom: 1px dotted #000000; + cursor: help; +} + +h1 { + font-size: 190%; + letter-spacing: -0.03em; +} + +h1 img { + margin: 0 5px 0 0; + height: 32px; +} + +h2 { + font-size: 180%; + letter-spacing: -0.02em; + padding: 10px 0; +} + +h3 { + font-size: 160%; + letter-spacing: -0.02em; + padding: 10px 0; +} + +img { + vertical-align: middle; +} + +.header { + padding: 10px; + background: #333; + color: #fff; +} + +.header div { + margin-left: 45px; +} + +.menu, td.menu { + width: 240px; +} + +.content { + padding: 15px; + padding-left: 35px; + padding-top: 15px; +} + +.search, .import { + background: #efefef; + color: #333; +} + +.search h3, .import h3 { + padding: 4px 10px; + background-image: -moz-linear-gradient(-90deg, #ededed, #a3a2a2); + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ededed), to(#a3a2a2)); + font-size: 115%; +} + +.search form, .import form { + padding: 10px; +} + +.search input, .import input { + float: left; + margin-bottom: 7px; +} + +.search input.submit, .import input.submit { + float: right; +} + +.search label { + float: left; + width: 50px; +} + +th, td { + padding: 5px; + border: 1px solid #b4b4b4; +} + +th { + font-weight: bold; + background: #edf3fe; +} + +pre { + overflow: auto; +} + +table { + width: 100%; +} + +.menu ul { + background: #dde4eb; + font-size: 130%; + padding: 15px 0; +} + +.menu li { + padding: 5px 10px; +} + +.menu li.selected { + background: #0065bd; + color: #fff; + background-image: -moz-linear-gradient(-90deg, #5fa3e0, #0065bd); + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#5fa3e0), to(#0065bd)); +} + +.menu li a { + color: #000; + text-decoration: none; +} + +.menu li.selected a { + color: #fff; +} + +.count { + font-family: monospace; + font-weight: bold; + padding: 4px; + margin-left: 5px; + margin-top: 5px; + font-size: 80%; + float: right; + background-color: #9cc2e8; + color: #fff; + -moz-border-radius: 7px; -webkit-border-radius: 7px; border-radius: 7px; +} + +.sf-toolbarreset { + border-top: 0; +} + +ul.alt li { + padding: 5px 7px; +} + +ul.alt li.even { + background: #edf3fe; +} + +ul.alt li.error { + background-color: #f66; +} + +td.main, td.menu { + text-align: left; + margin: 0; + padding: 0; + border: 0; + vertical-align: top; +} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/toolbar.css b/src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/toolbar.css new file mode 100644 index 0000000000..d626e68003 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/toolbar.css @@ -0,0 +1,23 @@ +/* +Copyright (c) 2010, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.com/yui/license.html +version: 3.1.2 +build: 56 +*/ +.sf-toolbarreset html{color:#000;background:#FFF;}.sf-toolbarreset body,.sf-toolbarreset div,.sf-toolbarreset dl,.sf-toolbarreset dt,.sf-toolbarreset dd,.sf-toolbarreset ul,.sf-toolbarreset ol,.sf-toolbarreset li,.sf-toolbarreset h1,.sf-toolbarreset h2,.sf-toolbarreset h3,.sf-toolbarreset h4,.sf-toolbarreset h5,.sf-toolbarreset h6,.sf-toolbarreset pre,.sf-toolbarreset code,.sf-toolbarreset form,.sf-toolbarreset fieldset,.sf-toolbarreset legend,.sf-toolbarreset input,.sf-toolbarreset textarea,.sf-toolbarreset p,.sf-toolbarreset blockquote,.sf-toolbarreset th,.sf-toolbarreset td{margin:0;padding:0;}.sf-toolbarreset table{border-collapse:collapse;border-spacing:0;}.sf-toolbarreset fieldset,.sf-toolbarreset img{border:0;}.sf-toolbarreset address,.sf-toolbarreset caption,.sf-toolbarreset cite,.sf-toolbarreset code,.sf-toolbarreset dfn,.sf-toolbarreset em,.sf-toolbarreset strong,.sf-toolbarreset th,.sf-toolbarreset var{font-style:normal;font-weight:normal;}.sf-toolbarreset li{list-style:none;}.sf-toolbarreset caption,.sf-toolbarreset th{text-align:left;}.sf-toolbarreset h1,.sf-toolbarreset h2,.sf-toolbarreset h3,.sf-toolbarreset h4,.sf-toolbarreset h5,.sf-toolbarreset h6{font-size:100%;font-weight:normal;}.sf-toolbarreset q:before,.sf-toolbarreset q:after{content:'';}.sf-toolbarreset abbr,.sf-toolbarreset acronym{border:0;font-variant:normal;}.sf-toolbarreset sup{vertical-align:text-top;}.sf-toolbarreset sub{vertical-align:text-bottom;}.sf-toolbarreset input,.sf-toolbarreset textarea,.sf-toolbarreset select{font-family:inherit;font-size:inherit;font-weight:inherit;}.sf-toolbarreset input,.sf-toolbarreset textarea,.sf-toolbarreset select{*font-size:100%;}.sf-toolbarreset legend{color:#000;} + +.sf-toolbarreset { + background: #cbcbcb; + background-image: -moz-linear-gradient(-90deg, #e8e8e8, #cbcbcb); + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#e8e8e8), to(#cbcbcb)); + bottom: 0px; + left:0; + z-index: 6000000; + width: 100%; + border-top: 1px solid #bbb; + padding: 5px 0; + margin: 0; + font: 11px Verdana, Arial, sans-serif; + color: #000; +} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/config.png b/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/config.png new file mode 100644 index 0000000000000000000000000000000000000000..e0387ce235c919b2e23352fc651461cab2bd8966 GIT binary patch literal 473 zcmV;~0Ve*5P)an#q+TDFm#o zts8KK47qZ6(?Du!DovYYvuDp9LOo0{}pO(K;`3KpuTS4!W+pq$t?74Ojwp4lK)JIF5tKXFJi;oS+K8XxkQE;e_kD z{BK~M=YRA(?-nPR0x;^jhPR%AX_}}}xd7ky-@KQUWeH_?(gKR2;BJL1k11drM{10s zh?`lKWl)AE?LZvILYay3q#elfoSIn}hPwq>JQiQrfglK=NJcE4umgyY+od5s;07*qoM6N<$g4?yG!vFvP literal 0 HcmV?d00001 diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/events.png b/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/events.png new file mode 100644 index 0000000000000000000000000000000000000000..52d7b6e0b17ed4ee587f834f170d32d971298850 GIT binary patch literal 841 zcmV-P1GfB$P)q$gGRCwBA{Qv(y!$1Nih5-hn4qyPK z0T?C{=m7D4DAuFYP8MP`EL*k=&Ym}KUP@9@k^_i+^5jWP!fA{Vk3$h%|(g4U35RQq7;Z;;rl!fuXe*LNoW8=g408t_E_wQdYt)!&n z%*V&a3F9j(D=Wd+2!MFJE}+>HrA|2|Hv9xwyDwDRlr*Y2eSFKMd*V z=~9}Sn&Ke#j~_pNf@olL@PlZmya|krj;Z1RZEfvXn1LTZemn?u2nS5e!os39J3HH( zR0pt-;D8tq{qyI~Pp@CUUdqkQ?It23!Uwa!#>U1T7$wR;{#KeqfvT#i3e@+9A3l8e z4B3ap#l>QxqN4oH&d!=Zwg%OspuD`?9Oyd^XuK}~mVPf`h6Cj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;;C{>g4{Z-4f}V}#c%8pd%Lz54nAcLm%GRG*>V zkNW#wxD5j3coF|P^*P4t7K-9);N1%X(M?$jus{mnQ{W@IA|%}3fS>8xrl+UpiB}&a zB_$$ zhW`=&^gVPPB5^0$63QQZIOllo@0{=bo^$XXy3^@U;|v}(=HPR6(lp(z&Va|@4mbqw z!DqHSGq_x)IXiy|P>99i=Qf*7x4gV8YqeVWbUGc`-rjC{yNeXVKN?%=T*DizPz%sB2+4sw}e8Wwp=cMibNs@!C;U{CX*E+gb3Q& z+9D-ou~>!|U^E(|CX?xEyM%)mpe?QQU(0pkV>U|gTZhGF5QM; zUN)Qk>i7H0;c$2gL;N6OFvr`W1Z-|@b}&)V<#NSlXJ@}@wb~PfLeYYVPPJMUftg~l z*pA2J`?XrFfs}?$r<=wz20U{O?(F+~zDqzglmMsGdD@vsB#xue=us>dD`K)EjYbny ztJPJBM8Y(i%?p)E+9=ef4s3;t@Kc*02}VKzPPwJM_655rSRsB z-QC^mfk5E6P$<;r=jXrZ_4)(3Ts|d}$)+=z%uVbS8u`ygI)=RhdIR<{WZem*4Of3n>YC{_!9!GDDHwsKztqoI4>p+hr@-ztY8jk!BenDCg6h1EfR^+Y}>_o_c-fb zu(r1LyDmAn2OhFzuRAo3-xEHc{|@z!_^{>tEawkuXI~_Ni-qbFL-BaLm&iLAWVz`7 g{&G5Y0Y3#803m1Q8~ae%7XSbN07*qoM6N<$f-Cl8AOHXW literal 0 HcmV?d00001 diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/memory.png b/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/memory.png new file mode 100644 index 0000000000000000000000000000000000000000..9d2e6201e083f6a869031fe0735d5e60e194ba89 GIT binary patch literal 436 zcmV;l0ZaagP)C`tOwm@B1D* z(mt?*?F6{YUBq$x=i&6aaqTI0*k{+L04&Q=UU<1xx%gZc3>Cmk(*!qYn)VChLu^eo zVBYLAE=#L)T?f2j7|Q?H+xNg|ZQBC>IoLz^wv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zVj%p>y|oscTf*45SB zLf+MIF4{mt-wkIa=!bz2(bImI>bqeUCwelE%(vNWhsl^Xfuf=!Ygt)YK3#4S6A0EGc%P$Rw|VyIC;S}0@OY!uc5&Ye*)2HbROjOL`F$n;X{Dhr~2Wa0+iDT z^JSxyPCK2>^IWQc*b)1b@*NRW1qjYM zb&*Y&VRxI@lL(*;H;ErE-@uM{fy3drFOf)Y(ul-;KHt38>-9i%LFI36Z~xNM({l*& zN!VSks;W9;Fc=CTCnGvLJG(G6G-QF@8`$x`jN01TWLWGS{FN~Ja5(&9a&mHhZf@=y z4xAXSWLaThVOD8rX@N$gQLz?Dcs!oq)YQ}s484M`V_YgZ=w1OvAuk<50#OT2Pfu?l z!RtZN+}x}{cL!(zWV@^v14y-8O8u}2iLtSNYvESB%;qS8&C}#2aW&> zz(>FhJfqLE3zWzf6653J!9XBz9mBW02{bk~@{N8v5+CqHE*D_=`K6e3a!$3WY zgt)xC`~-YGfL!sX38W=qG#XFsc@XVzG75e2ZzF;9e*c>U7!ozWBTB%!=Slegzu`Ye c;Fkac06rwHEe$7WPXGV_07*qoM6N<$g88k^hX4Qo literal 0 HcmV?d00001 diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/timer.png b/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/timer.png new file mode 100644 index 0000000000000000000000000000000000000000..c34b36982b46b6c7d4d77911858882747c62ef56 GIT binary patch literal 1022 zcmV#Fxn4_U58LPaz`|Aw?&I z_F$;PiT~~Q#l5uFy?1vR`p|)o^PO|Q-*n|O~Wz^ErB1k}4}X8s(yK?sfeINu`E85kKEk+ik7DWN{9t*vdeTCK{8ii)Db z!a_wVW^;3MXK`_HBNB;xou8k7k14-et*-0r>=P~_T=laM!Q zFgwHnDd)L@pF27_s+fY=kLUe=(itLtYj@caFg1EP?JkOx?- z7q$hg9k$@HN~Q8;bq31H%0eEG=MKF&Y-sTY=8$pag7jNZ1I$~NL@*e9IXgRhn`u}#le-C!`h;Im_WkWbNDK#bWm%S)raT^B$LT?oZRzDrSh5p`ze9y z=vO*reBd^$i;e({-w|VgH3I_!PJt*iF~a$ru;hdE{r&wZ(F7C<#UO#uE9&d(pAHQT zRq`wnW#o@%gdr^XpmA<)?laK@d_G?kY4jrjtE#HB_#B5YS1C3XlPzHgOJnkdxmdPk zxeH<2lF4LpCbs zVMrCvhcwt_svk@ylUc9Vm*?c$2SKb~|7*#(rA2x3_mzR#w(f^{l00 zP%RZB?8R)xV?N<`!{PAcNy~C_Pz`VxeIp$z)P!mhfg+ZQ6E`sNe^nL7nLi);rr#$b s9Hm#BS$K@;MK$Sv|8sig1bzrG01;Itfj+vSaR2}S07*qoM6N<$f=_$mGynhq literal 0 HcmV?d00001 diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/admin.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/admin.php new file mode 100644 index 0000000000..9fb00ec030 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/admin.php @@ -0,0 +1,18 @@ +
+

+ + Admin +

+ +
+
+ » Purge +
+
+ » Export +
+ » 
+
+ +
+
diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/bag.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/bag.php new file mode 100644 index 0000000000..bdbb615e26 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/bag.php @@ -0,0 +1,12 @@ + + + + + + keys() as $key): ?> + + + + + +
KeyValue
get($key) ?>
diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base.php new file mode 100644 index 0000000000..ad12803c6b --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base.php @@ -0,0 +1,13 @@ + + + + + <?php $view->get('slots')->output('title', 'Profiler') ?> + get('stylesheets') ?> + get('javascripts') ?> + + + + get('slots')->output('_content') ?> + + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/config_bar.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/config_bar.php new file mode 100644 index 0000000000..30386f8440 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/config_bar.php @@ -0,0 +1,8 @@ +Symfony +getSymfonyVersion() ?> + +PHP +getPhpVersion() ?>|xdebug|accel + + +getAppName() ?>|getEnv() ?>|isDebug() ? 'debug' : 'no-debug' ?>|getUrl()): ?>getToken() ?>getToken() ?> diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/events_menu.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/events_menu.php new file mode 100644 index 0000000000..bb5d9effc1 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/events_menu.php @@ -0,0 +1,2 @@ + +Events \ No newline at end of file diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/events_panel.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/events_panel.php new file mode 100644 index 0000000000..f561765256 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/events_panel.php @@ -0,0 +1,33 @@ +

Called Events

+ + + + + + + + getCalledEvents() as $event): ?> + + + + + + +
EventCallerListener
get('code')->abbrClass($event['caller']) ?>get('code')->abbrMethod($event['listener']) ?>()
+ +getNotCalledEvents()): ?> +

Not Called Events

+ + + + + + + + + + + + +
EventListener
get('code')->abbrMethod($event['listener']) ?>()
+ diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/exception_menu.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/exception_menu.php new file mode 100644 index 0000000000..7cd3246533 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/exception_menu.php @@ -0,0 +1,5 @@ +hasException()): ?> +
hasException() ?>
+ + +Exception \ No newline at end of file diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/exception_panel.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/exception_panel.php new file mode 100644 index 0000000000..3167cb7f17 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/exception_panel.php @@ -0,0 +1,10 @@ +get('stylesheets')->add('bundles/framework/css/exception.css') ?> + +

Exception

+ +hasException()): ?> + No exception was thrown and uncaught during the request. + + + +get('actions')->render('WebProfilerBundle:Exception:show', array('exception' => $data->getException(), 'format' => 'html')) ?> diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/index.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/index.php new file mode 100644 index 0000000000..5dabf7f444 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/index.php @@ -0,0 +1,3 @@ +extend('WebProfilerBundle:Profiler:layout') ?> + +render($template, array('data' => $collector)) ?> diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.php new file mode 100644 index 0000000000..3598277e23 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.php @@ -0,0 +1,23 @@ +extend('WebProfilerBundle:Profiler:base') ?> + +
+

+ + Symfony Profiler +

+
+ getUrl() ?> by getIp() ?> at getTime()) ?> +
+
+ +get('actions')->render('WebProfilerBundle:Profiler:toolbar', array('token' => $token, 'position' => 'normal')) ?> + + + +
+
+ get('slots')->output('_content') ?> +
+
diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/logger_bar.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/logger_bar.php new file mode 100644 index 0000000000..86dfa51a38 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/logger_bar.php @@ -0,0 +1,2 @@ + +countErrors() ?> diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/logger_menu.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/logger_menu.php new file mode 100644 index 0000000000..4f8dd4a79d --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/logger_menu.php @@ -0,0 +1,3 @@ +
countErrors() ?>
+ +Logs diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/logger_panel.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/logger_panel.php new file mode 100644 index 0000000000..755ee0af53 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/logger_panel.php @@ -0,0 +1,14 @@ +

Logs

+ +getLogs()): ?> +
    + getLogs() as $i => $log): ?> +
  • + : + $2$1', $log['message']) ?> +
  • + +
+ + No logs available. + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/memory_bar.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/memory_bar.php new file mode 100644 index 0000000000..15aec05e1f --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/memory_bar.php @@ -0,0 +1,2 @@ + +getMemory() / 1024) ?> KB diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/menu.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/menu.php new file mode 100644 index 0000000000..363035784b --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/menu.php @@ -0,0 +1,15 @@ + + +get('actions')->render('WebProfilerBundle:Profiler:menu', array('token' => $token)) ?> + +render('WebProfilerBundle:Profiler:admin', array('token' => $token)) ?> diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/notfound.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/notfound.php new file mode 100644 index 0000000000..32a642de49 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/notfound.php @@ -0,0 +1,15 @@ +extend('WebProfilerBundle:Profiler:base') ?> + +
+

+ + Symfony Profiler +

+
+ Token "" does not exist. +
+
+ + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/panel.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/panel.php new file mode 100644 index 0000000000..5dabf7f444 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/panel.php @@ -0,0 +1,3 @@ +extend('WebProfilerBundle:Profiler:layout') ?> + +render($template, array('data' => $collector)) ?> diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/request_bar.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/request_bar.php new file mode 100644 index 0000000000..17483217c4 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/request_bar.php @@ -0,0 +1,2 @@ + +getRoute()): ?>getRoute() ?>NONE|getFormat() ?>|getStatusCode() ?>|getContentType() ?> diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/request_menu.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/request_menu.php new file mode 100644 index 0000000000..736fa537cb --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/request_menu.php @@ -0,0 +1,2 @@ + +Request \ No newline at end of file diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/request_panel.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/request_panel.php new file mode 100644 index 0000000000..697de45b0e --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/request_panel.php @@ -0,0 +1,39 @@ +

Request GET Parameters

+ +getRequestQuery()->all())): ?> + render('WebProfilerBundle:Profiler:bag', array('bag' => $data->getRequestQuery())) ?> + + No GET parameters + + +

Request POST Parameters

+ +getRequestRequest()->all())): ?> + render('WebProfilerBundle:Profiler:bag', array('bag' => $data->getRequestRequest())) ?> + + No POST parameters + + +

Request Cookies

+ +getRequestCookies()->all())): ?> + render('WebProfilerBundle:Profiler:bag', array('bag' => $data->getRequestCookies())) ?> + + No cookies + + +

Requests Headers

+ +render('WebProfilerBundle:Profiler:bag', array('bag' => $data->getRequestHeaders())) ?> + +

Requests Server Parameters

+ +render('WebProfilerBundle:Profiler:bag', array('bag' => $data->getRequestServer())) ?> + +

Response Headers

+ +render('WebProfilerBundle:Profiler:bag', array('bag' => $data->getResponseHeaders())) ?> + +

Response Session Attributes

+ +render('WebProfilerBundle:Profiler:bag', array('bag' => $data->getSessionAttributes())) ?> diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/results.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/results.php new file mode 100644 index 0000000000..bc6f693d6d --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/results.php @@ -0,0 +1,20 @@ +extend('WebProfilerBundle:Profiler:layout') ?> + +

Search Results

+ + + + + + + + + + + + + + + + +
TokenIPURLTime
diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/search.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/search.php new file mode 100644 index 0000000000..e358a60db2 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/search.php @@ -0,0 +1,24 @@ + diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/timer_bar.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/timer_bar.php new file mode 100644 index 0000000000..a279c347ed --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/timer_bar.php @@ -0,0 +1,2 @@ + +getTime() * 1000) ?> ms diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.php b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.php new file mode 100644 index 0000000000..6f3e29a917 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.php @@ -0,0 +1,30 @@ +get('stylesheets')->add('bundles/webprofiler/css/toolbar.css') ?> + + + +
+ +
+ style="position: ; + background: #cbcbcb; + background-image: -moz-linear-gradient(-90deg, #e8e8e8, #cbcbcb); + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#e8e8e8), to(#cbcbcb)); + bottom: 0px; + left:0; + z-index: 6000000; + width: 100%; + border-top: 1px solid #bbb; + padding: 5px; + margin: 0; + font: 11px Verdana, Arial, sans-serif; + color: #000; + " + +> + $template): ?> + render($template, array('data' => $profiler->getCollector($name))) ?> + +
+ diff --git a/src/Symfony/Bundle/WebProfilerBundle/WebDebugToolbarListener.php b/src/Symfony/Bundle/WebProfilerBundle/WebDebugToolbarListener.php new file mode 100644 index 0000000000..4211a4d6dc --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/WebDebugToolbarListener.php @@ -0,0 +1,97 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +/** + * WebDebugToolbarListener injects the Web Debug Toolbar. + * + * @author Fabien Potencier + */ +class WebDebugToolbarListener +{ + protected $resolver; + protected $interceptRedirects; + + public function __construct(ControllerResolver $resolver, $interceptRedirects = false) + { + $this->resolver = $resolver; + $this->interceptRedirects = $interceptRedirects; + } + + /** + * Registers a core.response listener. + * + * @param EventDispatcher $dispatcher An EventDispatcher instance + * @param integer $priority The priority + */ + public function register(EventDispatcher $dispatcher, $priority = 0) + { + $dispatcher->connect('core.response', array($this, 'handle'), $priority); + } + + public function handle(Event $event, Response $response) + { + if (HttpKernelInterface::MASTER_REQUEST !== $event->getParameter('request_type')) { + return $response; + } + + if ($response->headers->has('X-Debug-Token') && $response->isRedirect() && $this->interceptRedirects) { + $r = new Response(); + $r->setContent( + sprintf('

This Request redirects to
%s.

', + $response->headers->get('location'), $response->headers->get('location')) + ); + $r->headers->set('X-Debug-Token', $response->headers->get('X-Debug-Token')); + + $response = $r; + } + + $request = $event->getParameter('request'); + if (!$response->headers->has('X-Debug-Token') + || '3' === substr($response->getStatusCode(), 0, 1) + || ($response->headers->has('Content-Type') && false === strpos($response->headers->get('Content-Type'), 'html')) + || 'html' !== $request->getRequestFormat() + || $request->isXmlHttpRequest() + ) { + return $response; + } + + $response->setContent($this->injectToolbar($request, $response)); + + return $response; + } + + /** + * Injects the web debug toolbar into a given HTML string. + * + * @param string $content The HTML content + * + * @return Response A Response instance + */ + protected function injectToolbar(Request $request, Response $response) + { + $toolbar = "\n".str_replace("\n", '', $this->resolver->render('WebProfilerBundle:Profiler:toolbar'))."\n"; + $content = str_ireplace('', $toolbar.'', $response->getContent(), $count); + if (!$count) { + $content .= $toolbar; + } + + return $content; + } +} diff --git a/src/Symfony/Bundle/WebProfilerBundle/WebProfilerBundle.php b/src/Symfony/Bundle/WebProfilerBundle/WebProfilerBundle.php new file mode 100644 index 0000000000..ae386eaa65 --- /dev/null +++ b/src/Symfony/Bundle/WebProfilerBundle/WebProfilerBundle.php @@ -0,0 +1,23 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +/** + * Bundle. + * + * @author Fabien Potencier + */ +class WebProfilerBundle extends Bundle +{ +}