/**
  * @param GetResponseEvent $event
  *
  * @return mixed
  */
 public function onKernelRequest(GetResponseEvent $event)
 {
     if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
         return false;
     }
     $this->drupal->defineState($event->getRequest());
     $this->strategy->buildResponse($this->drupal);
     $response = $this->drupal->getResponse();
     if ($this->drupal->hasResponse()) {
         $event->setResponse($response);
     }
 }
Ejemplo n.º 2
0
 /**
  * @param GetResponseForExceptionEvent $event
  */
 public function onKernelException(GetResponseForExceptionEvent $event)
 {
     $is404 = false;
     try {
         $is404 = $this->drupal->is404();
     } catch (InvalidStateMethodCallException $e) {
     }
     if (!$is404) {
         return;
     }
     $exception = $event->getException();
     if ($exception instanceof NotFoundHttpException) {
         $this->drupalRender();
         $event->setResponse($this->drupal->getResponse());
     }
 }