X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fcache%2FCacheHelper.php;h=d1261a807624d648ca5b007fc96303bf91fe062a;hb=4051970d03686d0f05516659a35733cd5325eb37;hp=ec6ce040006080b849a16306c712d1cdaab58dbd;hpb=1ae3ebe82482b9244d1d9078cc36702116133f84;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/cache/CacheHelper.php b/includes/cache/CacheHelper.php index ec6ce04000..d1261a8076 100644 --- a/includes/cache/CacheHelper.php +++ b/includes/cache/CacheHelper.php @@ -82,9 +82,9 @@ class CacheHelper implements ICacheHelper { * Function that gets called when initialization is done. * * @since 1.20 - * @var callable + * @var callable|null */ - protected $onInitHandler = false; + protected $onInitHandler; /** * Elements to build a cache key with. @@ -183,7 +183,7 @@ class CacheHelper implements ICacheHelper { $this->hasCached = is_array( $cachedChunks ); $this->cachedChunks = $this->hasCached ? $cachedChunks : []; - if ( $this->onInitHandler !== false ) { + if ( $this->onInitHandler !== null ) { call_user_func( $this->onInitHandler, $this->hasCached ); } } @@ -288,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 ) + ); } /**