$rdel = $this->revisionDeleteLink( $this->mNewRev );
# Allow extensions to define their own revision tools
- Hooks::run( 'DiffRevisionTools', array( $this->mNewRev, &$revisionTools, $this->mOldRev ) );
+ Hooks::run( 'DiffRevisionTools',
+ array( $this->mNewRev, &$revisionTools, $this->mOldRev, $user ) );
$formattedRevisionTools = array();
// Put each one in parentheses (poor man's button)
foreach ( $revisionTools as $key => $tool ) {
'rc_this_oldid' => $this->mNewid,
'rc_patrolled' => 0
),
- __METHOD__,
- array( 'USE INDEX' => 'rc_timestamp' )
+ __METHOD__
);
if ( $change && !$change->getPerformer()->equals( $user ) ) {
* @return mixed (string/false)
*/
public function getDiffBody() {
- global $wgMemc;
$this->mCacheHit = true;
// Check if the diff should be hidden from this user
if ( !$this->loadRevisionData() ) {
}
// Cacheable?
$key = false;
+ $cache = ObjectCache::getMainWANInstance();
if ( $this->mOldid && $this->mNewid ) {
$key = $this->getDiffBodyCacheKey();
// Try cache
if ( !$this->mRefreshCache ) {
- $difftext = $wgMemc->get( $key );
+ $difftext = $cache->get( $key );
if ( $difftext ) {
wfIncrStats( 'diff_cache.hit' );
$difftext = $this->localiseLineNumbers( $difftext );
wfIncrStats( 'diff_cache.uncacheable' );
} elseif ( $key !== false && $difftext !== false ) {
wfIncrStats( 'diff_cache.miss' );
- $wgMemc->set( $key, $difftext, 7 * 86400 );
+ $cache->set( $key, $difftext, 7 * 86400 );
} else {
wfIncrStats( 'diff_cache.uncacheable' );
}