interface MaintenanceModeInterface

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Site/MaintenanceModeInterface.php \Drupal\Core\Site\MaintenanceModeInterface
  2. 10 core/lib/Drupal/Core/Site/MaintenanceModeInterface.php \Drupal\Core\Site\MaintenanceModeInterface
  3. 11.x core/lib/Drupal/Core/Site/MaintenanceModeInterface.php \Drupal\Core\Site\MaintenanceModeInterface

Defines the interface for the maintenance mode service.

Hierarchy

Expanded class hierarchy of MaintenanceModeInterface

All classes that implement MaintenanceModeInterface

2 files declare their use of MaintenanceModeInterface
MaintenanceModeSubscriber.php in core/modules/user/src/EventSubscriber/MaintenanceModeSubscriber.php
MaintenanceModeSubscriber.php in core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php

File

core/lib/Drupal/Core/Site/MaintenanceModeInterface.php, line 11

Namespace

Drupal\Core\Site
View source
interface MaintenanceModeInterface {
    
    /**
     * Returns whether the site is in maintenance mode.
     *
     * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
     *   The current route match.
     *
     * @return bool
     *   TRUE if the site is in maintenance mode.
     */
    public function applies(RouteMatchInterface $route_match);
    
    /**
     * Determines whether a user has access to the site in maintenance mode.
     *
     * @param \Drupal\Core\Session\AccountInterface $account
     *   The logged in user.
     *
     * @return bool
     *   TRUE if the user should be exempted from maintenance mode.
     */
    public function exempt(AccountInterface $account);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
MaintenanceModeInterface::applies public function Returns whether the site is in maintenance mode. 1
MaintenanceModeInterface::exempt public function Determines whether a user has access to the site in maintenance mode. 1

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.