r88834 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88833‎ | r88834 | r88835 >
Date:20:42, 25 May 2011
Author:aaron
Status:resolved
Tags:
Comment:
* Cache inclusion versions via onArticleEditUpdates hook
* Added ORDER BY pending-since timestamp to cachePendingRevs.php
Modified paths:
  • /trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/maintenance/cachePendingRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/maintenance/cachePendingRevs.php
@@ -30,7 +30,8 @@
3131 'rev_page = fp_page_id',
3232 'rev_timestamp >= fp_pending_since'
3333 ),
34 - __METHOD__
 34+ __METHOD__,
 35+ array( 'ORDER BY' => 'fp_pending_since DESC' )
3536 );
3637 foreach ( $ret as $row ) {
3738 $title = Title::newFromRow( $row );
Index: trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.hooks.php
@@ -91,8 +91,8 @@
9292 * (b) Pages with stable versions that use this page will be purged
9393 * Note: pages with current versions that use this page should already be purged
9494 */
95 - public static function onArticleEditUpdates( Article $article ) {
96 - FlaggedRevs::stableVersionUpdates( $article->getTitle() );
 95+ public static function onArticleEditUpdates( Article $article, $editInfo ) {
 96+ FlaggedRevs::stableVersionUpdates( $article->getTitle(), null, null, $editInfo );
9797 FlaggedRevs::extraHTMLCacheUpdate( $article->getTitle() );
9898 return true;
9999 }
Index: trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.class.php
@@ -582,9 +582,12 @@
583583 * @param Title $title
584584 * @param FlaggedRevision|null $sv, the new stable version (optional)
585585 * @param FlaggedRevision|null $oldSv, the old stable version (optional)
 586+ * @param Object editInfo Article edit info about the current revision (optional)
586587 * @return bool stable version text/file changed and FR_INCLUDES_STABLE
587588 */
588 - public static function stableVersionUpdates( Title $title, $sv = null, $oldSv = null ) {
 589+ public static function stableVersionUpdates(
 590+ Title $title, $sv = null, $oldSv = null, $editInfo = null
 591+ ) {
589592 $changed = false;
590593 if ( $oldSv === null ) { // optional
591594 $oldSv = FlaggedRevision::newFromStable( $title, FR_MASTER );
@@ -602,7 +605,7 @@
603606 }
604607 } else {
605608 # Update flagged page related fields
606 - $article->updateStableVersion( $sv );
 609+ $article->updateStableVersion( $sv, $editInfo ? $editInfo->revid : null );
607610 # Check if pages using this need to be invalidated/purged...
608611 if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_STABLE ) {
609612 $changed = (
@@ -612,6 +615,10 @@
613616 $sv->getFileSha1() != $oldSv->getFileSha1()
614617 );
615618 }
 619+ # Update template/file version cache...
 620+ if ( $sv->getRevId() != $editInfo->revid ) {
 621+ RevisionReviewForm::setRevIncludes( $title, $editInfo->revid, $editInfo->output );
 622+ }
616623 }
617624 # Lazily rebuild dependancies on next parse (we invalidate below)
618625 FlaggedRevs::clearStableOnlyDeps( $title );

Follow-up revisions

RevisionCommit summaryAuthorDate
r88835Missing change for r88834: sighaaron20:43, 25 May 2011
r90023Fixed notice when $editInfo is null (fix for r88834)aaron00:18, 14 June 2011

Status & tagging log