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
89 public static function getLocalServerInstance( $fallback = CACHE_NONE ) {
90 return MediaWikiServices::getInstance()->getObjectCacheFactory()
91 ->getLocalServerInstance( $fallback );
92 }
93
102 public static function getLocalClusterInstance() {
103 return MediaWikiServices::getInstance()->getObjectCacheFactory()
104 ->getLocalClusterInstance();
105 }
106
112 public static function clear() {
113 MediaWikiServices::getInstance()->getObjectCacheFactory()->clear();
114 }
115}
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.
Class representing a cache/ephemeral data store.
Definition BagOStuff.php:88