Define namespace constants after whole configuration was loaded. This allows $wgScriptingNamespaceNumbers to be defined just like any other configuration variable.

This commit is contained in:
vvv 2012-01-29 19:50:34 +00:00
parent fa2dd80ead
commit 78fc58f457

View file

@ -82,15 +82,12 @@ $wgScriptingEngine = false;
$wgScriptingEngineConf = array(); $wgScriptingEngineConf = array();
/** /**
* Script namespace numbers. Should be redefined before * Script namespace numbers.
* the inlcusion of the extension.
*/ */
if( !isset( $wgScriptingNamespaceNumbers ) ) { $wgScriptingNamespaceNumbers = array(
$wgScriptingNamespaceNumbers = array( 'Module' => 20,
'Module' => 20, 'Module_talk' => 21,
'Module_talk' => 21, );
);
}
/** /**
* Turn on to true if you have linked or copied wikiscripts.php and * Turn on to true if you have linked or copied wikiscripts.php and
@ -98,5 +95,10 @@ if( !isset( $wgScriptingNamespaceNumbers ) ) {
*/ */
$wgScriptingUseGeSHi = false; $wgScriptingUseGeSHi = false;
define( 'NS_MODULE', $wgScriptingNamespaceNumbers['Module'] ); function efDefineScriptingNamespace() {
define( 'NS_MODULE_TALK', $wgScriptingNamespaceNumbers['Module_talk'] ); global $wgScriptingNamespaceNumbers;
define( 'NS_MODULE', $wgScriptingNamespaceNumbers['Module'] );
define( 'NS_MODULE_TALK', $wgScriptingNamespaceNumbers['Module_talk'] );
}
$wgExtensionFunctions[] = 'efDefineScriptingNamespace';