class MaintenanceMode implements MaintenanceModeInterface (View source)

Provides the default implementation of the maintenance mode service.

Properties

protected StateInterface $state

The state.

protected ConfigFactoryInterface $config

The configuration factory.

Methods

__construct(StateInterface $state, ConfigFactoryInterface $config_factory = NULL)

Constructs a new maintenance mode service.

bool
applies(RouteMatchInterface $route_match)

Returns whether the site is in maintenance mode.

bool
exempt(AccountInterface $account)

Determines whether a user has access to the site in maintenance mode.

getSiteMaintenanceMessage()

Gets the site maintenance message.

Details

__construct(StateInterface $state, ConfigFactoryInterface $config_factory = NULL)

Constructs a new maintenance mode service.

Parameters

StateInterface $state

The state.

ConfigFactoryInterface $config_factory

The config factory.

bool applies(RouteMatchInterface $route_match)

Returns whether the site is in maintenance mode.

Parameters

RouteMatchInterface $route_match

The current route match.

Return Value

bool

TRUE if the site is in maintenance mode.

bool exempt(AccountInterface $account)

Determines whether a user has access to the site in maintenance mode.

Parameters

AccountInterface $account

The logged in user.

Return Value

bool

TRUE if the user should be exempted from maintenance mode.

MarkupInterface getSiteMaintenanceMessage()

Gets the site maintenance message.

Return Value

MarkupInterface

The formatted site maintenance message.