r77053 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77052‎ | r77053 | r77054 >
Date:07:05, 20 November 2010
Author:tstarling
Status:ok (Comments)
Tags:
Comment:
Per CR r77020, followup to r77046: add a constant so that extensions can more easily support versions of MediaWiki without $wgResourceModules. But note that the ClickTracking style of registration would have worked as well, since an array index write works even if the variable is unset.
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/Defines.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Defines.php
@@ -210,6 +210,9 @@
211211 define( 'MW_SUPPORTS_LOCALISATIONCACHE', 1 );
212212 /**@}*/
213213
 214+/** Support for $wgResourceModules */
 215+define( 'MW_SUPPORTS_RESOURCE_MODULES', 1 );
 216+
214217 /**@{
215218 * Allowed values for Parser::$mOutputType
216219 * Parameter to Parser::startExternalParse().
Index: trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php
@@ -117,7 +117,7 @@
118118 $wgExtensionAliasesFiles['SemanticForms'] = $sfgIP . '/languages/SF_Aliases.php';
119119
120120 // register client-side modules
121 -if ( isset( $wgResourceModules ) ) {
 121+if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) {
122122 $sfgResourceTemplate = array(
123123 'localBasePath' => $sfgIP,
124124 'remoteExtPath' => 'SemanticForms'

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r77020Updated extensions for r77011:...tstarling13:59, 19 November 2010
r77046Added 'if' statement around code added by tstarling in r77020 , for backwards...yaron00:11, 20 November 2010

Comments

#Comment by MaxSem (talk | contribs)   07:48, 20 November 2010

Suggest renaming MW_SUPPORTS_RESOURCE_MODULES to MW_SUPPORTS_RESOURCE_LOADER.

#Comment by Tim Starling (talk | contribs)   07:49, 20 November 2010

The resource loader predates $wgResourceModules.

Status & tagging log