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