X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fcache%2FCacheHelper.php;h=d798ddbcb3de2cf2d27c7b98ba7db1da4b5bf8bc;hb=a76cc0bf39163cd3b5b3ca8145a3502b385d859e;hp=d7669eb1b9e580e222defc5818c1d9b33dcd5066;hpb=1c851623b0c82a80ed368462a0711ab30fffb0c6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/cache/CacheHelper.php b/includes/cache/CacheHelper.php index d7669eb1b9..d798ddbcb3 100644 --- a/includes/cache/CacheHelper.php +++ b/includes/cache/CacheHelper.php @@ -221,13 +221,11 @@ class CacheHelper implements ICacheHelper { } else { $value = array_shift( $this->cachedChunks ); } + } elseif ( array_key_exists( $key, $this->cachedChunks ) ) { + $value = $this->cachedChunks[$key]; + unset( $this->cachedChunks[$key] ); } else { - if ( array_key_exists( $key, $this->cachedChunks ) ) { - $value = $this->cachedChunks[$key]; - unset( $this->cachedChunks[$key] ); - } else { - wfWarn( "There is no item with key '$key' in this->cachedChunks in " . __METHOD__ ); - } + wfWarn( "There is no item with key '$key' in this->cachedChunks in " . __METHOD__ ); } } else { if ( !is_array( $args ) ) { @@ -290,7 +288,9 @@ class CacheHelper implements ICacheHelper { throw new MWException( 'No cache key set, so cannot obtain or save the CacheHelper values.' ); } - return wfMemcKey( ...array_values( $this->cacheKey ) ); + return ObjectCache::getLocalClusterInstance()->makeKey( + ...array_values( $this->cacheKey ) + ); } /**