X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FimportDump.php;h=7c20748c51a59d1273e52ad58968d8f09a113d51;hb=ee09b046fcaee31574e9179153ff44383f008a78;hp=965906f2292a1395e529cc8d271f4af5316c5466;hpb=9a6b2a4fffb82840d0bf780eb4ecb873ad64fa54;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/importDump.php b/maintenance/importDump.php index 965906f229..7c20748c51 100644 --- a/maintenance/importDump.php +++ b/maintenance/importDump.php @@ -24,6 +24,8 @@ * @ingroup Maintenance */ +use MediaWiki\MediaWikiServices; + require_once __DIR__ . '/Maintenance.php'; /** @@ -82,7 +84,7 @@ TEXT ); $this->addOption( 'image-base-path', 'Import files from a specified path', false, true ); $this->addOption( 'skip-to', 'Start from nth page by skipping first n-1 pages', false, true ); - $this->addOption( 'username-interwiki', 'Use interwiki usernames with this prefix', false, true ); + $this->addOption( 'username-prefix', 'Prefix for interwiki usernames', false, true ); $this->addOption( 'no-local-users', 'Treat all usernames as interwiki. ' . 'The default is to assign edits to local users where they exist.', @@ -131,13 +133,13 @@ TEXT } private function getNsIndex( $namespace ) { - global $wgContLang; - $result = $wgContLang->getNsIndex( $namespace ); + $contLang = MediaWikiServices::getInstance()->getContentLanguage(); + $result = $contLang->getNsIndex( $namespace ); if ( $result !== false ) { return $result; } $ns = intval( $namespace ); - if ( strval( $ns ) === $namespace && $wgContLang->getNsText( $ns ) !== false ) { + if ( strval( $ns ) === $namespace && $contLang->getNsText( $ns ) !== false ) { return $ns; } $this->fatalError( "Unknown namespace text / index specified: $namespace" );