comparison core/lib/Drupal/Core/EventSubscriber/PathSubscriber.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
2 2
3 namespace Drupal\Core\EventSubscriber; 3 namespace Drupal\Core\EventSubscriber;
4 4
5 use Drupal\Core\Path\AliasManagerInterface; 5 use Drupal\Core\Path\AliasManagerInterface;
6 use Drupal\Core\Path\CurrentPathStack; 6 use Drupal\Core\Path\CurrentPathStack;
7 use Symfony\Component\HttpKernel\HttpKernelInterface;
8 use Symfony\Component\HttpKernel\KernelEvents; 7 use Symfony\Component\HttpKernel\KernelEvents;
9 use Symfony\Component\HttpKernel\Event\FilterControllerEvent; 8 use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
10 use Symfony\Component\HttpKernel\Event\PostResponseEvent; 9 use Symfony\Component\HttpKernel\Event\PostResponseEvent;
11 use Symfony\Component\EventDispatcher\EventSubscriberInterface; 10 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
12 11
50 * @param \Symfony\Component\HttpKernel\Event\FilterControllerEvent $event 49 * @param \Symfony\Component\HttpKernel\Event\FilterControllerEvent $event
51 * The Event to process. 50 * The Event to process.
52 */ 51 */
53 public function onKernelController(FilterControllerEvent $event) { 52 public function onKernelController(FilterControllerEvent $event) {
54 // Set the cache key on the alias manager cache decorator. 53 // Set the cache key on the alias manager cache decorator.
55 if ($event->getRequestType() == HttpKernelInterface::MASTER_REQUEST) { 54 if ($event->isMasterRequest()) {
56 $this->aliasManager->setCacheKey(rtrim($this->currentPath->getPath($event->getRequest()), '/')); 55 $this->aliasManager->setCacheKey(rtrim($this->currentPath->getPath($event->getRequest()), '/'));
57 } 56 }
58 } 57 }
59 58
60 /** 59 /**