dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "RCFilters: Override frameless button opacity to show real highlight color"
[lhc/web/wiklou.git]
/
maintenance
/
generateSitemap.php
diff --git
a/maintenance/generateSitemap.php
b/maintenance/generateSitemap.php
index
ff3e2fc
..
dc1de4f
100644
(file)
--- a/
maintenance/generateSitemap.php
+++ b/
maintenance/generateSitemap.php
@@
-26,6
+26,8
@@
* @see http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
*/
* @see http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
*/
+use MediaWiki\MediaWikiServices;
+
require_once __DIR__ . '/Maintenance.php';
/**
require_once __DIR__ . '/Maintenance.php';
/**
@@
-316,7
+318,7
@@
class GenerateSitemap extends Maintenance {
* Main loop
*/
public function main() {
* Main loop
*/
public function main() {
-
global $wgContLang
;
+
$contLang = MediaWikiServices::getInstance()->getContentLanguage()
;
fwrite( $this->findex, $this->openIndex() );
fwrite( $this->findex, $this->openIndex() );
@@
-327,7
+329,7
@@
class GenerateSitemap extends Maintenance {
$length = $this->limit[0];
$i = $smcount = 0;
$length = $this->limit[0];
$i = $smcount = 0;
- $fns = $
wgC
ontLang->getFormattedNsText( $namespace );
+ $fns = $
c
ontLang->getFormattedNsText( $namespace );
$this->output( "$namespace ($fns)\n" );
$skippedRedirects = 0; // Number of redirects skipped for that namespace
foreach ( $res as $row ) {
$this->output( "$namespace ($fns)\n" );
$skippedRedirects = 0; // Number of redirects skipped for that namespace
foreach ( $res as $row ) {
@@
-358,10
+360,10
@@
class GenerateSitemap extends Maintenance {
$length += strlen( $entry );
$this->write( $this->file, $entry );
// generate pages for language variants
$length += strlen( $entry );
$this->write( $this->file, $entry );
// generate pages for language variants
- if ( $
wgC
ontLang->hasVariants() ) {
- $variants = $
wgC
ontLang->getVariants();
+ if ( $
c
ontLang->hasVariants() ) {
+ $variants = $
c
ontLang->getVariants();
foreach ( $variants as $vCode ) {
foreach ( $variants as $vCode ) {
- if ( $vCode == $
wgC
ontLang->getCode() ) {
+ if ( $vCode == $
c
ontLang->getCode() ) {
continue; // we don't want default variant
}
$entry = $this->fileEntry(
continue; // we don't want default variant
}
$entry = $this->fileEntry(
@@
-483,7
+485,9
@@
class GenerateSitemap extends Maintenance {
*/
function indexEntry( $filename ) {
return "\t<sitemap>\n" .
*/
function indexEntry( $filename ) {
return "\t<sitemap>\n" .
- "\t\t<loc>{$this->urlpath}$filename</loc>\n" .
+ "\t\t<loc>" . wfGetServerUrl( PROTO_CANONICAL ) .
+ ( substr( $this->urlpath, 0, 1 ) === "/" ? "" : "/" ) .
+ "{$this->urlpath}$filename</loc>\n" .
"\t\t<lastmod>{$this->timestamp}</lastmod>\n" .
"\t</sitemap>\n";
}
"\t\t<lastmod>{$this->timestamp}</lastmod>\n" .
"\t</sitemap>\n";
}