X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FimportDump.php;h=bf594952c90a0575f00fe4652186c41825eb7d4a;hb=f796dbb59df851dca0d71de72d4a136cd716ece7;hp=1f7cbf5a3dc6f6a90e4ea2145c270344902a23fb;hpb=166191535f486569277e95b7e6a3850b5db6757d;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/importDump.php b/maintenance/importDump.php index 1f7cbf5a3d..bf594952c9 100644 --- a/maintenance/importDump.php +++ b/maintenance/importDump.php @@ -141,8 +141,7 @@ TEXT; } elseif ( $obj instanceof WikiRevision ) { $ns = $obj->title->getNamespace(); } else { - echo wfBacktrace(); - $this->error( "Cannot get namespace of object in " . __METHOD__, true ); + throw new MWException( "Cannot get namespace of object in " . __METHOD__ ); } return is_array( $this->nsFilter ) && !in_array( $ns, $this->nsFilter ); @@ -182,7 +181,7 @@ TEXT; function handleUpload( $revision ) { if ( $this->uploads ) { if ( $this->skippedNamespace( $revision ) ) { - return; + return false; } $this->uploadCount++; // $this->report(); @@ -196,6 +195,8 @@ TEXT; return $dbw->deadlockLoop( array( $revision, 'importUpload' ) ); } } + + return false; } function handleLogItem( $rev ) { @@ -234,8 +235,6 @@ TEXT; } } wfWaitForSlaves(); - // XXX: Don't let deferred jobs array get absurdly large (bug 24375) - DeferredUpdates::doUpdates( 'commit' ); } function progress( $string ) { @@ -269,7 +268,7 @@ TEXT; $this->startTime = microtime( true ); $source = new ImportStreamSource( $handle ); - $importer = new WikiImporter( $source ); + $importer = new WikiImporter( $source, $this->getConfig() ); if ( $this->hasOption( 'debug' ) ) { $importer->setDebug( true );