function drush_preflight_site

8.0.x drush_preflight_site()
7.x drush_preflight_site()
master drush_preflight_site()
1 call to drush_preflight_site()
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…


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


function drush_preflight_site() {
  // Load the Drupal site configuration options upfront.

  // Determine URI and set constants/contexts accordingly. Keep this after loading of drupal,site configs.

  // If someone set 'uri' in the 'site' context, then copy it
  // to the 'process' context (to give it a higher priority
  // than the 'cli' and 'alias' contexts) and reset our selected
  // site and @self alias.
  $uri = drush_get_option('uri');
  if ($uri != drush_get_option('uri', $uri, 'site')) {
    drush_set_option('uri', drush_get_option('uri', $uri, 'site'));

  // Create a @self site alias record.