Merge "Add 3D filetype for STL files"
[lhc/web/wiklou.git] / includes / cache / BacklinkCache.php
index 0a07a93..3ee6330 100644 (file)
@@ -28,6 +28,7 @@
 
 use Wikimedia\Rdbms\ResultWrapper;
 use Wikimedia\Rdbms\FakeResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * Class for fetching backlink lists, approximate backlink counts and
@@ -142,7 +143,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 +339,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 +397,7 @@ class BacklinkCache {
                        return $cacheEntry['batches'];
                }
 
-               $memcKey = wfMemcKey(
+               $memcKey = $cache->makeKey(
                        'backlinks',
                        md5( $this->title->getPrefixedDBkey() ),
                        $table,
@@ -435,7 +440,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" );