function drush_sitealias_check_site_env

8.0.x sitealias.inc drush_sitealias_check_site_env()
6.x sitealias.inc drush_sitealias_check_site_env()
7.x sitealias.inc drush_sitealias_check_site_env()
5.x sitealias.inc drush_sitealias_check_site_env()
master sitealias.inc drush_sitealias_check_site_env()
2 calls to drush_sitealias_check_site_env()
drush_complete_process_argv in includes/complete.inc
This function resets the raw arguments so that Drush can parse the command as if it was run directly. The shell complete command passes the full command line as an argument, and the --early and --complete-debug options have to come before that, and…
_drush_bootstrap_drush in includes/bootstrap.inc
Initial Drush bootstrap phase.

File

includes/sitealias.inc, line 36
The site alias API.

Code

function drush_sitealias_check_site_env() {
  $site = drush_get_context('DRUSH_TARGET_SITE_ALIAS');
  if (empty($site)) {
    $site_env = drush_sitealias_site_get();
    if (!empty($site_env) && (_drush_sitealias_set_context_by_name($site_env))) {
      drush_set_context('DRUSH_TARGET_SITE_ALIAS', $site_env);
      return TRUE;
    }
  }
  // Return false to indicate that no site alias was specified.
  return FALSE;
}