* @throws UnexpectedValueException
*/
public static function newWANCacheFromParams( array $params ) {
- global $wgCommandLineMode;
+ global $wgCommandLineMode, $wgSecretKey;
$services = MediaWikiServices::getInstance();
$params['cache'] = self::newFromParams( $params['store'] );
// 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 );
* @deprecated Since 1.28 Use MediaWikiServices::getInstance()->getMainWANObjectCache()
*/
public static function getMainWANInstance() {
+ wfDeprecated( __METHOD__, '1.28' );
return MediaWikiServices::getInstance()->getMainWANObjectCache();
}