function _drush_sitealias_add_inherited_values

8.0.x sitealias.inc _drush_sitealias_add_inherited_values(&$aliases)
6.x sitealias.inc _drush_sitealias_add_inherited_values(&$aliases)
7.x sitealias.inc _drush_sitealias_add_inherited_values(&$aliases)
3.x sitealias.inc _drush_sitealias_add_inherited_values(&$aliases)
4.x sitealias.inc _drush_sitealias_add_inherited_values(&$aliases)
5.x sitealias.inc _drush_sitealias_add_inherited_values(&$aliases)
master sitealias.inc _drush_sitealias_add_inherited_values(&$aliases)

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.

Parameters

$aliases: An array of alias records that are modified in-place.

2 calls to _drush_sitealias_add_inherited_values()
drush_sitealias_load_all in includes/sitealias.inc
Load every alias file that can be found anywhere in the alias search path.
_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.

File

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

Code

function _drush_sitealias_add_inherited_values(&$aliases) {
  foreach ($aliases as $alias_name => $alias_value) {
    if (array_key_exists('parent', $alias_value)) {
      // Prevent circular references from causing an infinite loop
      _drush_sitealias_cache_alias($alias_name, array());
      // Fetch and merge in each parent
      foreach (explode(',', $alias_value['parent']) as $parent) {
        $parent_record = drush_sitealias_get_record($parent);
        if ($parent_record != NULL) {
          unset($parent_record['name']);
          $aliases[$alias_name] = array_merge($parent_record, $aliases[$alias_name]);
        }
      }
      unset($aliases[$alias_name]['parent']);
    }
  }
}