http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72092

Revision: 72092
Author:   nikerabbit
Date:     2010-09-01 09:14:36 +0000 (Wed, 01 Sep 2010)

Log Message:
-----------
Get rid of direct wgMemc reference

Modified Paths:
--------------
    trunk/extensions/Translate/utils/MemoryCache.php

Modified: trunk/extensions/Translate/utils/MemoryCache.php
===================================================================
--- trunk/extensions/Translate/utils/MemoryCache.php    2010-09-01 09:07:05 UTC 
(rev 72091)
+++ trunk/extensions/Translate/utils/MemoryCache.php    2010-09-01 09:14:36 UTC 
(rev 72092)
@@ -4,7 +4,7 @@
  *
  * @file
  * @author Niklas Laxström
- * @copyright Copyright © 2009, Niklas Laxström
+ * @copyright Copyright © 2009-2010, Niklas Laxström
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
  */
 
@@ -28,9 +28,12 @@
        public function __construct( $table ) {
                $this->key = wfMemcKey( $table );
 
-               global $wgMemc;
+               $cacher = wfGetCache( CACHE_MEMCACHED );
+               if ( $cacher instanceof FakeMemCachedClient ) {
+                       $cacher = wfGetCache( CACHE_DB );
+               }
 
-               $this->memc = $wgMemc;
+               $this->memc = $cacher;
        }
 
        /// Destructor



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

Reply via email to