MediaWiki master
ObjectCache Class Reference
Collaboration diagram for ObjectCache:

Static Public Member Functions

static clear ()
 
static getInstance ( $id)
 Get a cached instance of the specified type of cache object.
 
static getLocalClusterInstance ()
 Get the main cluster-local cache object.
 
static getLocalServerInstance ( $fallback=CACHE_NONE)
 
static newAnything ()
 Factory function for CACHE_ANYTHING (referenced by configuration)
 
static newFromParams (array $params)
 

Static Public Attributes

static BagOStuff[] $instances = []
 

Detailed Description

See also
ObjectCacheFactory

Definition at line 31 of file ObjectCache.php.

Member Function Documentation

◆ clear()

static ObjectCache::clear ( )
static
Deprecated
since 1.42, Use ObjectCacheFactory::clear() instead.

Clear all the cached instances.

Definition at line 111 of file ObjectCache.php.

◆ getInstance()

static ObjectCache::getInstance ( $id)
static

Get a cached instance of the specified type of cache object.

Deprecated
since 1.43; use ObjectCacheFactory::getInstance instead.
Parameters
string | int$idA key in $wgObjectCaches.
Returns
BagOStuff

Definition at line 46 of file ObjectCache.php.

◆ getLocalClusterInstance()

static ObjectCache::getLocalClusterInstance ( )
static

Get the main cluster-local cache object.

Deprecated
since 1.43, Use ObjectCacheFactory::getLocalClusterInstance()
Since
1.27
Returns
BagOStuff

Definition at line 101 of file ObjectCache.php.

◆ getLocalServerInstance()

static ObjectCache::getLocalServerInstance ( $fallback = CACHE_NONE)
static
Deprecated
since 1.42, Use ObjectCacheFactory::getLocalServerInstance()
Parameters
int | string | array$fallbackFallback cache or parameter map with 'fallback'
Returns
BagOStuff
Since
1.27

Definition at line 88 of file ObjectCache.php.

References $fallback.

◆ newAnything()

static ObjectCache::newAnything ( )
static

Factory function for CACHE_ANYTHING (referenced by configuration)

CACHE_ANYTHING means that stuff has to be cached, not caching is not an option. If a caching method is configured for any of the main caches ($wgMainCacheType, $wgMessageCacheType, $wgParserCacheType), then CACHE_ANYTHING will effectively be an alias to the configured cache choice for that. If no cache choice is configured (by default $wgMainCacheType is CACHE_NONE), then CACHE_ANYTHING will forward to CACHE_DB.

Deprecated
since 1.42, Use ObjectCacheFactory::getInstance( CACHE_ANYTHING );
Returns
BagOStuff

Definition at line 77 of file ObjectCache.php.

References CACHE_ANYTHING.

◆ newFromParams()

static ObjectCache::newFromParams ( array $params)
static
See also
ObjectCacheFactory::newFromParams()
Deprecated
since 1.42, Use ObjectCacheFactory::newFromParams instead.
Parameters
array$params
Returns
BagOStuff

Definition at line 58 of file ObjectCache.php.

References $params.

Member Data Documentation

◆ $instances

BagOStuff [] ObjectCache::$instances = []
static
Deprecated
since 1.43; use ObjectCacheFactory instead. Map of (id => BagOStuff)

Definition at line 36 of file ObjectCache.php.


The documentation for this class was generated from the following file: