From ad787f1574b7598868e12d1a4a9bba3ca23d4a8f Mon Sep 17 00:00:00 2001 From: Daniel Friesen Date: Sun, 5 Dec 2010 06:43:15 +0000 Subject: Add MW_CONFIG_FILE support to load a separate config file instead of LocalSettings.php, similar functionality to MW_CONFIG_CALLBACK but works in some cases that it doesn't. --- includes/WebStart.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'includes/WebStart.php') diff --git a/includes/WebStart.php b/includes/WebStart.php index 4060c55c592e..428b4ffeb7c3 100644 --- a/includes/WebStart.php +++ b/includes/WebStart.php @@ -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 ) { -- cgit v1.2.3