function _drush_sitealias_cache_alias

8.0.x sitealias.inc _drush_sitealias_cache_alias($alias_name, $alias_record)
6.x sitealias.inc _drush_sitealias_cache_alias($alias_name, $alias_record)
7.x sitealias.inc _drush_sitealias_cache_alias($alias_name, $alias_record)
3.x sitealias.inc _drush_sitealias_cache_alias($alias_name, $alias_record)
4.x sitealias.inc _drush_sitealias_cache_alias($alias_name, $alias_record)
5.x sitealias.inc _drush_sitealias_cache_alias($alias_name, $alias_record)
master sitealias.inc _drush_sitealias_cache_alias($alias_name, $alias_record)

Add an empty record for the specified alias name

Parameters

$alias_name: The name of the alias, without the leading "@"

6 calls to _drush_sitealias_cache_alias()
drush_sitealias_create_sites_alias in includes/sitealias.inc
_drush_bootstrap_do_drupal_site in includes/environment.inc
Called by _drush_bootstrap_drupal_site to do the main work of the drush drupal site bootstrap.
_drush_bootstrap_drush in includes/environment.inc
Initial Drush bootstrap phase.
_drush_sitealias_add_inherited_values in includes/sitealias.inc
Check to see if there is a 'parent' item in the alias; if there is, then load the parent alias record and overlay the entries in the current alias record on top of the items from the parent record.
_drush_sitealias_load_alias in includes/sitealias.inc
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.

... See full list

File

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

Code

function _drush_sitealias_cache_alias($alias_name, $alias_record) {
  $cache = &drush_get_context('site-aliases');
  // If the alias already exists in the cache, then merge
  // the new alias with the existing alias
  if (array_key_exists("@$alias_name", $cache)) {
    $alias_record = array_merge($cache["@$alias_name"], $alias_record);
  }
  $cache["@$alias_name"] = $alias_record;

  // If the alias record points at a local site, make sure
  // that both the drupal root and the site folder for that site
  // are added to the alias path, so that other alias files
  // stored in those locations become searchable.
  if (!array_key_exists('remote-host', $alias_record) && array_key_exists('root', $alias_record)) {
    drush_sitealias_add_to_alias_path($alias_record['root']);
    $site_dir = drush_sitealias_local_site_path($alias_record);
    if (isset($site_dir)) {
      drush_sitealias_add_to_alias_path($site_dir);
    }
  }
}