123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- namespace Symfony\Component\HttpKernel\Controller;
- use Symfony\Component\Stopwatch\Stopwatch;
- use Symfony\Component\HttpFoundation\Request;
- class TraceableControllerResolver implements ControllerResolverInterface
- {
- private $resolver;
- private $stopwatch;
-
- public function __construct(ControllerResolverInterface $resolver, Stopwatch $stopwatch)
- {
- $this->resolver = $resolver;
- $this->stopwatch = $stopwatch;
- }
-
- public function getController(Request $request)
- {
- $e = $this->stopwatch->start('controller.get_callable');
- $ret = $this->resolver->getController($request);
- $e->stop();
- return $ret;
- }
-
- public function getArguments(Request $request, $controller)
- {
- $e = $this->stopwatch->start('controller.get_arguments');
- $ret = $this->resolver->getArguments($request, $controller);
- $e->stop();
- return $ret;
- }
- }
|