summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-12 02:00:04 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-12 02:00:04 +0000
commit33b09cc5eb6f602e8007ce4cf799b30aacc4021e (patch)
treef0898ff7830c0a1a145e786a95051621a08c59f2 /includes
parentb959d8fbeb81d033d74abe620d4131a7e533179b (diff)
downloadbrdo-33b09cc5eb6f602e8007ce4cf799b30aacc4021e.tar.gz
brdo-33b09cc5eb6f602e8007ce4cf799b30aacc4021e.tar.bz2
#589754 by rfay and Crell: Fixed non-recoverable install if invalid database specified in settings.php.
Diffstat (limited to 'includes')
-rw-r--r--includes/database/database.inc19
1 files changed, 16 insertions, 3 deletions
diff --git a/includes/database/database.inc b/includes/database/database.inc
index e04f32a16..82ac78bc7 100644
--- a/includes/database/database.inc
+++ b/includes/database/database.inc
@@ -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
+}