You are here

public function MaintenanceMode::applies in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Site/MaintenanceMode.php \Drupal\Core\Site\MaintenanceMode::applies()

Returns whether the site is in maintenance mode.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match.

Return value

bool TRUE if the site is in maintenance mode.

Overrides MaintenanceModeInterface::applies

File

core/lib/Drupal/Core/Site/MaintenanceMode.php, line 39
Contains \Drupal\Core\Site\MaintenanceMode.

Class

MaintenanceMode
Provides the default implementation of the maintenance mode service.

Namespace

Drupal\Core\Site

Code

public function applies(RouteMatchInterface $route_match) {
  if (!$this->state
    ->get('system.maintenance_mode')) {
    return FALSE;
  }
  if ($route = $route_match
    ->getRouteObject()) {
    if ($route
      ->getOption('_maintenance_access')) {
      return FALSE;
    }
  }
  return TRUE;
}