You are here

function drush_acsf_go_online in Acquia Cloud Site Factory Connector 8

Command callback. Takes a site out of maintenance.

File

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

Code

function drush_acsf_go_online() {
  $lock = \Drupal::lock();

  // Determine whether the user intended the site to be in maintenance mode.
  $content = \Drupal::config('acsf.settings')
    ->get('site_owner_maintenance_mode');

  // Clearing maintenance mode.
  \Drupal::state()
    ->set('system.maintenance_mode', FALSE);
  \Drupal::configFactory()
    ->getEditable('acsf.settings')
    ->set('maintenance_time', 0)
    ->save();
  if (!empty($content)) {
    \Drupal::state()
      ->set('system.maintenance_mode', TRUE);
  }

  // Release cron lock.
  $lock
    ->release('cron');
}