You are here

public function AcsfExtraCommands::online in Acquia Cloud Site Factory Connector 8.2

Set a site online.

@command go-online @aliases go-on @bootstrap full

File

src/Commands/AcsfExtraCommands.php, line 112

Class

AcsfExtraCommands
Provides drush commands for site related operations.

Namespace

Drush\Commands

Code

public function 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');
}