Add MW_CONFIG_FILE support to load a separate config file instead of LocalSettings...
authorDaniel Friesen <dantman@users.mediawiki.org>
Sun, 5 Dec 2010 06:43:15 +0000 (06:43 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Sun, 5 Dec 2010 06:43:15 +0000 (06:43 +0000)
RELEASE-NOTES
includes/WebStart.php
maintenance/Maintenance.php

index 643bcd5..f4f6a55 100644 (file)
@@ -87,6 +87,9 @@ LocalSettings.php. The specific bugs are listed below in the general notes.
 * (bug 25728) Added $wgPasswordSenderName to allow customise the name associed
   with $wgPasswordSender
 * Sysops now have the "suppressredirect" right by default
+* Special wrapping setups can now define MW_CONFIG_FILE to load a config file
+  other than LocalSettings.php. This is like MW_CONFIG_CALLBACK but works in
+  some cases where MW_CONFIG_CALLBACK will not work.
 
 === New features in 1.17 ===
 * (bug 10183) Users can now add personal styles and scripts to all skins via
index 4060c55..428b4ff 100644 (file)
@@ -103,17 +103,20 @@ if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
        }
        call_user_func( $callback );
 } else {
-       # LocalSettings.php is the per site customization file. If it does not exit
-       # the wiki installer need to be launched or the generated file moved from
+       if ( !defined('MW_CONFIG_FILE') )
+               define('MW_CONFIG_FILE', "$IP/LocalSettings.php");
+       
+       # LocalSettings.php is the per site customization file. If it does not exist
+       # the wiki installer needs to be launched or the generated file moved from
        # ./config/ to ./
-       if( !file_exists( "$IP/LocalSettings.php" ) ) {
+       if( !file_exists( MW_CONFIG_FILE ) ) {
                require_once( "$IP/includes/DefaultSettings.php" ); # used for printing the version
                require_once( "$IP/includes/templates/NoLocalSettings.php" );
                die();
        }
 
        # Include site settings. $IP may be changed (hopefully before the AutoLoader is invoked)
-       require_once( "$IP/LocalSettings.php" );
+       require_once( MW_CONFIG_FILE );
 }
 
 if ( $wgEnableSelenium ) {
index ab5c477..daa9919 100644 (file)
@@ -839,6 +839,8 @@ abstract class Maintenance {
                $wgWikiFarm = false;
                if ( isset( $this->mOptions['conf'] ) ) {
                        $settingsFile = $this->mOptions['conf'];
+               } else if ( defined("MW_CONFIG_FILE") ) {
+                       $settingsFile = MW_CONFIG_FILE;
                } else {
                        $settingsFile = "$IP/LocalSettings.php";
                }