Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebProfilerBundle] added the bundle
- Loading branch information
Showing
53 changed files
with
1,213 additions
and
1 deletion.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
src/Symfony/Bundle/DoctrineBundle/Resources/views/Profiler/db_bar.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<img style="margin: 0 5px 0 10px; vertical-align: middle; height: 24px" alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAASxJREFUeNrsV00KhCAYzaGDzLZbONcIghadoDZtiqJNbVq0Ctq06xjNCTrDnKMfGoVpsFBRqNz4QD7NR77vmZ8E1nU1VOJhKIYWoAUoF2CSAwBAf9E6L3JAHn1ADrquu6Qo2LYNWAJ2DizLYjiOg8lnO9HTnKAKwGjbFl7hhOu6/G9gnud/9DzvFieYAjDquoa3noJpmqhRuQDf99+8l5RlCWV40gKKouBuhSyPKWAcR2qMooibWZZlUIYn7UAcx0KZifKkHcjznJpZGIa7BVk8Fl/YgSAIoEhGLJ6wA4iQ3H0Md9dxVVXpUcCxDcPwQRHg9utLzR+TMmmqUCVMyIpIwrKs5/ac7IvOc7dgQ9M0KUvApZXwCHQ7YieSk9fcvQ/oHxMtQAtQLeArwABN1BHcHlpLnQAAAABJRU5ErkJggg==" /> | ||
<span style="color: <?php echo $data->getQueryCount() < 10 ? '#000' : '#d22' ?>"><?php echo $data->getQueryCount() ?></span><span style="margin: 0; padding: 0; color: #aaa">|</span><?php echo sprintf('%0.2f', $data->getTime()) ?> ms |
4 changes: 4 additions & 0 deletions
4
src/Symfony/Bundle/DoctrineBundle/Resources/views/Profiler/db_menu.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<div class="count"><?php echo sprintf('%0.0f', $data->getTime()) ?> ms</div> | ||
<div class="count"><?php echo $data->getQueryCount() ?></div> | ||
<img style="margin: 0 5px 0 0; vertical-align: middle; width: 32px" alt="" src="<?php echo $view->get('assets')->getUrl('bundles/webprofiler/images/db.png') ?>" /> | ||
Doctrine |
19 changes: 19 additions & 0 deletions
19
src/Symfony/Bundle/DoctrineBundle/Resources/views/Profiler/db_panel.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<h2>Queries</h2> | ||
|
||
<?php if (0 == $data->getQueryCount()): ?> | ||
<em>No queries.</em> | ||
<?php else: ?> | ||
<ul class="alt"> | ||
<?php foreach ($data->getQueries() as $i => $query): ?> | ||
<li class="<?php echo $i % 2 ? 'odd' : 'even' ?>"> | ||
<div> | ||
<code><?php echo $query['sql'] ?></code> | ||
</div> | ||
<small> | ||
<?php //echo $query['params'] ?> | ||
<strong>Time</strong>: <?php echo sprintf('%0.2f', $query['executionMS']) ?> ms | ||
</small> | ||
</li> | ||
<?php endforeach; ?> | ||
</ul> | ||
<?php endif; ?> |
2 changes: 2 additions & 0 deletions
2
src/Symfony/Bundle/DoctrineMongoDBBundle/Resources/views/Profiler/mongodb_bar.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<img style="margin: 0 5px 0 10px; vertical-align: middle; height: 24px" alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAASxJREFUeNrsV00KhCAYzaGDzLZbONcIghadoDZtiqJNbVq0Ctq06xjNCTrDnKMfGoVpsFBRqNz4QD7NR77vmZ8E1nU1VOJhKIYWoAUoF2CSAwBAf9E6L3JAHn1ADrquu6Qo2LYNWAJ2DizLYjiOg8lnO9HTnKAKwGjbFl7hhOu6/G9gnud/9DzvFieYAjDquoa3noJpmqhRuQDf99+8l5RlCWV40gKKouBuhSyPKWAcR2qMooibWZZlUIYn7UAcx0KZifKkHcjznJpZGIa7BVk8Fl/YgSAIoEhGLJ6wA4iQ3H0Md9dxVVXpUcCxDcPwQRHg9utLzR+TMmmqUCVMyIpIwrKs5/ac7IvOc7dgQ9M0KUvApZXwCHQ7YieSk9fcvQ/oHxMtQAtQLeArwABN1BHcHlpLnQAAAABJRU5ErkJggg==" /> | ||
<span style="color: <?php echo $data->getQueryCount() < 10 ? '#000' : '#d22' ?>"><?php echo $data->getQueryCount() ?></span> |
2 changes: 2 additions & 0 deletions
2
src/Symfony/Bundle/DoctrineMongoDBBundle/Resources/views/Profiler/mongodb_menu.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<img style="margin: 0 5px 0 0; vertical-align: middle; width: 32px" alt="" src="<?php echo $view->get('assets')->getUrl('bundles/webprofiler/images/db.png') ?>" /> | ||
Doctrine MongoDB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
namespace Symfony\Bundle\WebProfilerBundle\Controller; | ||
|
||
use Symfony\Component\DependencyInjection\ContainerAware; | ||
use Symfony\Component\HttpKernel\Exception\FlattenException; | ||
use Symfony\Component\OutputEscaper\SafeDecorator; | ||
|
||
/* | ||
* This file is part of the Symfony framework. | ||
* | ||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
/** | ||
* ExceptionController. | ||
* | ||
* @author Fabien Potencier <fabien.potencier@symfony-project.com> | ||
*/ | ||
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, | ||
) | ||
); | ||
} | ||
} |
Oops, something went wrong.