r71212 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71211‎ | r71212 | r71213 >
Date:21:19, 17 August 2010
Author:tparscal
Status:ok
Tags:
Comment:
Added handling for debug mode
Modified paths:
  • /branches/resourceloader/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: branches/resourceloader/phase3/includes/OutputPage.php
@@ -2222,7 +2222,7 @@
22232223 global $wgUser, $wgLang, $wgRequest, $wgScriptPath;
22242224 // TODO: Should this be a static function of ResourceLoader instead?
22252225 $query = array(
2226 - 'modules' => implode( '|', array_unique( $modules ) ),
 2226+ 'modules' => implode( '|', array_unique( (array) $modules ) ),
22272227 'user' => $wgUser->isLoggedIn(),
22282228 'lang' => $wgLang->getCode(),
22292229 'debug' => (
@@ -2246,8 +2246,15 @@
22472247 global $wgUser, $wgRequest, $wgJsMimeType;
22482248 global $wgStylePath, $wgStyleVersion;
22492249
 2250+ $scripts = '';
22502251 // Include base modules and wikibits legacy code
2251 - $scripts = self::makeResourceLoaderLinkedScript( $sk, $this->getResources() );
 2252+ if ( $wgRequest->getVal( 'debug' ) === 'true' || $wgRequest->getBool( 'debug' ) ) {
 2253+ foreach ( $this->getResources() as $resource ) {
 2254+ $scripts .= self::makeResourceLoaderLinkedScript( $sk, $resource );
 2255+ }
 2256+ } else {
 2257+ $scripts .= self::makeResourceLoaderLinkedScript( $sk, $this->getResources() );
 2258+ }
22522259 // Configure page
22532260 $scripts .= Skin::makeGlobalVariablesScript( $sk->getSkinName() ) . "\n";
22542261

Status & tagging log