public function onFinishRequestPre(FinishRequestEvent $event) { if ($event->getRequestType() !== HttpKernelInterface::MASTER_REQUEST) { return; } $key = $this->pageStack->isAdmin() ? 'backend' : 'frontend'; $this->log($key, microtime(true) - $this->start); }
public function onKernelFinishRequest(FinishRequestEvent $event) { $request = $event->getRequest(); if (isset($this->exceptionListeners[$request])) { $this->exceptionListeners[$request]->unregister($this->dispatcher); unset($this->exceptionListeners[$request]); } }
public function onFinishRequest(FinishRequestEvent $event) { $route = $event->getRequest()->attributes->get('_route'); if ('_' === substr($route, 0, 1)) { return; } $requestUriSlug = preg_replace('/[^a-zA-Z0-9_.]/', '', $route); $this->watcher->end($requestUriSlug); }
public function statistic(FinishRequestEvent $event) { if ($event->isMasterRequest()) { $request = $event->getRequest(); $token = $this->securityContext->getToken(); if ($token) { $this->statisticApi->addVisitor($token->getUser(), $request); } } }
/** * Listener resets cwd to its value prior to drupal_bootstrap. * * This is probably unnecessary because the cwd for Symfony web processes * is already the web root. * * @param FinishRequestEvent $event */ public function onKernelPostController(FinishRequestEvent $event) { if (HttpKernelInterface::MASTER_REQUEST === $event->getRequestType()) { chdir($this->cwd); } }
public function __construct(Request $request) { parent::__construct(new NullHttpKernel(), $request, HttpKernelInterface::MASTER_REQUEST); }
/** * @param FinishRequestEvent $event */ public function onFinish(FinishRequestEvent $event) { if ($event->getRequestType() == HttpKernelInterface::MASTER_REQUEST) { $this->profiler->profile($event->getRequest()); } }