Add ability to override mb_strtoupper in Language::ucfirst
[lhc/web/wiklou.git] / maintenance / importDump.php
index f30fbb5..c2c5ccf 100644 (file)
@@ -24,6 +24,8 @@
  * @ingroup Maintenance
  */
 
+use MediaWiki\MediaWikiServices;
+
 require_once __DIR__ . '/Maintenance.php';
 
 /**
@@ -110,8 +112,8 @@ TEXT
                        $this->setNsfilter( explode( '|', $this->getOption( 'namespaces' ) ) );
                }
 
-               if ( $this->hasArg() ) {
-                       $this->importFromFile( $this->getArg() );
+               if ( $this->hasArg( 0 ) ) {
+                       $this->importFromFile( $this->getArg( 0 ) );
                } else {
                        $this->importFromStdin();
                }
@@ -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" );