MaintenanceModeInterface.php

Same filename and directory in other branches
  1. 8.9.x core/lib/Drupal/Core/Site/MaintenanceModeInterface.php
  2. 10 core/lib/Drupal/Core/Site/MaintenanceModeInterface.php
  3. 11.x core/lib/Drupal/Core/Site/MaintenanceModeInterface.php

Namespace

Drupal\Core\Site

File

core/lib/Drupal/Core/Site/MaintenanceModeInterface.php

View source
<?php

namespace Drupal\Core\Site;

use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Session\AccountInterface;

/**
 * Defines the interface for the maintenance mode service.
 */
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();

}

Interfaces

Title Deprecated Summary
MaintenanceModeInterface Defines the interface for the maintenance mode service.

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