X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fobjectcache%2FObjectCache.php;h=3bb077173f3b1a85b0cda25f24cd3e0be771f0aa;hb=31dfe22853bf9ccd0d4e8f6d29ec9148e63fb980;hp=82b760a72bcd51d5bba99084d3459b0f8f60dade;hpb=ac16588afe6b6067f2507b11f1025c0c339baab8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/objectcache/ObjectCache.php b/includes/objectcache/ObjectCache.php index 82b760a72b..3bb077173f 100644 --- a/includes/objectcache/ObjectCache.php +++ b/includes/objectcache/ObjectCache.php @@ -178,7 +178,8 @@ class ObjectCache { } elseif ( isset( $params['class'] ) ) { $class = $params['class']; // Automatically set the 'async' update handler - $params['asyncHandler'] = $params['asyncHandler'] ?? 'DeferredUpdates::addCallableUpdate'; + $params['asyncHandler'] = $params['asyncHandler'] + ?? [ DeferredUpdates::class, 'addCallableUpdate' ]; // Enable reportDupes by default $params['reportDupes'] = $params['reportDupes'] ?? true; // Do b/c logic for SqlBagOStuff @@ -323,7 +324,7 @@ class ObjectCache { * @throws UnexpectedValueException */ public static function newWANCacheFromParams( array $params ) { - global $wgCommandLineMode; + global $wgCommandLineMode, $wgSecretKey; $services = MediaWikiServices::getInstance(); $params['cache'] = self::newFromParams( $params['store'] ); @@ -334,6 +335,7 @@ class ObjectCache { // Let pre-emptive refreshes happen post-send on HTTP requests $params['asyncHandler'] = [ DeferredUpdates::class, 'addCallableUpdate' ]; } + $params['secret'] = $params['secret'] ?? $wgSecretKey; $class = $params['class']; return new $class( $params ); @@ -359,6 +361,7 @@ class ObjectCache { * @deprecated Since 1.28 Use MediaWikiServices::getInstance()->getMainWANObjectCache() */ public static function getMainWANInstance() { + wfDeprecated( __METHOD__, '1.28' ); return MediaWikiServices::getInstance()->getMainWANObjectCache(); }