You are here

public function MaintenanceModeActivate::execute in Automatic Updates 8

Handle database updates.

Return value

bool TRUE if database update was handled successfully, FALSE otherwise.

Overrides DatabaseUpdateHandlerInterface::execute

File

src/Plugin/DatabaseUpdateHandler/MaintenanceModeActivate.php, line 71

Class

MaintenanceModeActivate
Put site into maintenance mode if there are database updates.

Namespace

Drupal\automatic_updates\Plugin\DatabaseUpdateHandler

Code

public function execute() {
  $this->logger
    ->notice('Maintenance mode activated.');
  $this->state
    ->set('system.maintenance_mode', TRUE);
  return TRUE;
}