Merge "Revert "Don't check namespace in SpecialWantedtemplates""
[lhc/web/wiklou.git] / includes / diff / DifferenceEngine.php
index c138eec..93f0f6c 100644 (file)
@@ -388,7 +388,8 @@ class DifferenceEngine extends ContextSource {
                $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 ) {
@@ -487,8 +488,7 @@ class DifferenceEngine extends ContextSource {
                                                'rc_this_oldid' => $this->mNewid,
                                                'rc_patrolled' => 0
                                        ),
-                                       __METHOD__,
-                                       array( 'USE INDEX' => 'rc_timestamp' )
+                                       __METHOD__
                                );
 
                                if ( $change && !$change->getPerformer()->equals( $user ) ) {
@@ -681,7 +681,6 @@ class DifferenceEngine extends ContextSource {
         * @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() ) {
@@ -703,12 +702,13 @@ class DifferenceEngine extends ContextSource {
                }
                // 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 );
@@ -732,7 +732,7 @@ class DifferenceEngine extends ContextSource {
                        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' );
                }