You are here

function drush_acsf_post_go_online in Acquia Cloud Site Factory Connector 8

Runs after a go-online command executes. Verifies maintenance mode.

File

./acsf.drush.inc, line 340
Provides drush commands for site related operations.

Code

function drush_acsf_post_go_online() {
  $content = \Drupal::state()
    ->get('system.maintenance_mode');
  if (empty($content)) {
    drush_log('Site has been placed online.', 'success');
  }
  else {
    $content = \Drupal::config('acsf.settings')
      ->get('site_owner_maintenance_mode');
    if (empty($content)) {
      drush_log('Site has not been placed online.', 'error');
    }
    else {
      drush_log('Site has been left offline as set by the site owner.', 'success');

      // Unset our maintenance mode setting.
      \Drupal::configFactory()
        ->getEditable('acsf.settings')
        ->set('site_owner_maintenance_mode', FALSE)
        ->save();
    }
  }
}