function drush_sitealias_add_db_url

8.0.x drush_sitealias_add_db_url(&$alias_record)
6.x drush_sitealias_add_db_url(&$alias_record)
7.x drush_sitealias_add_db_url(&$alias_record)
3.x drush_sitealias_add_db_url(&$alias_record)
4.x drush_sitealias_add_db_url(&$alias_record)
5.x drush_sitealias_add_db_url(&$alias_record)
master 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)


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

1 call to drush_sitealias_add_db_url()
_drush_sitealias_print_record in commands/core/
Given a site alias name, print out a php-syntax representation of it.


includes/, line 545
The site alias API.


function drush_sitealias_add_db_url(&$alias_record) {
  if (!isset($alias_record['db-url']) && !isset($alias_record['databases']) && !isset($alias_record['site-list'])) {
    $values = drush_do_site_command($alias_record, "sql-conf", array(), array('db-url' => TRUE));
    if (isset($values['object']['db-url'])) {
      $alias_record['db-url'] = $values['object']['db-url'];