Commit 33b09cc5 authored by webchick's avatar webchick

#589754 by rfay and Crell: Fixed non-recoverable install if invalid database...

#589754 by rfay and Crell: Fixed non-recoverable install if invalid database specified in settings.php.
parent b959d8fb
......@@ -1246,7 +1246,7 @@ abstract class Database {
/**
* Process the configuration file for database information.
*/
final protected static function parseConnectionInfo() {
final public static function parseConnectionInfo() {
global $databases;
_db_check_install_needed();
......@@ -1263,7 +1263,20 @@ abstract class Database {
}
}
self::$databaseInfo = $databaseInfo;
if (!is_array(self::$databaseInfo)) {
self::$databaseInfo = $databaseInfo;
}
// Merge the new $databaseInfo into the existing.
// array_merge_recursive() cannot be used, as it would make multiple
// database, user, and password keys in the same database array.
else {
foreach ($databaseInfo as $database_key => $database_values) {
foreach ($database_values as $target => $target_values) {
self::$databaseInfo[$database_key][$target] = $target_values;
}
}
}
}
/**
......@@ -2414,4 +2427,4 @@ function _db_check_install_needed() {
include_once DRUPAL_ROOT . '/includes/install.inc';
install_goto('install.php');
}
}
\ No newline at end of file
}
......@@ -954,6 +954,10 @@ function install_database_errors($database, $settings_file) {
// Run tasks associated with the database type. Any errors are caught in the
// calling function
$databases['default']['default'] = $database;
// Just changing the global doesn't get the new information processed.
// We tell tell the Database class to re-parse $databases.
Database::parseConnectionInfo();
try {
db_run_tasks($database['driver']);
}
......
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