function _drush_sitealias_set_context_by_name

8.0.x _drush_sitealias_set_context_by_name($alias, $prefix = '')
6.x _drush_sitealias_set_context_by_name($alias, $prefix = '')
7.x _drush_sitealias_set_context_by_name($alias, $prefix = '')
3.x _drush_sitealias_set_context_by_name($alias, $prefix = '')
4.x _drush_sitealias_set_context_by_name($alias, $prefix = '')
5.x _drush_sitealias_set_context_by_name($alias, $prefix = '')
master _drush_sitealias_set_context_by_name($alias, $prefix = '')

Looks up the specified alias record and calls through to drush_sitealias_set_alias_context, below.


alias: The name of the alias record

prefix: The prefix value to afix to the beginning of every key set.

Return value

boolean TRUE is an alias was found and processed.

3 calls to _drush_sitealias_set_context_by_name()
drush_sitealias_check_arg in includes/
Check to see if the first command-line arg or the -l option is a site alias; if it is, copy its record values to the 'alias' context.
drush_sitealias_check_site_env in includes/
drush_sitealias_site_set in commands/core/
Set the DRUPAL_SITE variable by writing it out to a temporary file that we then source for persistent site switching.


includes/, line 1627
The site alias API.


function _drush_sitealias_set_context_by_name($alias, $prefix = '') {
  $site_alias_settings = drush_sitealias_get_record($alias);
  if (!empty($site_alias_settings)) {
    drush_sitealias_set_alias_context($site_alias_settings, $prefix);
    if (empty($prefix)) {
      // Create an alias '@self'
      _drush_sitealias_cache_alias('@self', $site_alias_settings);
      // change the selected site to match the new --root and --uri, if any were set
    return TRUE;
  return FALSE;