r72941 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72940‎ | r72941 | r72942 >
Date:23:41, 13 September 2010
Author:tparscal
Status:ok (Comments)
Tags:
Comment:
Wrapped custom loaders in a function which provides name, version and statically defined dependencies for a module. This solves bug #25085.
Modified paths:
  • /trunk/phase3/includes/ResourceLoader.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ResourceLoader.php
@@ -149,7 +149,9 @@
150150 foreach ( self::$modules as $name => $module ) {
151151 // Support module loader scripts
152152 if ( ( $loader = $module->getLoaderScript() ) !== false ) {
153 - $scripts .= $loader;
 153+ $deps = json_encode( $module->getDependencies() );
 154+ $version = wfTimestamp( TS_ISO_8601, round( $module->getModifiedTime( $context ), -2 ) );
 155+ $scripts .= "( function( name, version, dependencies ) { $loader } )( '$name', '$version', $deps )";
154156 }
155157 // Automatically register module
156158 else {

Follow-up revisions

RevisionCommit summaryAuthorDate
r72942Added missing semi-colon in r72941tparscal23:41, 13 September 2010
r72965Follow-up r72941: don't use json_encode() directlymaxsem11:58, 14 September 2010

Comments

#Comment by Hashar (talk | contribs)   12:02, 26 September 2010

resolved in r72942

Status & tagging log