function drush_preflight_root

8.0.x drush_preflight_root()
7.x drush_preflight_root()
master drush_preflight_root()

If --root is provided, set context.

2 calls to drush_preflight_root()
drush_preflight in includes/
During the initialization of Drush, this is the first step where we load our configuration and commandfiles, and select the site we are going to operate on; however, we take no irreversible actions (e.g. site bootstrapping). This allows commands that…
_drush_preflight_root_uri in includes/


includes/, line 310
Preflight, postflight and shutdown code.


function drush_preflight_root() {
  $root = drush_get_option('root');
  if (!isset($root)) {
    $root = drush_locate_root();
  if ($root) {
    $root = realpath($root);
  // @todo This context name should not mention Drupal.
  // @todo Drupal code should use DRUSH_DRUPAL_ROOT instead of this constant.
  drush_set_context('DRUSH_SELECTED_DRUPAL_ROOT', $root);

  // Load the config options from Drupal's /drush, ../drush, and sites/all/drush directories,
  // even prior to bootstrapping the root.