r78288 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78287‎ | r78288 | r78289 >
Date:00:28, 13 December 2010
Author:yaron
Status:deferred
Tags:
Comment:
Added new 'for_pages_that_exist' parameter
Modified paths:
  • /trunk/extensions/DataTransfer/includes/DT_ImportJob.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DataTransfer/includes/DT_ImportJob.php
@@ -30,6 +30,10 @@
3131 wfProfileOut( __METHOD__ );
3232 return false;
3333 }
 34+ $for_pages_that_exist = $this->params['for_pages_that_exist'];
 35+ if ( $for_pages_that_exist == 'skip' && $this->title->exists() ) {
 36+ return true;
 37+ }
3438
3539 // change global $wgUser variable to the one specified by
3640 // the job only for the extent of this import
@@ -37,6 +41,9 @@
3842 $actual_user = $wgUser;
3943 $wgUser = User::newFromId( $this->params['user_id'] );
4044 $text = $this->params['text'];
 45+ if ( $for_pages_that_exist == 'append' ) {
 46+ $text = $article->getContent() . "\n" . $text;
 47+ }
4148 $edit_summary = $this->params['edit_summary'];
4249 $article->doEdit( $text, $edit_summary );
4350 $wgUser = $actual_user;
@@ -44,4 +51,3 @@
4552 return true;
4653 }
4754 }
48 -

Status & tagging log