function _drush_sitealias_add_static_defaults

8.0.x sitealias.inc _drush_sitealias_add_static_defaults(&$alias_record)
6.x sitealias.inc _drush_sitealias_add_static_defaults(&$alias_record)
7.x sitealias.inc _drush_sitealias_add_static_defaults(&$alias_record)
3.x sitealias.inc _drush_sitealias_add_static_defaults(&$alias_record)
4.x sitealias.inc _drush_sitealias_add_static_defaults(&$alias_record)
5.x sitealias.inc _drush_sitealias_add_static_defaults(&$alias_record)
master sitealias.inc _drush_sitealias_add_static_defaults(&$alias_record)

Add "static" default values to the given alias record. The difference between a static default and a transient default is that static defaults -always- exist in the alias record, and they are cached, whereas transient defaults are only added if the given drush command explicitly adds them.

Parameters

alias_record: An alias record with most values already filled in

2 calls to _drush_sitealias_add_static_defaults()
_drush_sitealias_get_record in includes/sitealias.inc
This is a continuation of drush_sitealias_get_record, above. It is not intended to be called directly.
_drush_sitealias_print_record in commands/core/sitealias.drush.inc
Given a site alias name, print out a php-syntax representation of it.

File

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

Code

function _drush_sitealias_add_static_defaults(&$alias_record) {
  // If there is a 'db-url' entry but not 'databases' entry, then we will
  // build 'databases' from 'db-url' so that drush commands that use aliases
  // can always count on using a uniform 'databases' array.
  if (isset($alias_record['db-url']) && !isset($alias_record['databases'])) {
    $alias_record['databases'] = drush_sitealias_convert_db_from_db_url($alias_record['db-url']);
  }
  // Adjustments for aliases to drupal instances (as opposed to aliases that are site lists)
  if (array_key_exists('uri', $alias_record)) {
    // Make sure that there is always a 'path-aliases' array
    if (!array_key_exists('path-aliases', $alias_record)) {
      $alias_record['path-aliases'] = array();
    }
    // If there is a 'root' entry, then copy it to the '%root' path alias
    $alias_record['path-aliases']['%root'] = $alias_record['root'];
  }
}