Replace deprecated Language function in generateSitemap.php script
Bug: T252095 Change-Id: Id93ecdd9e60413faf9408092ad11842c9b91b042
This commit is contained in:
parent
c0a326408d
commit
38460cc839
1 changed files with 5 additions and 3 deletions
|
|
@ -334,7 +334,9 @@ class GenerateSitemap extends Maintenance {
|
|||
* Main loop
|
||||
*/
|
||||
public function main() {
|
||||
$contLang = MediaWikiServices::getInstance()->getContentLanguage();
|
||||
$services = MediaWikiServices::getInstance();
|
||||
$contLang = $services->getContentLanguage();
|
||||
$langConverter = $services->getLanguageConverterFactory()->getLanguageConverter( $contLang );
|
||||
|
||||
fwrite( $this->findex, $this->openIndex() );
|
||||
|
||||
|
|
@ -382,8 +384,8 @@ class GenerateSitemap extends Maintenance {
|
|||
$length += strlen( $entry );
|
||||
$this->write( $this->file, $entry );
|
||||
// generate pages for language variants
|
||||
if ( $contLang->hasVariants() ) {
|
||||
$variants = $contLang->getVariants();
|
||||
if ( $langConverter->hasVariants() ) {
|
||||
$variants = $langConverter->getVariants();
|
||||
foreach ( $variants as $vCode ) {
|
||||
if ( $vCode == $contLang->getCode() ) {
|
||||
continue; // we don't want default variant
|
||||
|
|
|
|||
Loading…
Reference in a new issue