Index: trunk/phase3/includes/resourceloader/ResourceLoader.php |
— | — | @@ -263,10 +263,10 @@ |
264 | 264 | |
265 | 265 | /** |
266 | 266 | * Add a foreign source of modules. |
267 | | - * |
| 267 | + * |
268 | 268 | * Source properties: |
269 | 269 | * 'loadScript': URL (either fully-qualified or protocol-relative) of load.php for this source |
270 | | - * |
| 270 | + * |
271 | 271 | * @param $id Mixed: source ID (string), or array( id1 => props1, id2 => props2, ... ) |
272 | 272 | * @param $properties Array: source properties |
273 | 273 | */ |
— | — | @@ -340,7 +340,7 @@ |
341 | 341 | |
342 | 342 | /** |
343 | 343 | * Get the list of sources |
344 | | - * |
| 344 | + * |
345 | 345 | * @return Array: array( id => array of properties, .. ) |
346 | 346 | */ |
347 | 347 | public function getSources() { |
— | — | @@ -401,6 +401,9 @@ |
402 | 402 | // the last modified time |
403 | 403 | $mtime = wfTimestamp( TS_UNIX, $wgCacheEpoch ); |
404 | 404 | foreach ( $modules as $module ) { |
| 405 | + /** |
| 406 | + * @var $module ResourceLoaderModule |
| 407 | + */ |
405 | 408 | try { |
406 | 409 | // Bypass Squid and other shared caches if the request includes any private modules |
407 | 410 | if ( $module->getGroup() === 'private' ) { |
— | — | @@ -571,7 +574,7 @@ |
572 | 575 | $this->sendResponseHeaders( $context, $ts, false ); |
573 | 576 | // If there's an If-Modified-Since header, respond with a 304 appropriately |
574 | 577 | if ( $this->tryRespondLastModified( $context, $ts ) ) { |
575 | | - return; // output handled (buffers cleared) |
| 578 | + return false; // output handled (buffers cleared) |
576 | 579 | } |
577 | 580 | $response = $fileCache->fetchText(); |
578 | 581 | // Remove the output buffer and output the response |
— | — | @@ -617,6 +620,10 @@ |
618 | 621 | |
619 | 622 | // Generate output |
620 | 623 | foreach ( $modules as $name => $module ) { |
| 624 | + /** |
| 625 | + * @var $module ResourceLoaderModule |
| 626 | + */ |
| 627 | + |
621 | 628 | wfProfileIn( __METHOD__ . '-' . $name ); |
622 | 629 | try { |
623 | 630 | $scripts = ''; |
— | — | @@ -876,13 +883,13 @@ |
877 | 884 | /** |
878 | 885 | * Returns JS code which calls mw.loader.addSource() with the given |
879 | 886 | * parameters. Has two calling conventions: |
880 | | - * |
| 887 | + * |
881 | 888 | * - ResourceLoader::makeLoaderSourcesScript( $id, $properties ): |
882 | 889 | * Register a single source |
883 | | - * |
| 890 | + * |
884 | 891 | * - ResourceLoader::makeLoaderSourcesScript( array( $id1 => $props1, $id2 => $props2, ... ) ); |
885 | 892 | * Register sources with the given IDs and properties. |
886 | | - * |
| 893 | + * |
887 | 894 | * @param $id String: source ID |
888 | 895 | * @param $properties Array: source properties (see addSource()) |
889 | 896 | * |
— | — | @@ -982,7 +989,7 @@ |
983 | 990 | $query = self::makeLoaderQuery( $modules, $lang, $skin, $user, $version, $debug, |
984 | 991 | $only, $printable, $handheld, $extraQuery |
985 | 992 | ); |
986 | | - |
| 993 | + |
987 | 994 | // Prevent the IE6 extension check from being triggered (bug 28840) |
988 | 995 | // by appending a character that's invalid in Windows extensions ('*') |
989 | 996 | return wfExpandUrl( wfAppendQuery( $wgLoadScript, $query ) . '&*', PROTO_RELATIVE ); |
— | — | @@ -1017,7 +1024,7 @@ |
1018 | 1025 | $query['handheld'] = 1; |
1019 | 1026 | } |
1020 | 1027 | $query += $extraQuery; |
1021 | | - |
| 1028 | + |
1022 | 1029 | // Make queries uniform in order |
1023 | 1030 | ksort( $query ); |
1024 | 1031 | return $query; |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderUserOptionsModule.php |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | /** |
57 | 57 | * Fetch the context's user options, or if it doesn't match current user, |
58 | 58 | * the default options. |
59 | | - * |
| 59 | + * |
60 | 60 | * @param $context ResourceLoaderContext: Context object |
61 | 61 | * @return Array: List of user options keyed by option name |
62 | 62 | */ |
— | — | @@ -75,7 +75,7 @@ |
76 | 76 | * @return string |
77 | 77 | */ |
78 | 78 | public function getScript( ResourceLoaderContext $context ) { |
79 | | - return Xml::encodeJsCall( 'mw.user.options.set', |
| 79 | + return Xml::encodeJsCall( 'mw.user.options.set', |
80 | 80 | array( $this->contextUserOptions( $context ) ) ); |
81 | 81 | } |
82 | 82 | |
— | — | @@ -96,7 +96,7 @@ |
97 | 97 | |
98 | 98 | // Underline: 2 = browser default, 1 = always, 0 = never |
99 | 99 | if ( $options['underline'] < 2 ) { |
100 | | - $rules[] = "a { text-decoration: " . |
| 100 | + $rules[] = "a { text-decoration: " . |
101 | 101 | ( $options['underline'] ? 'underline !important' : 'none' ) . "; }"; |
102 | 102 | } |
103 | 103 | if ( $options['highlightbroken'] ) { |
— | — | @@ -133,7 +133,10 @@ |
134 | 134 | public function getGroup() { |
135 | 135 | return 'private'; |
136 | 136 | } |
137 | | - |
| 137 | + |
| 138 | + /** |
| 139 | + * @return array |
| 140 | + */ |
138 | 141 | public function getDependencies() { |
139 | 142 | return array( 'mediawiki.user' ); |
140 | 143 | } |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderFilePageModule.php |
— | — | @@ -1,8 +1,13 @@ |
2 | 2 | <?php |
3 | | -/* |
| 3 | +/** |
4 | 4 | * ResourceLoader definition for MediaWiki:Filepage.css |
5 | 5 | */ |
6 | 6 | class ResourceLoaderFilePageModule extends ResourceLoaderWikiModule { |
| 7 | + |
| 8 | + /** |
| 9 | + * @param $context ResourceLoaderContext |
| 10 | + * @return array |
| 11 | + */ |
7 | 12 | protected function getPages( ResourceLoaderContext $context ) { |
8 | 13 | return array( |
9 | 14 | 'MediaWiki:Filepage.css' => array( 'type' => 'style' ), |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderContext.php |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | */ |
23 | 23 | |
24 | 24 | /** |
25 | | - * Object passed around to modules which contains information about the state |
| 25 | + * Object passed around to modules which contains information about the state |
26 | 26 | * of a specific loader request |
27 | 27 | */ |
28 | 28 | class ResourceLoaderContext { |
— | — | @@ -42,6 +42,10 @@ |
43 | 43 | |
44 | 44 | /* Methods */ |
45 | 45 | |
| 46 | + /** |
| 47 | + * @param $resourceLoader ResourceLoader |
| 48 | + * @param $request WebRequest |
| 49 | + */ |
46 | 50 | public function __construct( $resourceLoader, WebRequest $request ) { |
47 | 51 | global $wgDefaultSkin, $wgResourceLoaderDebug; |
48 | 52 | |
— | — | @@ -63,7 +67,7 @@ |
64 | 68 | $this->skin = $wgDefaultSkin; |
65 | 69 | } |
66 | 70 | } |
67 | | - |
| 71 | + |
68 | 72 | /** |
69 | 73 | * Expand a string of the form jquery.foo,bar|jquery.ui.baz,quux to |
70 | 74 | * an array of module names like array( 'jquery.foo', 'jquery.bar', |
— | — | @@ -99,9 +103,10 @@ |
100 | 104 | } |
101 | 105 | return $retval; |
102 | 106 | } |
103 | | - |
| 107 | + |
104 | 108 | /** |
105 | 109 | * Return a dummy ResourceLoaderContext object suitable for passing into things that don't "really" need a context |
| 110 | + * @return ResourceLoaderContext |
106 | 111 | */ |
107 | 112 | public static function newDummyContext() { |
108 | 113 | return new self( null, new FauxRequest( array() ) ); |
— | — | @@ -218,7 +223,7 @@ |
219 | 224 | public function getHash() { |
220 | 225 | if ( !isset( $this->hash ) ) { |
221 | 226 | $this->hash = implode( '|', array( |
222 | | - $this->getLanguage(), $this->getDirection(), $this->skin, $this->user, |
| 227 | + $this->getLanguage(), $this->getDirection(), $this->skin, $this->user, |
223 | 228 | $this->debug, $this->only, $this->version |
224 | 229 | ) ); |
225 | 230 | } |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderUserModule.php |
— | — | @@ -38,16 +38,16 @@ |
39 | 39 | $username = $context->getUser(); |
40 | 40 | $userpageTitle = Title::makeTitleSafe( NS_USER, $username ); |
41 | 41 | $userpage = $userpageTitle->getPrefixedDBkey(); // Needed so $excludepages works |
42 | | - |
| 42 | + |
43 | 43 | $pages = array( |
44 | 44 | "$userpage/common.js" => array( 'type' => 'script' ), |
45 | | - "$userpage/" . $context->getSkin() . '.js' => |
| 45 | + "$userpage/" . $context->getSkin() . '.js' => |
46 | 46 | array( 'type' => 'script' ), |
47 | 47 | "$userpage/common.css" => array( 'type' => 'style' ), |
48 | | - "$userpage/" . $context->getSkin() . '.css' => |
| 48 | + "$userpage/" . $context->getSkin() . '.css' => |
49 | 49 | array( 'type' => 'style' ), |
50 | 50 | ); |
51 | | - |
| 51 | + |
52 | 52 | // Hack for bug 26283: if we're on a preview page for a CSS/JS page, |
53 | 53 | // we need to exclude that page from this module. In that case, the excludepage |
54 | 54 | // parameter will be set to the name of the page we need to exclude. |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderFileModule.php |
— | — | @@ -223,7 +223,11 @@ |
224 | 224 | $files = $this->getScriptFiles( $context ); |
225 | 225 | return $this->readScriptFiles( $files ); |
226 | 226 | } |
227 | | - |
| 227 | + |
| 228 | + /** |
| 229 | + * @param $context ResourceLoaderContext |
| 230 | + * @return array |
| 231 | + */ |
228 | 232 | public function getScriptURLsForDebug( ResourceLoaderContext $context ) { |
229 | 233 | $urls = array(); |
230 | 234 | foreach ( $this->getScriptFiles( $context ) as $file ) { |
— | — | @@ -232,6 +236,9 @@ |
233 | 237 | return $urls; |
234 | 238 | } |
235 | 239 | |
| 240 | + /** |
| 241 | + * @return bool |
| 242 | + */ |
236 | 243 | public function supportsURLLoading() { |
237 | 244 | return $this->debugRaw; |
238 | 245 | } |
— | — | @@ -275,6 +282,10 @@ |
276 | 283 | return $styles; |
277 | 284 | } |
278 | 285 | |
| 286 | + /** |
| 287 | + * @param $context ResourceLoaderContext |
| 288 | + * @return array |
| 289 | + */ |
279 | 290 | public function getStyleURLsForDebug( ResourceLoaderContext $context ) { |
280 | 291 | $urls = array(); |
281 | 292 | foreach ( $this->getStyleFiles( $context ) as $mediaType => $list ) { |
— | — | @@ -582,7 +593,7 @@ |
583 | 594 | $style, $dir, $remoteDir, true |
584 | 595 | ); |
585 | 596 | } |
586 | | - |
| 597 | + |
587 | 598 | /** |
588 | 599 | * Safe version of filemtime(), which doesn't throw a PHP warning if the file doesn't exist |
589 | 600 | * but returns 1 instead. |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderModule.php |
— | — | @@ -52,11 +52,11 @@ |
53 | 53 | # limit the types of scripts and styles we allow to load on, say, sensitive special |
54 | 54 | # pages like Special:UserLogin and Special:Preferences |
55 | 55 | protected $origin = self::ORIGIN_CORE_SITEWIDE; |
56 | | - |
| 56 | + |
57 | 57 | /* Protected Members */ |
58 | 58 | |
59 | 59 | protected $name = null; |
60 | | - |
| 60 | + |
61 | 61 | // In-object cache for file dependencies |
62 | 62 | protected $fileDeps = array(); |
63 | 63 | // In-object cache for message blob mtime |
— | — | @@ -126,18 +126,18 @@ |
127 | 127 | // Stub, override expected |
128 | 128 | return ''; |
129 | 129 | } |
130 | | - |
| 130 | + |
131 | 131 | /** |
132 | 132 | * Get the URL or URLs to load for this module's JS in debug mode. |
133 | 133 | * The default behavior is to return a load.php?only=scripts URL for |
134 | 134 | * the module, but file-based modules will want to override this to |
135 | 135 | * load the files directly. |
136 | | - * |
| 136 | + * |
137 | 137 | * This function is called only when 1) we're in debug mode, 2) there |
138 | 138 | * is no only= parameter and 3) supportsURLLoading() returns true. |
139 | 139 | * #2 is important to prevent an infinite loop, therefore this function |
140 | 140 | * MUST return either an only= URL or a non-load.php URL. |
141 | | - * |
| 141 | + * |
142 | 142 | * @param $context ResourceLoaderContext: Context object |
143 | 143 | * @return Array of URLs |
144 | 144 | */ |
— | — | @@ -155,7 +155,7 @@ |
156 | 156 | ); |
157 | 157 | return array( $url ); |
158 | 158 | } |
159 | | - |
| 159 | + |
160 | 160 | /** |
161 | 161 | * Whether this module supports URL loading. If this function returns false, |
162 | 162 | * getScript() will be used even in cases (debug mode, no only param) where |
— | — | @@ -176,13 +176,13 @@ |
177 | 177 | // Stub, override expected |
178 | 178 | return array(); |
179 | 179 | } |
180 | | - |
| 180 | + |
181 | 181 | /** |
182 | 182 | * Get the URL or URLs to load for this module's CSS in debug mode. |
183 | 183 | * The default behavior is to return a load.php?only=styles URL for |
184 | 184 | * the module, but file-based modules will want to override this to |
185 | 185 | * load the files directly. See also getScriptURLsForDebug() |
186 | | - * |
| 186 | + * |
187 | 187 | * @param $context ResourceLoaderContext: Context object |
188 | 188 | * @return Array: array( mediaType => array( URL1, URL2, ... ), ... ) |
189 | 189 | */ |
— | — | @@ -212,10 +212,10 @@ |
213 | 213 | // Stub, override expected |
214 | 214 | return array(); |
215 | 215 | } |
216 | | - |
| 216 | + |
217 | 217 | /** |
218 | 218 | * Get the group this module is in. |
219 | | - * |
| 219 | + * |
220 | 220 | * @return String: Group name |
221 | 221 | */ |
222 | 222 | public function getGroup() { |
— | — | @@ -225,14 +225,14 @@ |
226 | 226 | |
227 | 227 | /** |
228 | 228 | * Get the origin of this module. Should only be overridden for foreign modules. |
229 | | - * |
| 229 | + * |
230 | 230 | * @return String: Origin name, 'local' for local modules |
231 | 231 | */ |
232 | 232 | public function getSource() { |
233 | 233 | // Stub, override expected |
234 | 234 | return 'local'; |
235 | 235 | } |
236 | | - |
| 236 | + |
237 | 237 | /** |
238 | 238 | * Where on the HTML page should this module's JS be loaded? |
239 | 239 | * 'top': in the <head> |
— | — | @@ -273,7 +273,7 @@ |
274 | 274 | // Stub, override expected |
275 | 275 | return array(); |
276 | 276 | } |
277 | | - |
| 277 | + |
278 | 278 | /** |
279 | 279 | * Get the files this module depends on indirectly for a given skin. |
280 | 280 | * Currently these are only image files referenced by the module's CSS. |
— | — | @@ -300,7 +300,7 @@ |
301 | 301 | } |
302 | 302 | return $this->fileDeps[$skin]; |
303 | 303 | } |
304 | | - |
| 304 | + |
305 | 305 | /** |
306 | 306 | * Set preloaded file dependency information. Used so we can load this |
307 | 307 | * information for all modules at once. |
— | — | @@ -310,7 +310,7 @@ |
311 | 311 | public function setFileDependencies( $skin, $deps ) { |
312 | 312 | $this->fileDeps[$skin] = $deps; |
313 | 313 | } |
314 | | - |
| 314 | + |
315 | 315 | /** |
316 | 316 | * Get the last modification timestamp of the message blob for this |
317 | 317 | * module in a given language. |
— | — | @@ -321,7 +321,7 @@ |
322 | 322 | if ( !isset( $this->msgBlobMtime[$lang] ) ) { |
323 | 323 | if ( !count( $this->getMessages() ) ) |
324 | 324 | return 0; |
325 | | - |
| 325 | + |
326 | 326 | $dbr = wfGetDB( DB_SLAVE ); |
327 | 327 | $msgBlobMtime = $dbr->selectField( 'msg_resource', 'mr_timestamp', array( |
328 | 328 | 'mr_resource' => $this->getName(), |
— | — | @@ -337,7 +337,7 @@ |
338 | 338 | } |
339 | 339 | return $this->msgBlobMtime[$lang]; |
340 | 340 | } |
341 | | - |
| 341 | + |
342 | 342 | /** |
343 | 343 | * Set a preloaded message blob last modification timestamp. Used so we |
344 | 344 | * can load this information for all modules at once. |
— | — | @@ -347,9 +347,9 @@ |
348 | 348 | public function setMsgBlobMtime( $lang, $mtime ) { |
349 | 349 | $this->msgBlobMtime[$lang] = $mtime; |
350 | 350 | } |
351 | | - |
| 351 | + |
352 | 352 | /* Abstract Methods */ |
353 | | - |
| 353 | + |
354 | 354 | /** |
355 | 355 | * Get this module's last modification timestamp for a given |
356 | 356 | * combination of language, skin and debug mode flag. This is typically |
— | — | @@ -364,7 +364,7 @@ |
365 | 365 | // 0 would mean now |
366 | 366 | return 1; |
367 | 367 | } |
368 | | - |
| 368 | + |
369 | 369 | /** |
370 | 370 | * Check whether this module is known to be empty. If a child class |
371 | 371 | * has an easy and cheap way to determine that this module is |
— | — | @@ -412,7 +412,7 @@ |
413 | 413 | $err = $e->getMessage(); |
414 | 414 | $result = "throw new Error(" . Xml::encodeJsVar("JavaScript parse error: $err") . ");"; |
415 | 415 | } |
416 | | - |
| 416 | + |
417 | 417 | $cache->set( $key, $result ); |
418 | 418 | return $result; |
419 | 419 | } else { |
— | — | @@ -420,6 +420,9 @@ |
421 | 421 | } |
422 | 422 | } |
423 | 423 | |
| 424 | + /** |
| 425 | + * @return JSParser |
| 426 | + */ |
424 | 427 | protected static function javaScriptParser() { |
425 | 428 | if ( !self::$jsParser ) { |
426 | 429 | self::$jsParser = new JSParser(); |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderStartUpModule.php |
— | — | @@ -241,6 +241,9 @@ |
242 | 242 | return $out; |
243 | 243 | } |
244 | 244 | |
| 245 | + /** |
| 246 | + * @return bool |
| 247 | + */ |
245 | 248 | public function supportsURLLoading() { |
246 | 249 | return false; |
247 | 250 | } |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderUserTokensModule.php |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | |
34 | 34 | /** |
35 | 35 | * Fetch the tokens for the current user. |
36 | | - * |
| 36 | + * |
37 | 37 | * @param $context ResourceLoaderContext: Context object |
38 | 38 | * @return Array: List of tokens keyed by token type |
39 | 39 | */ |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | * @return string |
52 | 52 | */ |
53 | 53 | public function getScript( ResourceLoaderContext $context ) { |
54 | | - return Xml::encodeJsCall( 'mw.user.tokens.set', |
| 54 | + return Xml::encodeJsCall( 'mw.user.tokens.set', |
55 | 55 | array( $this->contextUserTokens( $context ) ) ); |
56 | 56 | } |
57 | 57 | |
— | — | @@ -60,7 +60,10 @@ |
61 | 61 | public function getGroup() { |
62 | 62 | return 'private'; |
63 | 63 | } |
64 | | - |
| 64 | + |
| 65 | + /** |
| 66 | + * @return array |
| 67 | + */ |
65 | 68 | public function getDependencies() { |
66 | 69 | return array( 'mediawiki.user' ); |
67 | 70 | } |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderWikiModule.php |
— | — | @@ -24,35 +24,39 @@ |
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Abstraction for resource loader modules which pull from wiki pages |
28 | | - * |
29 | | - * This can only be used for wiki pages in the MediaWiki and User namespaces, |
30 | | - * because of its dependence on the functionality of |
| 28 | + * |
| 29 | + * This can only be used for wiki pages in the MediaWiki and User namespaces, |
| 30 | + * because of its dependence on the functionality of |
31 | 31 | * Title::isValidCssJsSubpage. |
32 | 32 | */ |
33 | 33 | abstract class ResourceLoaderWikiModule extends ResourceLoaderModule { |
34 | | - |
| 34 | + |
35 | 35 | /* Protected Members */ |
36 | 36 | |
37 | 37 | # Origin is user-supplied code |
38 | 38 | protected $origin = self::ORIGIN_USER_SITEWIDE; |
39 | | - |
| 39 | + |
40 | 40 | // In-object cache for title mtimes |
41 | 41 | protected $titleMtimes = array(); |
42 | | - |
| 42 | + |
43 | 43 | /* Abstract Protected Methods */ |
44 | | - |
| 44 | + |
| 45 | + /** |
| 46 | + * @abstract |
| 47 | + * @param $context ResourceLoaderContext |
| 48 | + */ |
45 | 49 | abstract protected function getPages( ResourceLoaderContext $context ); |
46 | | - |
| 50 | + |
47 | 51 | /* Protected Methods */ |
48 | | - |
| 52 | + |
49 | 53 | /** |
50 | 54 | * Get the Database object used in getTitleMTimes(). Defaults to the local slave DB |
51 | 55 | * but subclasses may want to override this to return a remote DB object. |
52 | | - * |
| 56 | + * |
53 | 57 | * NOTE: This ONLY works for getTitleMTimes() and getModifiedTime(), NOT FOR ANYTHING ELSE. |
54 | 58 | * In particular, it doesn't work for getting the content of JS and CSS pages. That functionality |
55 | 59 | * will use the local DB irrespective of the return value of this method. |
56 | | - * |
| 60 | + * |
57 | 61 | * @return DatabaseBase |
58 | 62 | */ |
59 | 63 | protected function getDB() { |
— | — | @@ -77,7 +81,7 @@ |
78 | 82 | } |
79 | 83 | return $revision->getRawText(); |
80 | 84 | } |
81 | | - |
| 85 | + |
82 | 86 | /* Methods */ |
83 | 87 | |
84 | 88 | /** |
— | — | @@ -112,7 +116,7 @@ |
113 | 117 | */ |
114 | 118 | public function getStyles( ResourceLoaderContext $context ) { |
115 | 119 | global $wgScriptPath; |
116 | | - |
| 120 | + |
117 | 121 | $styles = array(); |
118 | 122 | foreach ( $this->getPages( $context ) as $titleText => $options ) { |
119 | 123 | if ( $options['type'] !== 'style' ) { |
— | — | @@ -121,7 +125,7 @@ |
122 | 126 | $title = Title::newFromText( $titleText ); |
123 | 127 | if ( !$title || $title->isRedirect() ) { |
124 | 128 | continue; |
125 | | - } |
| 129 | + } |
126 | 130 | $media = isset( $options['media'] ) ? $options['media'] : 'all'; |
127 | 131 | $style = $this->getContent( $title ); |
128 | 132 | if ( strval( $style ) === '' ) { |
— | — | @@ -174,13 +178,13 @@ |
175 | 179 | if ( isset( $this->titleMtimes[$hash] ) ) { |
176 | 180 | return $this->titleMtimes[$hash]; |
177 | 181 | } |
178 | | - |
| 182 | + |
179 | 183 | $this->titleMtimes[$hash] = array(); |
180 | 184 | $batch = new LinkBatch; |
181 | 185 | foreach ( $this->getPages( $context ) as $titleText => $options ) { |
182 | 186 | $batch->addObj( Title::newFromText( $titleText ) ); |
183 | 187 | } |
184 | | - |
| 188 | + |
185 | 189 | if ( !$batch->isEmpty() ) { |
186 | 190 | $dbr = $this->getDB(); |
187 | 191 | $res = $dbr->select( 'page', |