function drush_sitealias_cache_db_settings

8.0.x sitealias.inc drush_sitealias_cache_db_settings(&$alias_record, $databases)
6.x sitealias.inc drush_sitealias_cache_db_settings(&$alias_record, $databases)
7.x sitealias.inc drush_sitealias_cache_db_settings(&$alias_record, $databases)
4.x sitealias.inc drush_sitealias_cache_db_settings(&$alias_record, $databases)
5.x sitealias.inc drush_sitealias_cache_db_settings(&$alias_record, $databases)
master sitealias.inc drush_sitealias_cache_db_settings(&$alias_record, $databases)
1 call to drush_sitealias_cache_db_settings()
drush_sitealias_add_db_settings in includes/sitealias.inc
If the alias record does not contain a 'databases' or 'db-url' entry, then use backend invoke to look up the settings value from the remote or local site. The 'databases' form is preferred; 'db_url' will be…

File

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

Code

function drush_sitealias_cache_db_settings(&$alias_record, $databases) {
  if (!empty($databases)) {
    $alias_record['databases'] = $databases;
  }

  // If the name is set, then re-cache the record after we fetch the databases
  if (array_key_exists('#name', $alias_record)) {
    $all_site_aliases = &drush_get_context('site-aliases');
    $all_site_aliases['@' . $alias_record['#name']] = $alias_record;
    // Check and see if this record is a copy of 'self'
    if (($alias_record['#name'] != 'self') && array_key_exists('@self', $all_site_aliases) && array_key_exists('#name', $all_site_aliases['@self']) && ($all_site_aliases['@self']['#name'] == $alias_record['#name'])) {
      $all_site_aliases['@self'] = $alias_record;
    }
  }
}