function _drush_sitealias_load_alias

8.0.x _drush_sitealias_load_alias($alias, $alias_path_context = NULL)
6.x _drush_sitealias_load_alias($alias, $alias_path_context = NULL)
7.x _drush_sitealias_load_alias($alias, $alias_path_context = NULL)
3.x _drush_sitealias_load_alias($alias, $alias_path_context = NULL)
4.x _drush_sitealias_load_alias($alias, $alias_path_context = NULL)
5.x _drush_sitealias_load_alias($alias, $alias_path_context = NULL)
master _drush_sitealias_load_alias($alias, $alias_path_context = NULL)

Check and see if an alias definition for $alias is available. If it is, load it into the list of aliases cached in the 'site-aliases' context.


$alias: The name of the alias to load in ordinary form ('@name')

$alias_path_context: When looking up a relative alias, the alias path context is the primary alias that we will start our search from.

1 call to _drush_sitealias_load_alias()
_drush_sitealias_get_record in includes/
This is a continuation of drush_sitealias_get_record, above. It is not intended to be called directly.


includes/, line 489
The site alias API.


function _drush_sitealias_load_alias($alias, $alias_path_context = NULL) {
  $all_site_aliases = drush_get_context('site-aliases');
  $result = array();

  // Only aliases--those named entities that begin with '@'--can be loaded this way.
  // We also skip any alias that has already been loaded.
  if ((substr($alias, 0, 1) == '@') && !array_key_exists($alias, $all_site_aliases)) {
    $aliasname = substr($alias, 1);
    $result = _drush_sitealias_find_and_load_alias($aliasname, $alias_path_context);
    if (!empty($result)) {
      $alias_options = array('site-aliases' => array($aliasname => $result));
      if (array_key_exists('#file', $result)) {
        drush_log(dt('Loaded alias !alias from file !file', array('!alias' => $alias, '!file' => $result['#file'])));

  return $result;