r43267 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43266‎ | r43267 | r43268 >
Date:21:41, 6 November 2008
Author:ashley
Status:old (Comments)
Tags:
Comment:
adding AbortDiffCache hook to allow canceling the caching of a diff
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/diff/DifferenceEngine.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -238,6 +238,9 @@
239239 $autoblockip: The IP going to be autoblocked.
240240 $block: The block from which the autoblock is coming.
241241
 242+'AbortDiffCache': Can be used to cancel the caching of a diff
 243+&$diffEngine: DifferenceEngine object
 244+
242245 'AbortLogin': Return false to cancel account login.
243246 $user: the User object being authenticated against
244247 $password: the password being submitted, not yet checked for validity
Index: trunk/phase3/includes/diff/DifferenceEngine.php
@@ -546,7 +546,9 @@
547547 $difftext = $this->generateDiffBody( $this->mOldtext, $this->mNewtext );
548548
549549 // Save to cache for 7 days
550 - if ( $key !== false && $difftext !== false ) {
 550+ if ( !wfRunHooks( 'AbortDiffCache', array( &$this ) ) ) {
 551+ wfIncrStats( 'diff_uncacheable' );
 552+ } else if ( $key !== false && $difftext !== false ) {
551553 wfIncrStats( 'diff_cache_miss' );
552554 $wgMemc->set( $key, $difftext, 7*86400 );
553555 } else {
Index: trunk/phase3/RELEASE-NOTES
@@ -196,6 +196,7 @@
197197 * Added the BitmapHandler_ClientOnly media handler, which allows server-side
198198 image scaling to be completely disabled for specific media types, via the
199199 $wgMediaHandlers configuration variable.
 200+* New 'AbortDiffCache' hook can be used to cancel the caching of a diff
200201
201202 === Bug fixes in 1.14 ===
202203

Comments

#Comment by Aaron Schulz (talk | contribs)   22:25, 6 November 2008

What is this for?

Status & tagging log