function _drush_sitealias_set_context_by_name

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

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

Parameters

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.

1 call to _drush_sitealias_set_context_by_name()
drush_sitealias_check_arg in includes/sitealias.inc
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.

File

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

Code

function _drush_sitealias_set_context_by_name($alias, $prefix = '') {
  $site_alias_settings = drush_sitealias_get_record($alias);
  if (!empty($site_alias_settings)) {
    // Create an alias '@self'
    _drush_sitealias_cache_alias('self', $site_alias_settings);
    drush_sitealias_set_alias_context($site_alias_settings, $prefix);
    return TRUE;
  }
  return FALSE;
}