MediaWiki master
ObjectCache.php
Go to the documentation of this file.
1<?php
26
36 public static $instances = [];
37
46 public static function getInstance( $id ) {
47 return MediaWikiServices::getInstance()->getObjectCacheFactory()->getInstance( $id );
48 }
49
58 public static function newFromParams( array $params ) {
59 return MediaWikiServices::getInstance()->getObjectCacheFactory()
60 ->newFromParams( $params );
61 }
62
77 public static function newAnything() {
78 return MediaWikiServices::getInstance()->getObjectCacheFactory()
79 ->getInstance( CACHE_ANYTHING );
80 }
81
88 public static function getLocalServerInstance( $fallback = CACHE_NONE ) {
89 return MediaWikiServices::getInstance()->getObjectCacheFactory()
90 ->getLocalServerInstance( $fallback );
91 }
92
101 public static function getLocalClusterInstance() {
102 return MediaWikiServices::getInstance()->getObjectCacheFactory()
103 ->getLocalClusterInstance();
104 }
105
111 public static function clear() {
112 MediaWikiServices::getInstance()->getObjectCacheFactory()->clear();
113 }
114}
const CACHE_NONE
Definition Defines.php:87
const CACHE_ANYTHING
Definition Defines.php:86
$fallback
array $params
The job parameters.
Service locator for MediaWiki core services.
static getLocalServerInstance( $fallback=CACHE_NONE)
static newAnything()
Factory function for CACHE_ANYTHING (referenced by configuration)
static newFromParams(array $params)
static clear()
static BagOStuff[] $instances
static getInstance( $id)
Get a cached instance of the specified type of cache object.
static getLocalClusterInstance()
Get the main cluster-local cache object.
Abstract class for any ephemeral data store.
Definition BagOStuff.php:89