* @return BagOStuff
* @throws InvalidArgumentException
*/
- public static function newFromId( $id ) {
+ private static function newFromId( $id ) {
global $wgObjectCaches;
if ( !isset( $wgObjectCaches[$id] ) ) {
*
* @return string
*/
- public static function getDefaultKeyspace() {
+ private static function getDefaultKeyspace() {
global $wgCachePrefix;
$keyspace = $wgCachePrefix;
} 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
* @return WANObjectCache
* @throws UnexpectedValueException
*/
- public static function newWANCacheFromId( $id ) {
+ private static function newWANCacheFromId( $id ) {
global $wgWANObjectCaches, $wgObjectCaches;
if ( !isset( $wgWANObjectCaches[$id] ) ) {
* @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();
}