Merge "clone keyword must not be used as a function"
[lhc/web/wiklou.git] / includes / cache / BacklinkCache.php
index 0a07a93..11f3c2b 100644 (file)
@@ -20,7 +20,6 @@
  *
  * @file
  * @author Tim Starling
- * @author Aaron Schulz
  * @copyright © 2009, Tim Starling, Domas Mituzas
  * @copyright © 2010, Max Sem
  * @copyright © 2011, Antoine Musso
@@ -28,6 +27,7 @@
 
 use Wikimedia\Rdbms\ResultWrapper;
 use Wikimedia\Rdbms\FakeResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * Class for fetching backlink lists, approximate backlink counts and
@@ -142,7 +142,7 @@ class BacklinkCache {
        /**
         * Get the replica DB connection to the database
         * When non existing, will initialize the connection.
-        * @return Database
+        * @return IDatabase
         */
        protected function getDB() {
                if ( !isset( $this->db ) ) {
@@ -338,7 +338,11 @@ class BacklinkCache {
                        return min( $max, $this->fullResultCache[$table]->numRows() );
                }
 
-               $memcKey = wfMemcKey( 'numbacklinks', md5( $this->title->getPrefixedDBkey() ), $table );
+               $memcKey = $cache->makeKey(
+                       'numbacklinks',
+                       md5( $this->title->getPrefixedDBkey() ),
+                       $table
+               );
 
                // 3) ... fallback to memcached ...
                $count = $cache->get( $memcKey );
@@ -392,7 +396,7 @@ class BacklinkCache {
                        return $cacheEntry['batches'];
                }
 
-               $memcKey = wfMemcKey(
+               $memcKey = $cache->makeKey(
                        'backlinks',
                        md5( $this->title->getPrefixedDBkey() ),
                        $table,
@@ -435,7 +439,11 @@ class BacklinkCache {
                $cache->set( $memcKey, $cacheEntry, self::CACHE_EXPIRY );
 
                // Save backlink count to memcached
-               $memcKey = wfMemcKey( 'numbacklinks', md5( $this->title->getPrefixedDBkey() ), $table );
+               $memcKey = $cache->makeKey(
+                       'numbacklinks',
+                       md5( $this->title->getPrefixedDBkey() ),
+                       $table
+               );
                $cache->set( $memcKey, $cacheEntry['numRows'], self::CACHE_EXPIRY );
 
                wfDebug( __METHOD__ . ": got from database\n" );