private $mSiteInfoCallback, $mTargetNamespace, $mPageOutCallback;
private $mDebug;
private $mImportUploads, $mImageBasePath;
+ private $mNoUpdates = false;
/**
* Creates an ImportXMLReader drawing from the source provided
function setDebug( $debug ) {
$this->mDebug = $debug;
}
+
+ /**
+ * Set 'no updates' mode. In this mode, the link tables will not be updated by the importer
+ */
+ function setNoUpdates( $noupdates ) {
+ $this->mNoUpdates = $noupdates;
+ }
/**
* Sets the action to perform as each new page in the stream is reached.
$revision->setTimestamp( $logInfo['timestamp'] );
$revision->setParams( $logInfo['params'] );
$revision->setTitle( Title::newFromText( $logInfo['logtitle'] ) );
+ $revision->setNoUpdates( $this->mNoUpdates );
if ( isset( $logInfo['comment'] ) ) {
$revision->setComment( $logInfo['comment'] );
if ( isset( $revisionInfo['contributor']['username'] ) ) {
$revision->setUserName( $revisionInfo['contributor']['username'] );
}
+ $revision->setNoUpdates( $this->mNoUpdates );
return $this->revisionCallback( $revision );
}
if ( isset( $uploadInfo['contributor']['username'] ) ) {
$revision->setUserName( $uploadInfo['contributor']['username'] );
}
+ $revision->setNoUpdates( $this->mNoUpdates );
return call_user_func( $this->mUploadCallback, $revision );
}
var $sha1base36 = false;
var $isTemp = false;
var $archiveName = '';
+ private $mNoUpdates = false;
function setTitle( $title ) {
if( is_object( $title ) ) {
function setParams( $params ) {
$this->params = $params;
}
+
+ public function setNoUpdates( $noupdates ) {
+ $this->mNoUpdates = $noupdates;
+ }
/**
* @return Title
$revision->insertOn( $dbw );
$changed = $article->updateIfNewerOn( $dbw, $revision );
- if ( $changed !== false ) {
+ if ( $changed !== false && !$this->mNoUpdates ) {
wfDebug( __METHOD__ . ": running updates\n" );
+ throw new MWException("BROKEN: calling doEditUpdates()");
$article->doEditUpdates( $revision, $userObj, array( 'created' => $created, 'oldcountable' => $oldcountable ) );
}
$this->addOption( 'dry-run', 'Parse dump without actually importing pages' );
$this->addOption( 'debug', 'Output extra verbose debug information' );
$this->addOption( 'uploads', 'Process file upload data if included (experimental)' );
+ $this->addOption( 'no-updates', 'Disable link table updates. Is faster but leaves the wiki in an inconsistent state' );
$this->addOption( 'image-base-path', 'Import files from a specified path', false, true );
$this->addArg( 'file', 'Dump file to import [else use stdin]', false );
}
if( $this->hasOption( 'debug' ) ) {
$importer->setDebug( true );
}
+ if ( $this->hasOption( 'no-updates' ) ) {
+ $importer->setNoUpdates( true );
+ }
$importer->setPageCallback( array( &$this, 'reportPage' ) );
$this->importCallback = $importer->setRevisionCallback(
array( &$this, 'handleRevision' ) );