You are here

protected function DrupalUtils::takeSiteOffline in Backup and Migrate 8.4

Take the site offline if we need to.

1 call to DrupalUtils::takeSiteOffline()
DrupalUtils::setUp in src/Filter/DrupalUtils.php
Run before the backup/restore begins.

File

src/Filter/DrupalUtils.php, line 75

Class

DrupalUtils
Class DrupalUtils.

Namespace

BackupMigrate\Drupal\Filter

Code

protected function takeSiteOffline() {

  // Take the site offline.
  if ($this
    ->confGet('site_offline') && !\Drupal::state()
    ->get('system.maintenance_mode')) {
    \Drupal::state()
      ->set('system.maintenance_mode', TRUE);
    $this->maintenance_mode = TRUE;
  }
}