summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-07-10 17:27:50 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-07-10 17:27:50 +0000
commit10edd51e2958a3a0c7b1b0fcc9628f7d2fa0bb7e (patch)
treecbefc37ed420268623691e68faf8c3f8b94ece53 /includes
parent0ed107797700b77f13cfa78f5a45e24aa9866371 (diff)
downloadbrdo-10edd51e2958a3a0c7b1b0fcc9628f7d2fa0bb7e.tar.gz
brdo-10edd51e2958a3a0c7b1b0fcc9628f7d2fa0bb7e.tar.bz2
#850206 by Stevel: Fixed Converting db configuration gives wrong result when () is set.
Diffstat (limited to 'includes')
-rw-r--r--includes/bootstrap.inc2
-rw-r--r--includes/update.inc13
2 files changed, 9 insertions, 6 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index bf553a053..4e6d3211f 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -560,7 +560,7 @@ function drupal_settings_initialize() {
global $base_url, $base_path, $base_root;
// Export the following settings.php variables to the global namespace
- global $databases, $cookie_domain, $conf, $installed_profile, $update_free_access, $db_url, $drupal_hash_salt, $is_https, $base_secure_url, $base_insecure_url;
+ global $databases, $cookie_domain, $conf, $installed_profile, $update_free_access, $db_url, $db_prefix, $drupal_hash_salt, $is_https, $base_secure_url, $base_insecure_url;
$conf = array();
if (file_exists(DRUPAL_ROOT . '/' . conf_path() . '/settings.php')) {
diff --git a/includes/update.inc b/includes/update.inc
index 3cd6b76c3..92844b21e 100644
--- a/includes/update.inc
+++ b/includes/update.inc
@@ -75,9 +75,9 @@ function update_prepare_d7_bootstrap() {
// still being used.
include_once DRUPAL_ROOT . '/includes/install.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
- global $databases, $db_url, $update_rewrite_settings;
+ global $databases, $db_url, $db_prefix, $update_rewrite_settings;
if (empty($databases) && !empty($db_url)) {
- $databases = update_parse_db_url($db_url);
+ $databases = update_parse_db_url($db_url, $db_prefix);
// Record the fact that the settings.php file will need to be rewritten.
$update_rewrite_settings = TRUE;
$settings_file = conf_path() . '/settings.php';
@@ -312,9 +312,9 @@ function update_fix_d7_requirements() {
// Rewrite the settings.php file if necessary, see
// update_prepare_d7_bootstrap().
- global $update_rewrite_settings, $db_url;
+ global $update_rewrite_settings, $db_url, $db_prefix;
if (!empty($update_rewrite_settings)) {
- $databases = update_parse_db_url($db_url);
+ $databases = update_parse_db_url($db_url, $db_prefix);
$salt = drupal_hash_base64(drupal_random_bytes(55));
file_put_contents(conf_path() . '/settings.php', "\n" . '$databases = ' . var_export($databases, TRUE) . ";\n\$drupal_hash_salt = '$salt';", FILE_APPEND);
}
@@ -674,7 +674,7 @@ function update_fix_d7_install_profile() {
* @return
* Drupal 7 DBTNG compatible array of database connection information.
*/
-function update_parse_db_url($db_url) {
+function update_parse_db_url($db_url, $db_prefix) {
$databases = array();
if (!is_array($db_url)) {
$db_url = array('default' => $db_url);
@@ -691,6 +691,9 @@ function update_parse_db_url($db_url) {
'host' => urldecode($url['host']),
'port' => isset($url['port']) ? urldecode($url['port']) : '',
);
+ if (isset($db_prefix)) {
+ $databases[$database]['default']['prefix'] = $db_prefix;
+ }
}
return $databases;
}