function _drush_bootstrap_drupal_root

6.x _drush_bootstrap_drupal_root()
3.x _drush_bootstrap_drupal_root()
4.x _drush_bootstrap_drupal_root()
5.x _drush_bootstrap_drupal_root()

Bootstrap Drush with a valid Drupal Directory.

In this function, the pwd will be moved to the root of the Drupal installation.

The DRUSH_DRUPAL_ROOT context, DRUSH_DRUPAL_CORE context, DRUPAL_ROOT, and the DRUSH_DRUPAL_CORE constants are populated from the value that we determined during the validation phase.

We also now load the drushrc.php for this specific platform. We can now include files from the Drupal Tree, and figure out more context about the platform, such as the version of Drupal.

1 string reference to '_drush_bootstrap_drupal_root'
_drush_bootstrap_phases in includes/
Helper function listing phases.


includes/, line 697
Drush bootstrapping code.


function _drush_bootstrap_drupal_root() {
  $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');
  $version = drush_drupal_version();
  $major_version = drush_drupal_major_version();

  define('DRUPAL_ROOT', $drupal_root);

  // DRUSH_DRUPAL_CORE should point to the /core folder in Drupal 8+ or to DRUPAL_ROOT
  // in prior versions.
  $core = $major_version >= 8 ? DRUPAL_ROOT . '/core' : DRUPAL_ROOT;
  drush_set_context('DRUSH_DRUPAL_CORE', $core);
  define('DRUSH_DRUPAL_CORE', $core);


  drush_log(dt("Initialized Drupal !version root directory at !drupal_root", array("!version" => $version, '!drupal_root' => $drupal_root)));