Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 210 |
|
0.00% |
0 / 21 |
CRAP | |
0.00% |
0 / 1 |
GenerateSitemap | |
0.00% |
0 / 210 |
|
0.00% |
0 / 21 |
3306 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 34 |
|
0.00% |
0 / 1 |
2 | |||
execute | |
0.00% |
0 / 20 |
|
0.00% |
0 / 1 |
20 | |||
setNamespacePriorities | |
0.00% |
0 / 27 |
|
0.00% |
0 / 1 |
30 | |||
generateNamespaces | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
30 | |||
priority | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
guessPriority | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
getPageRes | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
main | |
0.00% |
0 / 61 |
|
0.00% |
0 / 1 |
306 | |||
open | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
12 | |||
write | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
20 | |||
close | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
sitemapFilename | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
xmlHead | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
xmlSchema | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
openIndex | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
indexEntry | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |||
closeIndex | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
openFile | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
fileEntry | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
closeFile | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
generateLimit | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | /** |
3 | * Creates a sitemap for the site. |
4 | * |
5 | * Copyright © 2005, Ævar Arnfjörð Bjarmason, Jens Frank <jeluf@gmx.de> and |
6 | * Brooke Vibber <bvibber@wikimedia.org> |
7 | * |
8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation; either version 2 of the License, or |
11 | * (at your option) any later version. |
12 | * |
13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. |
17 | * |
18 | * You should have received a copy of the GNU General Public License along |
19 | * with this program; if not, write to the Free Software Foundation, Inc., |
20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
21 | * http://www.gnu.org/copyleft/gpl.html |
22 | * |
23 | * @file |
24 | * @ingroup Maintenance |
25 | * @see http://www.sitemaps.org/ |
26 | * @see http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd |
27 | */ |
28 | |
29 | use MediaWiki\MainConfigNames; |
30 | use MediaWiki\Title\Title; |
31 | use MediaWiki\WikiMap\WikiMap; |
32 | use Wikimedia\Rdbms\IDatabase; |
33 | use Wikimedia\Rdbms\IResultWrapper; |
34 | |
35 | // @codeCoverageIgnoreStart |
36 | require_once __DIR__ . '/Maintenance.php'; |
37 | // @codeCoverageIgnoreEnd |
38 | |
39 | /** |
40 | * Maintenance script that generates a sitemap for the site. |
41 | * |
42 | * @ingroup Maintenance |
43 | */ |
44 | class GenerateSitemap extends Maintenance { |
45 | private const GS_MAIN = -2; |
46 | private const GS_TALK = -1; |
47 | |
48 | /** |
49 | * The maximum amount of urls in a sitemap file |
50 | * |
51 | * @link http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd |
52 | * |
53 | * @var int |
54 | */ |
55 | public $url_limit; |
56 | |
57 | /** |
58 | * The maximum size of a sitemap file |
59 | * |
60 | * @link http://www.sitemaps.org/faq.php#faq_sitemap_size |
61 | * |
62 | * @var int |
63 | */ |
64 | public $size_limit; |
65 | |
66 | /** |
67 | * The path to prepend to the filename |
68 | * |
69 | * @var string |
70 | */ |
71 | public $fspath; |
72 | |
73 | /** |
74 | * The URL path to prepend to filenames in the index; |
75 | * should resolve to the same directory as $fspath. |
76 | * |
77 | * @var string |
78 | */ |
79 | public $urlpath; |
80 | |
81 | /** |
82 | * Whether or not to use compression |
83 | * |
84 | * @var bool |
85 | */ |
86 | public $compress; |
87 | |
88 | /** |
89 | * Whether or not to include redirection pages |
90 | * |
91 | * @var bool |
92 | */ |
93 | public $skipRedirects; |
94 | |
95 | /** |
96 | * The number of entries to save in each sitemap file |
97 | * |
98 | * @var array |
99 | */ |
100 | public $limit = []; |
101 | |
102 | /** |
103 | * Key => value entries of namespaces and their priorities |
104 | * |
105 | * @var array |
106 | */ |
107 | public $priorities = []; |
108 | |
109 | /** |
110 | * A one-dimensional array of namespaces in the wiki |
111 | * |
112 | * @var array |
113 | */ |
114 | public $namespaces = []; |
115 | |
116 | /** |
117 | * When this sitemap batch was generated |
118 | * |
119 | * @var string |
120 | */ |
121 | public $timestamp; |
122 | |
123 | /** |
124 | * A database replica DB object |
125 | * |
126 | * @var IDatabase |
127 | */ |
128 | public $dbr; |
129 | |
130 | /** |
131 | * A resource pointing to the sitemap index file |
132 | * |
133 | * @var resource |
134 | */ |
135 | public $findex; |
136 | |
137 | /** |
138 | * A resource pointing to a sitemap file |
139 | * |
140 | * @var resource|false |
141 | */ |
142 | public $file; |
143 | |
144 | /** |
145 | * Identifier to use in filenames, default $wgDBname |
146 | * |
147 | * @var string |
148 | */ |
149 | private $identifier; |
150 | |
151 | public function __construct() { |
152 | parent::__construct(); |
153 | $this->addDescription( 'Creates a sitemap for the site' ); |
154 | $this->addOption( |
155 | 'fspath', |
156 | 'The file system path to save to, e.g. /tmp/sitemap; defaults to current directory', |
157 | false, |
158 | true |
159 | ); |
160 | $this->addOption( |
161 | 'urlpath', |
162 | 'The URL path corresponding to --fspath, prepended to filenames in the index; ' |
163 | . 'defaults to an empty string', |
164 | false, |
165 | true |
166 | ); |
167 | $this->addOption( |
168 | 'compress', |
169 | 'Compress the sitemap files, can take value yes|no, default yes', |
170 | false, |
171 | true |
172 | ); |
173 | $this->addOption( 'skip-redirects', 'Do not include redirecting articles in the sitemap' ); |
174 | $this->addOption( |
175 | 'identifier', |
176 | 'What site identifier to use for the wiki, defaults to $wgDBname', |
177 | false, |
178 | true |
179 | ); |
180 | $this->addOption( |
181 | 'namespaces', |
182 | 'Only include pages in these namespaces in the sitemap, ' . |
183 | 'defaults to the value of wgSitemapNamespaces if not defined.', |
184 | false, true, false, true |
185 | ); |
186 | } |
187 | |
188 | /** |
189 | * Execute |
190 | */ |
191 | public function execute() { |
192 | $this->setNamespacePriorities(); |
193 | $this->url_limit = 50000; |
194 | $this->size_limit = ( 2 ** 20 ) * 10; |
195 | |
196 | # Create directory if needed |
197 | $fspath = $this->getOption( 'fspath', getcwd() ); |
198 | if ( !wfMkdirParents( $fspath, null, __METHOD__ ) ) { |
199 | $this->fatalError( "Can not create directory $fspath." ); |
200 | } |
201 | |
202 | $dbDomain = WikiMap::getCurrentWikiDbDomain()->getId(); |
203 | $this->fspath = realpath( $fspath ) . DIRECTORY_SEPARATOR; |
204 | $this->urlpath = $this->getOption( 'urlpath', "" ); |
205 | if ( $this->urlpath !== "" && substr( $this->urlpath, -1 ) !== '/' ) { |
206 | $this->urlpath .= '/'; |
207 | } |
208 | $this->identifier = $this->getOption( 'identifier', $dbDomain ); |
209 | $this->compress = $this->getOption( 'compress', 'yes' ) !== 'no'; |
210 | $this->skipRedirects = $this->hasOption( 'skip-redirects' ); |
211 | $this->dbr = $this->getReplicaDB(); |
212 | $this->generateNamespaces(); |
213 | $this->timestamp = wfTimestamp( TS_ISO_8601, wfTimestampNow() ); |
214 | $encIdentifier = rawurlencode( $this->identifier ); |
215 | $this->findex = fopen( "{$this->fspath}sitemap-index-{$encIdentifier}.xml", 'wb' ); |
216 | $this->main(); |
217 | } |
218 | |
219 | private function setNamespacePriorities() { |
220 | $sitemapNamespacesPriorities = $this->getConfig()->get( MainConfigNames::SitemapNamespacesPriorities ); |
221 | |
222 | // Custom main namespaces |
223 | $this->priorities[self::GS_MAIN] = '0.5'; |
224 | // Custom talk namespaces |
225 | $this->priorities[self::GS_TALK] = '0.1'; |
226 | // MediaWiki standard namespaces |
227 | $this->priorities[NS_MAIN] = '1.0'; |
228 | $this->priorities[NS_TALK] = '0.1'; |
229 | $this->priorities[NS_USER] = '0.5'; |
230 | $this->priorities[NS_USER_TALK] = '0.1'; |
231 | $this->priorities[NS_PROJECT] = '0.5'; |
232 | $this->priorities[NS_PROJECT_TALK] = '0.1'; |
233 | $this->priorities[NS_FILE] = '0.5'; |
234 | $this->priorities[NS_FILE_TALK] = '0.1'; |
235 | $this->priorities[NS_MEDIAWIKI] = '0.0'; |
236 | $this->priorities[NS_MEDIAWIKI_TALK] = '0.1'; |
237 | $this->priorities[NS_TEMPLATE] = '0.0'; |
238 | $this->priorities[NS_TEMPLATE_TALK] = '0.1'; |
239 | $this->priorities[NS_HELP] = '0.5'; |
240 | $this->priorities[NS_HELP_TALK] = '0.1'; |
241 | $this->priorities[NS_CATEGORY] = '0.5'; |
242 | $this->priorities[NS_CATEGORY_TALK] = '0.1'; |
243 | |
244 | // Custom priorities |
245 | if ( $sitemapNamespacesPriorities !== false ) { |
246 | /** |
247 | * @var array $sitemapNamespacesPriorities |
248 | */ |
249 | foreach ( $sitemapNamespacesPriorities as $namespace => $priority ) { |
250 | $float = floatval( $priority ); |
251 | if ( $float > 1.0 ) { |
252 | $priority = '1.0'; |
253 | } elseif ( $float < 0.0 ) { |
254 | $priority = '0.0'; |
255 | } |
256 | $this->priorities[$namespace] = $priority; |
257 | } |
258 | } |
259 | } |
260 | |
261 | /** |
262 | * Generate a one-dimensional array of existing namespaces |
263 | */ |
264 | private function generateNamespaces() { |
265 | // Use the namespaces passed in via command line arguments if they are set. |
266 | $sitemapNamespacesFromConfig = $this->getOption( 'namespaces' ); |
267 | if ( is_array( $sitemapNamespacesFromConfig ) && count( $sitemapNamespacesFromConfig ) > 0 ) { |
268 | $this->namespaces = $sitemapNamespacesFromConfig; |
269 | |
270 | return; |
271 | } |
272 | |
273 | // Only generate for specific namespaces if $wgSitemapNamespaces is an array. |
274 | $sitemapNamespaces = $this->getConfig()->get( MainConfigNames::SitemapNamespaces ); |
275 | if ( is_array( $sitemapNamespaces ) ) { |
276 | $this->namespaces = $sitemapNamespaces; |
277 | |
278 | return; |
279 | } |
280 | |
281 | $res = $this->dbr->newSelectQueryBuilder() |
282 | ->select( [ 'page_namespace' ] ) |
283 | ->from( 'page' ) |
284 | ->groupBy( 'page_namespace' ) |
285 | ->orderBy( 'page_namespace' ) |
286 | ->caller( __METHOD__ )->fetchResultSet(); |
287 | |
288 | foreach ( $res as $row ) { |
289 | $this->namespaces[] = $row->page_namespace; |
290 | } |
291 | } |
292 | |
293 | /** |
294 | * Get the priority of a given namespace |
295 | * |
296 | * @param int $namespace The namespace to get the priority for |
297 | * @return string |
298 | */ |
299 | private function priority( $namespace ) { |
300 | return $this->priorities[$namespace] ?? $this->guessPriority( $namespace ); |
301 | } |
302 | |
303 | /** |
304 | * If the namespace isn't listed on the priority list return the |
305 | * default priority for the namespace, varies depending on whether it's |
306 | * a talkpage or not. |
307 | * |
308 | * @param int $namespace The namespace to get the priority for |
309 | * @return string |
310 | */ |
311 | private function guessPriority( $namespace ) { |
312 | return $this->getServiceContainer()->getNamespaceInfo()->isSubject( $namespace ) |
313 | ? $this->priorities[self::GS_MAIN] |
314 | : $this->priorities[self::GS_TALK]; |
315 | } |
316 | |
317 | /** |
318 | * Return a database resolution of all the pages in a given namespace |
319 | * |
320 | * @param int $namespace Limit the query to this namespace |
321 | * @return IResultWrapper |
322 | */ |
323 | private function getPageRes( $namespace ) { |
324 | return $this->dbr->newSelectQueryBuilder() |
325 | ->select( [ 'page_namespace', 'page_title', 'page_touched', 'page_is_redirect', 'pp_propname' ] ) |
326 | ->from( 'page' ) |
327 | ->leftJoin( 'page_props', null, [ 'page_id = pp_page', 'pp_propname' => 'noindex' ] ) |
328 | ->where( [ 'page_namespace' => $namespace ] ) |
329 | ->caller( __METHOD__ )->fetchResultSet(); |
330 | } |
331 | |
332 | /** |
333 | * Main loop |
334 | */ |
335 | public function main() { |
336 | $services = $this->getServiceContainer(); |
337 | $contLang = $services->getContentLanguage(); |
338 | $langConverter = $services->getLanguageConverterFactory()->getLanguageConverter( $contLang ); |
339 | $serverUrl = $services->getUrlUtils()->getServer( PROTO_CANONICAL ) ?? ''; |
340 | |
341 | fwrite( $this->findex, $this->openIndex() ); |
342 | |
343 | foreach ( $this->namespaces as $namespace ) { |
344 | $res = $this->getPageRes( $namespace ); |
345 | $this->file = false; |
346 | $this->generateLimit( $namespace ); |
347 | $length = $this->limit[0]; |
348 | $i = $smcount = 0; |
349 | |
350 | $fns = $contLang->getFormattedNsText( $namespace ); |
351 | $this->output( "$namespace ($fns)\n" ); |
352 | $skippedRedirects = 0; // Number of redirects skipped for that namespace |
353 | $skippedNoindex = 0; // Number of pages with __NOINDEX__ switch for that NS |
354 | foreach ( $res as $row ) { |
355 | if ( $row->pp_propname === 'noindex' ) { |
356 | $skippedNoindex++; |
357 | continue; |
358 | } |
359 | |
360 | if ( $this->skipRedirects && $row->page_is_redirect ) { |
361 | $skippedRedirects++; |
362 | continue; |
363 | } |
364 | |
365 | if ( $i++ === 0 |
366 | || $i === $this->url_limit + 1 |
367 | || $length + $this->limit[1] + $this->limit[2] > $this->size_limit |
368 | ) { |
369 | if ( $this->file !== false ) { |
370 | $this->write( $this->file, $this->closeFile() ); |
371 | $this->close( $this->file ); |
372 | } |
373 | $filename = $this->sitemapFilename( $namespace, $smcount++ ); |
374 | $this->file = $this->open( $this->fspath . $filename, 'wb' ); |
375 | $this->write( $this->file, $this->openFile() ); |
376 | fwrite( $this->findex, $this->indexEntry( $filename, $serverUrl ) ); |
377 | $this->output( "\t$this->fspath$filename\n" ); |
378 | $length = $this->limit[0]; |
379 | $i = 1; |
380 | } |
381 | $title = Title::makeTitle( $row->page_namespace, $row->page_title ); |
382 | $date = wfTimestamp( TS_ISO_8601, $row->page_touched ); |
383 | $entry = $this->fileEntry( $title->getCanonicalURL(), $date, $this->priority( $namespace ) ); |
384 | $length += strlen( $entry ); |
385 | $this->write( $this->file, $entry ); |
386 | // generate pages for language variants |
387 | if ( $langConverter->hasVariants() ) { |
388 | $variants = $langConverter->getVariants(); |
389 | foreach ( $variants as $vCode ) { |
390 | if ( $vCode == $contLang->getCode() ) { |
391 | continue; // we don't want default variant |
392 | } |
393 | $entry = $this->fileEntry( |
394 | $title->getCanonicalURL( [ 'variant' => $vCode ] ), |
395 | $date, |
396 | $this->priority( $namespace ) |
397 | ); |
398 | $length += strlen( $entry ); |
399 | $this->write( $this->file, $entry ); |
400 | } |
401 | } |
402 | } |
403 | |
404 | if ( $skippedNoindex > 0 ) { |
405 | $this->output( " skipped $skippedNoindex page(s) with __NOINDEX__ switch\n" ); |
406 | } |
407 | |
408 | if ( $this->skipRedirects && $skippedRedirects > 0 ) { |
409 | $this->output( " skipped $skippedRedirects redirect(s)\n" ); |
410 | } |
411 | |
412 | if ( $this->file ) { |
413 | $this->write( $this->file, $this->closeFile() ); |
414 | $this->close( $this->file ); |
415 | } |
416 | } |
417 | fwrite( $this->findex, $this->closeIndex() ); |
418 | fclose( $this->findex ); |
419 | } |
420 | |
421 | /** |
422 | * gzopen() / fopen() wrapper |
423 | * |
424 | * @param string $file |
425 | * @param string $flags |
426 | * @return resource |
427 | */ |
428 | private function open( $file, $flags ) { |
429 | $resource = $this->compress ? gzopen( $file, $flags ) : fopen( $file, $flags ); |
430 | if ( $resource === false ) { |
431 | throw new RuntimeException( __METHOD__ |
432 | . " error opening file $file with flags $flags. Check permissions?" ); |
433 | } |
434 | |
435 | return $resource; |
436 | } |
437 | |
438 | /** |
439 | * gzwrite() / fwrite() wrapper |
440 | * |
441 | * @param resource &$handle |
442 | * @param string $str |
443 | */ |
444 | private function write( &$handle, $str ) { |
445 | if ( $handle === true || $handle === false ) { |
446 | throw new InvalidArgumentException( __METHOD__ . " was passed a boolean as a file handle.\n" ); |
447 | } |
448 | if ( $this->compress ) { |
449 | gzwrite( $handle, $str ); |
450 | } else { |
451 | fwrite( $handle, $str ); |
452 | } |
453 | } |
454 | |
455 | /** |
456 | * gzclose() / fclose() wrapper |
457 | * |
458 | * @param resource &$handle |
459 | */ |
460 | private function close( &$handle ) { |
461 | if ( $this->compress ) { |
462 | gzclose( $handle ); |
463 | } else { |
464 | fclose( $handle ); |
465 | } |
466 | } |
467 | |
468 | /** |
469 | * Get a sitemap filename |
470 | * |
471 | * @param int $namespace |
472 | * @param int $count |
473 | * @return string |
474 | */ |
475 | private function sitemapFilename( $namespace, $count ) { |
476 | $ext = $this->compress ? '.gz' : ''; |
477 | |
478 | return "sitemap-{$this->identifier}-NS_$namespace-$count.xml$ext"; |
479 | } |
480 | |
481 | /** |
482 | * Return the XML required to open an XML file |
483 | * |
484 | * @return string |
485 | */ |
486 | private function xmlHead() { |
487 | return '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; |
488 | } |
489 | |
490 | /** |
491 | * Return the XML schema being used |
492 | * |
493 | * @return string |
494 | */ |
495 | private function xmlSchema() { |
496 | return 'http://www.sitemaps.org/schemas/sitemap/0.9'; |
497 | } |
498 | |
499 | /** |
500 | * Return the XML required to open a sitemap index file |
501 | * |
502 | * @return string |
503 | */ |
504 | private function openIndex() { |
505 | return $this->xmlHead() . '<sitemapindex xmlns="' . $this->xmlSchema() . '">' . "\n"; |
506 | } |
507 | |
508 | /** |
509 | * Return the XML for a single sitemap indexfile entry |
510 | * |
511 | * @param string $filename The filename of the sitemap file |
512 | * @param string $serverUrl Current server url |
513 | * @return string |
514 | */ |
515 | private function indexEntry( $filename, $serverUrl ) { |
516 | return "\t<sitemap>\n" . |
517 | "\t\t<loc>" . $serverUrl . |
518 | ( substr( $this->urlpath, 0, 1 ) === "/" ? "" : "/" ) . |
519 | "{$this->urlpath}$filename</loc>\n" . |
520 | "\t\t<lastmod>{$this->timestamp}</lastmod>\n" . |
521 | "\t</sitemap>\n"; |
522 | } |
523 | |
524 | /** |
525 | * Return the XML required to close a sitemap index file |
526 | * |
527 | * @return string |
528 | */ |
529 | private function closeIndex() { |
530 | return "</sitemapindex>\n"; |
531 | } |
532 | |
533 | /** |
534 | * Return the XML required to open a sitemap file |
535 | * |
536 | * @return string |
537 | */ |
538 | private function openFile() { |
539 | return $this->xmlHead() . '<urlset xmlns="' . $this->xmlSchema() . '">' . "\n"; |
540 | } |
541 | |
542 | /** |
543 | * Return the XML for a single sitemap entry |
544 | * |
545 | * @param string $url An RFC 2396 compliant URL |
546 | * @param string $date A ISO 8601 date |
547 | * @param string $priority A priority indicator, 0.0 - 1.0 inclusive with a 0.1 stepsize |
548 | * @return string |
549 | */ |
550 | private function fileEntry( $url, $date, $priority ) { |
551 | return "\t<url>\n" . |
552 | // T36666: $url may contain bad characters such as ampersands. |
553 | "\t\t<loc>" . htmlspecialchars( $url ) . "</loc>\n" . |
554 | "\t\t<lastmod>$date</lastmod>\n" . |
555 | "\t\t<priority>$priority</priority>\n" . |
556 | "\t</url>\n"; |
557 | } |
558 | |
559 | /** |
560 | * Return the XML required to close sitemap file |
561 | * |
562 | * @return string |
563 | */ |
564 | private function closeFile() { |
565 | return "</urlset>\n"; |
566 | } |
567 | |
568 | /** |
569 | * Populate $this->limit |
570 | * |
571 | * @param int $namespace |
572 | */ |
573 | private function generateLimit( $namespace ) { |
574 | // T19961: make a title with the longest possible URL in this namespace |
575 | $title = Title::makeTitle( $namespace, str_repeat( "\u{28B81}", 63 ) . "\u{5583}" ); |
576 | |
577 | $this->limit = [ |
578 | strlen( $this->openFile() ), |
579 | strlen( $this->fileEntry( |
580 | $title->getCanonicalURL(), |
581 | wfTimestamp( TS_ISO_8601, wfTimestamp() ), |
582 | $this->priority( $namespace ) |
583 | ) ), |
584 | strlen( $this->closeFile() ) |
585 | ]; |
586 | } |
587 | } |
588 | |
589 | // @codeCoverageIgnoreStart |
590 | $maintClass = GenerateSitemap::class; |
591 | require_once RUN_MAINTENANCE_IF_MAIN; |
592 | // @codeCoverageIgnoreEnd |