コード例 #1
0
 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);
 }
コード例 #2
0
 /**
  * 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);
     }
 }
コード例 #3
0
ファイル: ProfilerListener.php プロジェクト: itkg/profiler
 /**
  * @param FinishRequestEvent $event
  */
 public function onFinish(FinishRequestEvent $event)
 {
     if ($event->getRequestType() == HttpKernelInterface::MASTER_REQUEST) {
         $this->profiler->profile($event->getRequest());
     }
 }