public function Sql6::valid_credentials

8.0.x Sql6.php public Sql6::valid_credentials($db_spec)
7.x Sql6.php public Sql6::valid_credentials($db_spec)

Overrides SqlVersion::valid_credentials

File

lib/Drush/Sql/Sql6.php, line 27

Namespace

Drush\Sql

Class

Sql6

Code

public function valid_credentials($db_spec) {
  $type = $db_spec['driver'];
  // Check for Drupal support of configured db type.
  if (file_exists('./includes/install.' . $type . '.inc')) {
    require_once './includes/install.' . $type . '.inc';
    $function = $type . '_is_available';
    if (!$function()) {
      drush_log(dt('!type extension for PHP is not installed. Check your php.ini to see how you can enable it.', array('!type' => $type)), LogLevel::BOOTSTRAP);
      return FALSE;
    }
  }
  else {
    drush_log(dt('!type database type is unsupported.', array('!type' => $type)), LogLevel::BOOTSTRAP);
    return FALSE;
  }
  return TRUE;
}