diff options
author | jenkins-bot <jenkins-bot@gerrit.wikimedia.org> | 2019-10-11 18:24:49 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@wikimedia.org> | 2019-10-11 18:24:49 +0000 |
commit | a93b8e7d0bbab662e62ac21c87e29973ea823365 (patch) | |
tree | 23d8eda40c46abd93e9636c3302b1d48c562194d /includes/objectcache/ObjectCache.php | |
parent | 3440ae000cc324a105e6cb217561caa5c7682425 (diff) | |
parent | 0cfc89dbc322084430b9b47bb7efd5af25795749 (diff) | |
download | mediawikicore-a93b8e7d0bbab662e62ac21c87e29973ea823365.tar.gz mediawikicore-a93b8e7d0bbab662e62ac21c87e29973ea823365.zip |
Merge "objectcache: Remove deprecated WAN-methods in ObjectCache"
Diffstat (limited to 'includes/objectcache/ObjectCache.php')
-rw-r--r-- | includes/objectcache/ObjectCache.php | 78 |
1 files changed, 1 insertions, 77 deletions
diff --git a/includes/objectcache/ObjectCache.php b/includes/objectcache/ObjectCache.php index e0f302bc288a..e2fbd8ae5892 100644 --- a/includes/objectcache/ObjectCache.php +++ b/includes/objectcache/ObjectCache.php @@ -59,7 +59,7 @@ use MediaWiki\MediaWikiServices; * Purpose: Special cases (like tiered memory/disk caches). * Get a specific cache type by key in $wgObjectCaches. * - * All the above cache instances (BagOStuff and WANObjectCache) have their makeKey() + * All the above BagOStuff cache instances have their makeKey() * method scoped to the *current* wiki ID. Use makeGlobalKey() to avoid this scoping * when using keys that need to be shared amongst wikis. * @@ -68,8 +68,6 @@ use MediaWiki\MediaWikiServices; class ObjectCache { /** @var BagOStuff[] Map of (id => BagOStuff) */ public static $instances = []; - /** @var WANObjectCache[] Map of (id => WANObjectCache) */ - public static $wanInstances = []; /** * Get a cached instance of the specified type of cache object. @@ -86,23 +84,6 @@ class ObjectCache { } /** - * Get a cached instance of the specified type of WAN cache object. - * - * @since 1.26 - * @param string $id A key in $wgWANObjectCaches. - * @return WANObjectCache - * @deprecated since 1.34 Use MediaWikiServices::getMainWANObjectCache instead - */ - public static function getWANInstance( $id ) { - wfDeprecated( __METHOD__, '1.34' ); - if ( !isset( self::$wanInstances[$id] ) ) { - self::$wanInstances[$id] = self::newWANCacheFromId( $id ); - } - - return self::$wanInstances[$id]; - } - - /** * Create a new cache object of the specified type. * * @param string $id A key in $wgObjectCaches. @@ -278,62 +259,6 @@ class ObjectCache { } /** - * Create a new cache object of the specified type. - * - * @since 1.26 - * @param string $id A key in $wgWANObjectCaches. - * @return WANObjectCache - * @throws UnexpectedValueException - */ - private static function newWANCacheFromId( $id ) { - global $wgWANObjectCaches, $wgObjectCaches; - - if ( !isset( $wgWANObjectCaches[$id] ) ) { - throw new UnexpectedValueException( - "Cache type \"$id\" requested is not present in \$wgWANObjectCaches." ); - } - - $params = $wgWANObjectCaches[$id]; - if ( !isset( $wgObjectCaches[$params['cacheId']] ) ) { - throw new UnexpectedValueException( - "Cache type \"{$params['cacheId']}\" is not present in \$wgObjectCaches." ); - } - $params['store'] = $wgObjectCaches[$params['cacheId']]; - - return self::newWANCacheFromParams( $params ); - } - - /** - * Create a new cache object of the specified type. - * - * @since 1.28 - * @param array $params - * @return WANObjectCache - * @throws UnexpectedValueException - * @suppress PhanTypeMismatchReturn - * @deprecated since 1.34 Use MediaWikiServices::getMainWANObjectCache - * instead or use WANObjectCache::__construct directly - */ - public static function newWANCacheFromParams( array $params ) { - wfDeprecated( __METHOD__, '1.34' ); - global $wgCommandLineMode, $wgSecretKey; - - $services = MediaWikiServices::getInstance(); - $params['cache'] = self::newFromParams( $params['store'] ); - $params['logger'] = LoggerFactory::getInstance( $params['loggroup'] ?? 'objectcache' ); - if ( !$wgCommandLineMode ) { - // Send the statsd data post-send on HTTP requests; avoid in CLI mode (T181385) - $params['stats'] = $services->getStatsdDataFactory(); - // 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 ); - } - - /** * Get the main cluster-local cache object. * * @since 1.27 @@ -350,7 +275,6 @@ class ObjectCache { */ public static function clear() { self::$instances = []; - self::$wanInstances = []; } /** |