function drush_sitealias_add_db_settings

8.0.x drush_sitealias_add_db_settings(&$alias_record)
6.x drush_sitealias_add_db_settings(&$alias_record)
7.x drush_sitealias_add_db_settings(&$alias_record)
3.x drush_sitealias_add_db_settings(&$alias_record)
4.x drush_sitealias_add_db_settings(&$alias_record)
5.x drush_sitealias_add_db_settings(&$alias_record)
master drush_sitealias_add_db_settings(&$alias_record)

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 converted to 'databases' if necessary.


$alias_record: The full alias record to populate with database settings

2 calls to drush_sitealias_add_db_settings()
sitealias_get_databases_from_record in includes/
Return the databases record from the alias record
_drush_sitealias_prepare_record in commands/core/
Given a site alias name, print out a php-syntax representation of it.


includes/, line 880
The site alias API.


function drush_sitealias_add_db_settings(&$alias_record) {
  $altered_record = FALSE;
  if (isset($alias_record['root'])) {
    // If the alias record does not have a defined 'databases' entry,
    // then we'll need to look one up
    if (!isset($alias_record['db-url']) && !isset($alias_record['databases']) && !isset($alias_record['site-list'])) {
      $values = drush_invoke_process($alias_record, "sql-conf", array(), array('all' => TRUE), array('integrate' => FALSE, 'override-simulated' => TRUE));
      if (is_array($values) && ($values['error_status'] == )) {
        $altered_record = TRUE;
        // If there are any special settings in the '@self' record returned by drush_invoke_process,
        // then add those into our altered record as well
        if (array_key_exists('self', $values)) {
          $alias_record = array_merge($values['self'], $alias_record);
        drush_sitealias_cache_db_settings($alias_record, $values['object']);
  return $altered_record;