summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-07-30 19:22:47 +0000
committerDries Buytaert <dries@buytaert.net>2007-07-30 19:22:47 +0000
commit2c3864d3c78c9f9f8fdf35a6234f928324bc9623 (patch)
tree9f74a51d3d2361585856ecce8ba3981df24b083b /includes
parentc33da7d51c5670eb8cfdb19f49af9443813e8521 (diff)
downloadbrdo-2c3864d3c78c9f9f8fdf35a6234f928324bc9623.tar.gz
brdo-2c3864d3c78c9f9f8fdf35a6234f928324bc9623.tar.bz2
- Patch #147324 by Eaton: make multi-site installations work again.
Diffstat (limited to 'includes')
-rw-r--r--includes/bootstrap.inc17
-rw-r--r--includes/install.inc2
2 files changed, 15 insertions, 4 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 51ce58480..93a35f041 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -217,11 +217,22 @@ function timer_stop($name) {
* 12. $confdir/org
*
* 13. $confdir/default
+ *
+ * @param $require_settings
+ * Only configuration directories with an existing settings.php file
+ * will be recognized. Defaults to TRUE. During initial installation,
+ * this is set to FALSE so that Drupal can detect a matching directory,
+ * then create a new settings.php file in it.
+ * @param reset
+ * Force a full search for matching directories even if one had been
+ * found previously.
+ * @return
+ * The path of the matching directory.
*/
-function conf_path() {
+function conf_path($require_settings = TRUE, $reset = FALSE) {
static $conf = '';
- if ($conf) {
+ if ($conf && !$reset) {
return $conf;
}
@@ -231,7 +242,7 @@ function conf_path() {
for ($i = count($uri) - 1; $i > 0; $i--) {
for ($j = count($server); $j > 0; $j--) {
$dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i));
- if (file_exists("$confdir/$dir/settings.php")) {
+ if (file_exists("$confdir/$dir/settings.php") || (!$require_settings && file_exists("$confdir/$dir"))) {
$conf = "$confdir/$dir";
return $conf;
}
diff --git a/includes/install.inc b/includes/install.inc
index 483483813..43c89b96c 100644
--- a/includes/install.inc
+++ b/includes/install.inc
@@ -166,7 +166,7 @@ function drupal_detect_database_types() {
*/
function drupal_rewrite_settings($settings = array(), $prefix = '') {
$default_settings = './sites/default/default.settings.php';
- $settings_file = './'. conf_path() .'/'. $prefix .'settings.php';
+ $settings_file = './'. conf_path(FALSE, TRUE) .'/'. $prefix .'settings.php';
// Build list of setting names and insert the values into the global namespace.
$keys = array();