From: Kunal Mehta Date: Tue, 23 May 2017 22:08:25 +0000 (-0700) Subject: FileCacheBase: Avoid deprecated wfMemcKey() X-Git-Tag: 1.31.0-rc.0~3164 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=3e896060b50db2ed1b42673f4180827f14857aef;p=lhc%2Fweb%2Fwiklou.git FileCacheBase: Avoid deprecated wfMemcKey() Change-Id: I5476bf45deb55ef4ff158970102b1ce17d3fee29 --- diff --git a/includes/cache/FileCacheBase.php b/includes/cache/FileCacheBase.php index 0a302b6ec1..f2da08a394 100644 --- a/includes/cache/FileCacheBase.php +++ b/includes/cache/FileCacheBase.php @@ -242,14 +242,14 @@ abstract class FileCacheBase { : IP::sanitizeRange( "$ip/16" ); # Bail out if a request already came from this range... - $key = wfMemcKey( static::class, 'attempt', $this->mType, $this->mKey, $ip ); + $key = $cache->makeKey( static::class, 'attempt', $this->mType, $this->mKey, $ip ); if ( $cache->get( $key ) ) { return; // possibly the same user } $cache->set( $key, 1, self::MISS_TTL_SEC ); # Increment the number of cache misses... - $key = $this->cacheMissKey(); + $key = $this->cacheMissKey( $cache ); if ( $cache->get( $key ) === false ) { $cache->set( $key, 1, self::MISS_TTL_SEC ); } else { @@ -265,13 +265,14 @@ abstract class FileCacheBase { public function getMissesRecent() { $cache = ObjectCache::getLocalClusterInstance(); - return self::MISS_FACTOR * $cache->get( $this->cacheMissKey() ); + return self::MISS_FACTOR * $cache->get( $this->cacheMissKey( $cache ) ); } /** + * @param BagOStuff $cache Instance that the key will be used with * @return string */ - protected function cacheMissKey() { - return wfMemcKey( static::class, 'misses', $this->mType, $this->mKey ); + protected function cacheMissKey( BagOStuff $cache ) { + return $cache->makeKey( static::class, 'misses', $this->mType, $this->mKey ); } }