Commit 6722061d authored by catch's avatar catch

Issue #2613400 by zaurav, valthebald, dawehner, tim.plunkett: Remove...

Issue #2613400 by zaurav, valthebald, dawehner, tim.plunkett: Remove Drupal\Core\EventSubscriber\RouterRebuildSubscriber
parent e8a4f8bc
<?php
/**
* @file
* Contains \Drupal\Core\EventSubscriber\RouterRebuildSubscriber.
*/
namespace Drupal\Core\EventSubscriber;
use Drupal\Core\Routing\RouteBuilderInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
/**
* Rebuilds the router if needed at the end of the request.
*/
class RouterRebuildSubscriber implements EventSubscriberInterface {
/**
* @var \Drupal\Core\Routing\RouteBuilderInterface
*/
protected $routeBuilder;
/**
* Constructs the RouterRebuildSubscriber object.
*
* @param \Drupal\Core\Routing\RouteBuilderInterface $route_builder
* The route builder.
*/
public function __construct(RouteBuilderInterface $route_builder) {
$this->routeBuilder = $route_builder;
}
/**
* Rebuilds routers if necessary.
*
* @param \Symfony\Component\HttpKernel\Event\PostResponseEvent $event
* The event object.
*/
public function onKernelTerminate(PostResponseEvent $event) {
$this->routeBuilder->rebuildIfNeeded();
}
/**
* {@inheritdoc}
*/
static function getSubscribedEvents() {
$events[KernelEvents::TERMINATE][] = array('onKernelTerminate', 200);
return $events;
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment