r9098 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r9097‎ | r9098 | r9099 >
Date:14:46, 18 May 2005
Author:vibber
Status:old
Tags:
Comment:
Run link tables updates on applied edits.
Image table still needs to be dealt with more or less properly for uploads...
Modified paths:
  • /trunk/extensions/OAI/OAIHarvest.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OAI/OAIHarvest.php
@@ -39,6 +39,7 @@
4040
4141 # Need shared code...
4242 require_once( 'OAIRepo.php' );
 43+require_once( 'maintenance/refreshLinks.inc' );
4344
4445 global $oaiSourceRepository;
4546 global $oaiAgentExtra;
@@ -386,19 +387,43 @@
387388 $fname );
388389 }
389390 $dbw->commit();
 391+
 392+ fixLinksFromArticle( $id );
 393+
390394 return true;
391395 }
392396
393397 function doDelete() {
 398+ $fname = 'OAIUpdateRecord::doDelete';
394399 $id = $this->getArticleId();
395400
396401 echo "DELETING\n";
397402
 403+ /*
398404 $dbw =& wfGetDB( DB_WRITE );
399405 $dbw->begin();
400406 $dbw->delete( 'cur', array( 'cur_id' => $id ), $fname );
401407 $dbw->commit();
402 -
 408+ */
 409+ $dbw =& wfGetDB( DB_WRITE );
 410+ $dbw->begin();
 411+ $title = Title::newFromId( $id );
 412+ if( is_null( $title ) ) {
 413+ $dbw->commit();
 414+ return new OAIError( "Failed to delete article id $id" );
 415+ } else {
 416+ $article = new Article( $title );
 417+ $article->doDeleteArticle( '(deleted via OAI updater)' );
 418+
 419+ global $wgDeferredUpdateList, $wgPostCommitUpdateList;
 420+ while( $up = array_shift( $wgDeferredUpdateList ) ) {
 421+ $up->doUpdate();
 422+ }
 423+ $dbw->commit();
 424+ while( $up = array_shift( $wgPostCommitUpdateList ) ) {
 425+ $up->doUpdate();
 426+ }
 427+ }
403428 return true;
404429 }
405430

Status & tagging log