Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added Stopwatch support in debug mode, added a timeline representing …
…the stopwatch events in the web profiler Enjoy!
- Loading branch information
Showing
21 changed files
with
715 additions
and
80 deletions.
There are no files selected for viewing
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
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
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
71 changes: 71 additions & 0 deletions
71
src/Symfony/Bundle/FrameworkBundle/Controller/TraceableControllerResolver.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,71 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Bundle\FrameworkBundle\Controller; | ||
|
||
use Symfony\Component\HttpKernel\Log\LoggerInterface; | ||
use Symfony\Component\HttpKernel\Debug\Stopwatch; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\DependencyInjection\ContainerInterface; | ||
use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser; | ||
|
||
/** | ||
* TraceableControllerResolver. | ||
* | ||
* @author Fabien Potencier <fabien@symfony.com> | ||
*/ | ||
class TraceableControllerResolver extends ControllerResolver | ||
{ | ||
private $stopwatch; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param ContainerInterface $container A ContainerInterface instance | ||
* @param ControllerNameParser $parser A ControllerNameParser instance | ||
* @param Stopwatch $stopwatch A Stopwatch instance | ||
* @param LoggerInterface $logger A LoggerInterface instance | ||
*/ | ||
public function __construct(ContainerInterface $container, ControllerNameParser $parser, Stopwatch $stopwatch, LoggerInterface $logger = null) | ||
{ | ||
parent::__construct($container, $parser, $logger); | ||
|
||
$this->stopwatch = $stopwatch; | ||
} | ||
|
||
/** | ||
* @{inheritdoc} | ||
*/ | ||
public function getController(Request $request) | ||
{ | ||
$e = $this->stopwatch->start('controller.get_callable'); | ||
|
||
$ret = parent::getController($request); | ||
|
||
$e->stop(); | ||
|
||
return $ret; | ||
} | ||
|
||
/** | ||
* @{inheritdoc} | ||
*/ | ||
public function getArguments(Request $request, $controller) | ||
{ | ||
$e = $this->stopwatch->start('controller.get_arguments'); | ||
|
||
$ret = parent::getArguments($request, $controller); | ||
|
||
$e->stop(); | ||
|
||
return $ret; | ||
} | ||
} |
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
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
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
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
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
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
Oops, something went wrong.
In case of closure the 'class' index does not exsist. Thus crashing the dispatcher.