r110256 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110255‎ | r110256 | r110257 >
Date:19:50, 29 January 2012
Author:vvv
Status:ok
Tags:
Comment:
Define namespace constants after whole configuration was loaded. This allows $wgScriptingNamespaceNumbers to be defined just like any other configuration variable.
Modified paths:
  • /trunk/extensions/Scripting/Scripting.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Scripting/Scripting.php
@@ -82,15 +82,12 @@
8383 $wgScriptingEngineConf = array();
8484
8585 /**
86 - * Script namespace numbers. Should be redefined before
87 - * the inlcusion of the extension.
 86+ * Script namespace numbers.
8887 */
89 -if( !isset( $wgScriptingNamespaceNumbers ) ) {
90 - $wgScriptingNamespaceNumbers = array(
91 - 'Module' => 20,
92 - 'Module_talk' => 21,
93 - );
94 -}
 88+$wgScriptingNamespaceNumbers = array(
 89+ 'Module' => 20,
 90+ 'Module_talk' => 21,
 91+);
9592
9693 /**
9794 * Turn on to true if you have linked or copied wikiscripts.php and
@@ -98,5 +95,10 @@
9996 */
10097 $wgScriptingUseGeSHi = false;
10198
102 -define( 'NS_MODULE', $wgScriptingNamespaceNumbers['Module'] );
103 -define( 'NS_MODULE_TALK', $wgScriptingNamespaceNumbers['Module_talk'] );
 99+function efDefineScriptingNamespace() {
 100+ global $wgScriptingNamespaceNumbers;
 101+ define( 'NS_MODULE', $wgScriptingNamespaceNumbers['Module'] );
 102+ define( 'NS_MODULE_TALK', $wgScriptingNamespaceNumbers['Module_talk'] );
 103+}
 104+
 105+$wgExtensionFunctions[] = 'efDefineScriptingNamespace';

Status & tagging log