.gitignore: Exclude Extension:Score generated files
[lhc/web/wiklou.git] / maintenance / importDump.php
index cf0e7d8..b6bbc2a 100644 (file)
@@ -82,6 +82,12 @@ 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( 'no-local-users',
+                       'Treat all usernames as interwiki. ' .
+                       'The default is to assign edits to local users where they exist.',
+                       false, false
+               );
                $this->addArg( 'file', 'Dump file to import [else use stdin]', false );
        }
 
@@ -295,6 +301,12 @@ TEXT
                if ( $this->hasOption( 'no-updates' ) ) {
                        $importer->setNoUpdates( true );
                }
+               if ( $this->hasOption( 'username-prefix' ) ) {
+                       $importer->setUsernamePrefix(
+                               $this->getOption( 'username-prefix' ),
+                               !$this->hasOption( 'no-local-users' )
+                       );
+               }
                if ( $this->hasOption( 'rootpage' ) ) {
                        $statusRootPage = $importer->setTargetRootPage( $this->getOption( 'rootpage' ) );
                        if ( !$statusRootPage->isGood() ) {