Merge "Fix option name in maintenance/importDump.php"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 4 Oct 2018 01:29:14 +0000 (01:29 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 4 Oct 2018 01:29:14 +0000 (01:29 +0000)
1  2 
maintenance/importDump.php

@@@ -24,8 -24,6 +24,8 @@@
   * @ingroup Maintenance
   */
  
 +use MediaWiki\MediaWikiServices;
 +
  require_once __DIR__ . '/Maintenance.php';
  
  /**
@@@ -84,7 -82,7 +84,7 @@@ TEX
                );
                $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.',
        }
  
        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" );