/**
* Returns the site maintenance page if the site is offline.
*
* @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
* The event to process.
*/
public function onKernelRequestMaintenance(RequestEvent
$event) { $request =
$event->
getRequest();
$route_match = RouteMatch::
createFromRequest($request);
if ($this->maintenanceMode->
applies($route_match)) { // Don't cache maintenance mode pages.
\Drupal::
service('page_cache_kill_switch'
)->
trigger();
if (!
$this->maintenanceMode->
exempt($this->account
)) { // When the account is not exempt, other subscribers handle request.
$this->eventDispatcher->
dispatch($event, MaintenanceModeEvents::MAINTENANCE_MODE_REQUEST
);
} else { // Display a message if the logged-in user has access to the site in
// maintenance mode. Don't show maintenance message:
// - on AJAX requests.