From: Daniel Friesen Date: Sun, 5 Dec 2010 06:43:15 +0000 (+0000) Subject: Add MW_CONFIG_FILE support to load a separate config file instead of LocalSettings... X-Git-Tag: 1.31.0-rc.0~33557 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=ad787f1574b7598868e12d1a4a9bba3ca23d4a8f;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 643bcd5caf..f4f6a55b41 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 diff --git a/includes/WebStart.php b/includes/WebStart.php index 4060c55c59..428b4ffeb7 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 ) { diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index ab5c4779fc..daa9919d4d 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -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"; }