function DrupalBoot::bootstrap_drupal_site_validate

8.0.x DrupalBoot.php DrupalBoot::bootstrap_drupal_site_validate()
7.x DrupalBoot.php DrupalBoot::bootstrap_drupal_site_validate()
master DrupalBoot.php DrupalBoot::bootstrap_drupal_site_validate()

VALIDATE the DRUSH_BOOTSTRAP_DRUPAL_SITE phase.

In this function we determine the URL used for the command, and check for a valid settings.php file.

To do this, we need to set up the $_SERVER environment variable, to allow us to use conf_path to determine what Drupal will load as a configuration file.

File

lib/Drush/Boot/DrupalBoot.php, line 339

Namespace

Drush\Boot

Class

DrupalBoot

Code

function bootstrap_drupal_site_validate() {
  // Define the selected conf path as soon as we have identified that
  // we have selected a Drupal site.  Drush used to set this context
  // during the drush_bootstrap_drush phase.
  $drush_uri = _drush_bootstrap_selected_uri();
  drush_set_context('DRUSH_SELECTED_DRUPAL_SITE_CONF_PATH', drush_conf_path($drush_uri));

  $this->bootstrap_drupal_site_setup_server_global($drush_uri);
  return $this->bootstrap_drupal_site_validate_settings_present();
}