public function Sql8::get_db_spec

8.0.x Sql8.php public Sql8::get_db_spec()
7.x Sql8.php public Sql8::get_db_spec()
master Sql8.php public Sql8::get_db_spec()

Overrides Sql7::get_db_spec

File

lib/Drush/Sql/Sql8.php, line 7

Namespace

Drush\Sql

Class

Sql8

Code

public function get_db_spec() {
  $db_spec = NULL;
  if (drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION)) {
    $database = drush_get_option('database', 'default');
    $target = drush_get_option('target', 'default');
    if ($info = Database::getConnectionInfo($database)) {
      return $info[$target];
    }
  }
  return $db_spec;
}