r88835 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88834‎ | r88835 | r88836 >
Date:20:43, 25 May 2011
Author:aaron
Status:ok
Tags:
Comment:
Missing change for r88834: sigh
Modified paths:
  • /trunk/extensions/FlaggedRevs/business/RevisionReviewForm.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/business/RevisionReviewForm.php
@@ -577,7 +577,7 @@
578578 }
579579
580580 /**
581 - * Get template and image versions from parsing a revision.
 581+ * Get template and image versions from parsing a revision
582582 * @param Article $article
583583 * @param Revision $rev
584584 * @param User $user
@@ -593,9 +593,8 @@
594594 wfProfileIn( __METHOD__ );
595595 $versions = false;
596596 $hash = md5( $article->getTitle()->getPrefixedDBkey() );
597 - # Check process cache first...
598597 $key = wfMemcKey( 'flaggedrevs', 'revIncludes', $rev->getId(), $hash );
599 - if ( $regen !== 'regen' ) {
 598+ if ( $regen !== 'regen' ) { // check cache
600599 $versions = FlaggedRevs::getMemcValue( $wgMemc->get( $key ), $article, 'allowStale' );
601600 }
602601 if ( !is_array( $versions ) ) { // cache miss
@@ -645,4 +644,22 @@
646645 wfProfileOut( __METHOD__ );
647646 return $versions;
648647 }
 648+
 649+ /**
 650+ * Set template and image versions from parsing a revision
 651+ * @param Title $title
 652+ * @param int $revId
 653+ * @param ParserOutput $rev
 654+ * @return void
 655+ */
 656+ public static function setRevIncludes( Title $title, $revId, ParserOutput $pOut ) {
 657+ global $wgMemc;
 658+ $hash = md5( $title->getPrefixedDBkey() );
 659+ $key = wfMemcKey( 'flaggedrevs', 'revIncludes', $revId, $hash );
 660+ # Get the template/file versions used...
 661+ $versions = array( $pOut->getTemplateIds(), $pOut->getImageTimeKeys() );
 662+ # Save to cache...
 663+ $data = FlaggedRevs::makeMemcObj( $versions );
 664+ $wgMemc->set( $key, $data, 24*3600 ); // inclusions may be dynamic
 665+ }
649666 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r88834* Cache inclusion versions via onArticleEditUpdates hook...aaron20:42, 25 May 2011

Status & tagging log