function drush_sitealias_add_db_url

8.0.x sitealias.inc drush_sitealias_add_db_url(&$alias_record)
6.x sitealias.inc drush_sitealias_add_db_url(&$alias_record)
7.x sitealias.inc drush_sitealias_add_db_url(&$alias_record)
3.x sitealias.inc drush_sitealias_add_db_url(&$alias_record)
4.x sitealias.inc drush_sitealias_add_db_url(&$alias_record)
5.x sitealias.inc drush_sitealias_add_db_url(&$alias_record)
master sitealias.inc drush_sitealias_add_db_url(&$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 'db_url' form is preferred; nothing is done if 'db_url' is not available (e.g. on a D7 site)

Parameters

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

2 calls to drush_sitealias_add_db_url()
drush_sitealias_alias_record_to_spec in includes/sitealias.inc
Convert from an alias record to a site specification
_drush_sitealias_prepare_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 800
The site alias API.

Code

function drush_sitealias_add_db_url(&$alias_record) {
  if (!isset($alias_record['db-url']) && !isset($alias_record['databases']) && !isset($alias_record['site-list'])) {
    // We use sql-conf to fetch our database info.  We set 'override-simulated' so that
    // we will fetch the database values even in --simulate mode.
    $values = drush_invoke_process($alias_record, "sql-conf", array(), array('db-url' => TRUE), array('integrate' => FALSE, 'override-simulated' => TRUE));
    if (isset($values['object']['db-url'])) {
      $alias_record['db-url'] = $values['object']['db-url'];
    }
  }
}