MediaWiki
master
ObjectCache.php
Go to the documentation of this file.
1
<?php
10
namespace
MediaWiki\ObjectCache
;
11
12
use
MediaWiki\MediaWikiServices
;
13
use
Wikimedia\ObjectCache\BagOStuff
;
14
19
class
ObjectCache
{
24
public
static
$instances
= [];
25
34
public
static
function
getInstance
( $id ) {
35
return
MediaWikiServices::getInstance
()->getObjectCacheFactory()->getInstance( $id );
36
}
37
46
public
static
function
newFromParams
( array $params ) {
47
return
MediaWikiServices::getInstance
()->getObjectCacheFactory()
48
->newFromParams( $params );
49
}
50
65
public
static
function
newAnything
() {
66
return
MediaWikiServices::getInstance
()->getObjectCacheFactory()
67
->getInstance(
CACHE_ANYTHING
);
68
}
69
76
public
static
function
getLocalServerInstance
(
$fallback
=
CACHE_NONE
) {
77
return
MediaWikiServices::getInstance
()->getObjectCacheFactory()
78
->getLocalServerInstance(
$fallback
);
79
}
80
89
public
static
function
getLocalClusterInstance
() {
90
return
MediaWikiServices::getInstance
()->getObjectCacheFactory()
91
->getLocalClusterInstance();
92
}
93
99
public
static
function
clear
() {
100
MediaWikiServices::getInstance
()->getObjectCacheFactory()->clear();
101
}
102
}
103
105
class_alias( ObjectCache::class,
'ObjectCache'
);
CACHE_NONE
const CACHE_NONE
Definition
Defines.php:73
CACHE_ANYTHING
const CACHE_ANYTHING
Definition
Defines.php:72
$fallback
$fallback
Definition
MessagesAae.php:10
MediaWiki\MediaWikiServices
Service locator for MediaWiki core services.
Definition
MediaWikiServices.php:258
MediaWiki\MediaWikiServices\getInstance
static getInstance()
Returns the global default instance of the top level service locator.
Definition
MediaWikiServices.php:346
MediaWiki\ObjectCache\ObjectCache
Definition
ObjectCache.php:19
MediaWiki\ObjectCache\ObjectCache\getLocalClusterInstance
static getLocalClusterInstance()
Get the main cluster-local cache object.
Definition
ObjectCache.php:89
MediaWiki\ObjectCache\ObjectCache\$instances
static BagOStuff[] $instances
Definition
ObjectCache.php:24
MediaWiki\ObjectCache\ObjectCache\getInstance
static getInstance( $id)
Get a cached instance of the specified type of cache object.
Definition
ObjectCache.php:34
MediaWiki\ObjectCache\ObjectCache\newFromParams
static newFromParams(array $params)
Definition
ObjectCache.php:46
MediaWiki\ObjectCache\ObjectCache\newAnything
static newAnything()
Factory function for CACHE_ANYTHING (referenced by configuration)
Definition
ObjectCache.php:65
MediaWiki\ObjectCache\ObjectCache\getLocalServerInstance
static getLocalServerInstance( $fallback=CACHE_NONE)
Definition
ObjectCache.php:76
MediaWiki\ObjectCache\ObjectCache\clear
static clear()
Definition
ObjectCache.php:99
Wikimedia\ObjectCache\BagOStuff
Abstract class for any ephemeral data store.
Definition
BagOStuff.php:73
MediaWiki\ObjectCache
Definition
ObjectCache.php:10
includes
ObjectCache
ObjectCache.php
Generated on Tue Feb 17 2026 14:26:12 for MediaWiki by
1.10.0