Commit ed3c2fa0 authored by ergonlogic's avatar ergonlogic

Fix Drush 7 SQL loading.

parent 1ad7b9dc
......@@ -82,18 +82,18 @@ function install_main() {
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION);
// We have an existing settings.php.
// Drush 5.
if (function_exists('_drush_sql_get_db_spec')) {
$db_spec = _drush_sql_get_db_spec();
}
// Drush 4.
elseif (function_exists('drush_sql_read_db_spec')) {
$db_spec = drush_sql_read_db_spec();
}
// Drush 3.
else {
$db_spec = drush_core_site_install_db_spec();
switch (substr(drush_core_version(), 0, 1)) {
case '7':
$sql = drush_get_class('Drush\Sql\Sql', array(), array(drush_drupal_major_version()));
$db_spec = $sql->get_db_spec();
break;
case '6':
case '5':
$db_spec = _drush_sql_get_db_spec();
break;
default:
drush_set_error('DRUSH_UNSUPPORTED_VERSION', dt('Drush !version is not supported'));
}
$db_spec['db_prefix'] = $GLOBALS['db_prefix'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment