35 public static $instances = [];
52 return MediaWikiServices::getInstance()->getObjectCacheFactory()->getInstance( $id );
64 return MediaWikiServices::getInstance()->getObjectCacheFactory()
84 return MediaWikiServices::getInstance()->getObjectCacheFactory()
85 ->getInstance( self::getAnythingId() );
97 foreach ( $candidates as $candidate ) {
101 $class = self::getLocalServerCacheClass();
102 if ( $class !== EmptyBagOStuff::class ) {
110 $services = MediaWikiServices::getInstance();
112 if ( $services->isServiceDisabled(
'DBLoadBalancer' ) ) {
115 } elseif ( $services->isStorageDisabled() ) {
133 return MediaWikiServices::getInstance()->getObjectCacheFactory()
144 return MediaWikiServices::getInstance()->get(
'_LocalClusterCache' );
161 $id = self::getAnythingId();
162 return self::isDatabaseId( $id );
169 if ( ( $cache[
'class'] ??
'' ) === SqlBagOStuff::class ) {
182 MediaWikiServices::getInstance()->getObjectCacheFactory()->clear();
205 'reportDupes' => false,
207 'keyspace' => $keyspace,
209 $class = self::getLocalServerCacheClass();
217 private static function getLocalServerCacheClass() {
218 if ( self::$localServerCacheClass !==
null ) {
219 return self::$localServerCacheClass;
221 if ( function_exists(
'apcu_fetch' ) ) {
223 if ( PHP_SAPI !==
'cli' || ini_get(
'apc.enable_cli' ) ) {
224 return APCUBagOStuff::class;
227 } elseif ( function_exists(
'wincache_ucache_get' ) ) {
228 return WinCacheBagOStuff::class;
231 return EmptyBagOStuff::class;
array $params
The job parameters.
Class representing a cache/ephemeral data store.
static getLocalServerInstance( $fallback=CACHE_NONE)
static newAnything()
Factory function for CACHE_ANYTHING (referenced by configuration)
static isDatabaseId( $id)
Determine whether a config ID would access the database.
static newFromParams(array $params)
static BagOStuff[] $instances
static makeLocalServerCache( $keyspace)
Create a new BagOStuff instance for local-server caching.
static getInstance( $id)
Get a cached instance of the specified type of cache object.
static string $localServerCacheClass
static getLocalClusterInstance()
Get the main cluster-local cache object.
$wgObjectCaches
Config variable stub for the ObjectCaches setting, for use by phpdoc and IDEs.
$wgParserCacheType
Config variable stub for the ParserCacheType setting, for use by phpdoc and IDEs.
$wgMainCacheType
Config variable stub for the MainCacheType setting, for use by phpdoc and IDEs.
$wgMessageCacheType
Config variable stub for the MessageCacheType setting, for use by phpdoc and IDEs.