X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fobjectcache%2FObjectCache.php;h=3bb077173f3b1a85b0cda25f24cd3e0be771f0aa;hb=31dfe22853bf9ccd0d4e8f6d29ec9148e63fb980;hp=21948efd75e0e4e7b1a1de9624eb7fe6d08aeaea;hpb=5476aa9bea95310bcd48165cf9b8871de885afa7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/objectcache/ObjectCache.php b/includes/objectcache/ObjectCache.php index 21948efd75..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 );