X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fcache%2FFileCacheBase.php;h=f2da08a3947f57e881bedfd0fc0967450a8e27cf;hb=36f4daf32c591d6b7e2435629fc6e431398b641a;hp=6d5f8c3e55a5c08a59c4c5e8e441f7eb08ed43af;hpb=12846c08cb7f721011952da0aebb95657d7d030c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/cache/FileCacheBase.php b/includes/cache/FileCacheBase.php index 6d5f8c3e55..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( get_class( $this ), '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( get_class( $this ), 'misses', $this->mType, $this->mKey ); + protected function cacheMissKey( BagOStuff $cache ) { + return $cache->makeKey( static::class, 'misses', $this->mType, $this->mKey ); } }