https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112683

Revision: 112683
Author:   nikerabbit
Date:     2012-02-29 13:28:38 +0000 (Wed, 29 Feb 2012)
Log Message:
-----------
Don't rely on wgMemc being a real cache

Modified Paths:
--------------
    trunk/extensions/Translate/tag/TranslatablePage.php

Modified: trunk/extensions/Translate/tag/TranslatablePage.php
===================================================================
--- trunk/extensions/Translate/tag/TranslatablePage.php 2012-02-29 13:02:46 UTC 
(rev 112682)
+++ trunk/extensions/Translate/tag/TranslatablePage.php 2012-02-29 13:28:38 UTC 
(rev 112683)
@@ -617,15 +617,15 @@
        }
 
        public function getTranslationPercentages( $force = false ) {
-               // Check the memory cache, as this is very slow to calculate
-               global $wgMemc, $wgRequest;
+               global $wgRequest;
 
+               // Check the cache, as this is relatively slow to calculate
                $memcKey = wfMemcKey( 'pt', 'status', 
$this->getTitle()->getPrefixedText() );
-               $cache = $wgMemc->get( $memcKey );
+               $cached = wfGetCache( CACHE_ANYTHING )->get( $memcKey );
 
                $force = $force || $wgRequest->getText( 'action' ) === 'purge';
-               if ( !$force && is_array( $cache ) ) {
-                       return $cache;
+               if ( !$force && is_array( $cached ) ) {
+                       return $cached;
                }
 
                $titles = $this->getTranslationPages();
@@ -653,7 +653,7 @@
 
                $temp[$wgContLang->getCode()] = 1.00;
 
-               $wgMemc->set( $memcKey, $temp, 60 * 60 * 12 );
+               wfGetCache( CACHE_ANYTHING )->set( $memcKey, $temp, 60 * 60 * 
12 );
 
                return $temp;
        }


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to