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