Index: trunk/phase3/includes/ResourceLoaderContext.php |
— | — | @@ -26,7 +26,6 @@ |
27 | 27 | /* Protected Members */ |
28 | 28 | |
29 | 29 | protected $request; |
30 | | - protected $server; |
31 | 30 | protected $modules; |
32 | 31 | protected $language; |
33 | 32 | protected $direction; |
— | — | @@ -64,7 +63,7 @@ |
65 | 64 | $this->skin = $wgDefaultSkin; |
66 | 65 | } |
67 | 66 | } |
68 | | - |
| 67 | + |
69 | 68 | public function getRequest() { |
70 | 69 | return $this->request; |
71 | 70 | } |
— | — | @@ -114,4 +113,4 @@ |
115 | 114 | $this->hash : $this->hash = |
116 | 115 | implode( '|', array( $this->language, $this->skin, $this->user, $this->debug, $this->only ) ); |
117 | 116 | } |
118 | | -} |
| 117 | +} |
\ No newline at end of file |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -2286,13 +2286,13 @@ |
2287 | 2287 | // TODO: Divide off modules starting with "user", and add the user parameter to them |
2288 | 2288 | $query = array( |
2289 | 2289 | 'lang' => $wgLang->getCode(), |
2290 | | - 'debug' => $wgRequest->getBool( 'debug' ) && $wgRequest->getVal( 'debug' ) !== 'false', |
| 2290 | + 'debug' => ( $wgRequest->getBool( 'debug' ) && $wgRequest->getVal( 'debug' ) == 'true' ) ? 'true' : 'false', |
2291 | 2291 | 'skin' => $wgUser->getSkin()->getSkinName(), |
2292 | 2292 | 'only' => $only, |
2293 | 2293 | ); |
2294 | 2294 | $moduleGroups = array( null => array(), 'user' => array() ); |
2295 | | - foreach ( (array) $modules as $module ) { |
2296 | | - $moduleGroups[strpos( $module, 'user' ) === 0 ? 'user' : null][] = $module; |
| 2295 | + foreach ( (array) $modules as $name ) { |
| 2296 | + $moduleGroups[strpos( $name, 'user' ) === 0 ? 'user' : null][] = $name; |
2297 | 2297 | } |
2298 | 2298 | $links = ''; |
2299 | 2299 | foreach ( $moduleGroups as $group => $modules ) { |
— | — | @@ -2301,6 +2301,16 @@ |
2302 | 2302 | if ( $group === 'user' ) { |
2303 | 2303 | $query['user'] = $wgUser->getName(); |
2304 | 2304 | } |
| 2305 | + $context = new ResourceLoaderContext( new FauxRequest( $query ) ); |
| 2306 | + $timestamp = 0; |
| 2307 | + foreach ( $modules as $name ) { |
| 2308 | + if ( $module = ResourceLoader::getModule( $name ) ) { |
| 2309 | + $timestamp = max( $timestamp, $module->getModifiedTime( $context ) ); |
| 2310 | + } |
| 2311 | + } |
| 2312 | + $query['version'] = wfTimestamp( TS_ISO_8601, round( $timestamp, -2 ) ); |
| 2313 | + // Make queries uniform in order |
| 2314 | + ksort( $query ); |
2305 | 2315 | // Automatically select style/script elements |
2306 | 2316 | if ( $only === 'styles' ) { |
2307 | 2317 | $links .= Html::linkedStyle( wfAppendQuery( $wgLoadScript, $query ) ); |
Index: trunk/phase3/includes/ResourceLoader.php |
— | — | @@ -338,7 +338,7 @@ |
339 | 339 | } |
340 | 340 | |
341 | 341 | $statuses = FormatJson::encode( $statuses ); |
342 | | - echo "mediaWiki.loader.state( $statuses );"; |
| 342 | + echo "mediaWiki.loader.state( $statuses );\n"; |
343 | 343 | } |
344 | 344 | |
345 | 345 | // Register missing modules |