interface MaintenanceModeInterface

Same name in other branches
  1. 9 core/lib/Drupal/Core/Site/MaintenanceModeInterface.php \Drupal\Core\Site\MaintenanceModeInterface
  2. 8.9.x 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

3 files declare their use of MaintenanceModeInterface
JsonapiMaintenanceModeSubscriber.php in core/modules/jsonapi/src/EventSubscriber/JsonapiMaintenanceModeSubscriber.php
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);
    
    /**
     * Gets the site maintenance message.
     *
     * @return \Drupal\Component\Render\MarkupInterface
     *   The formatted site maintenance message.
     */
    public function getSiteMaintenanceMessage();

}

Members

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

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