MediaWiki master
ObjectCache.php
Go to the documentation of this file.
1<?php
11
14
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
105class_alias( ObjectCache::class, 'ObjectCache' );
const CACHE_NONE
Definition Defines.php:73
const CACHE_ANYTHING
Definition Defines.php:72
$fallback
Service locator for MediaWiki core services.
static getInstance()
Returns the global default instance of the top level service locator.
static getLocalClusterInstance()
Get the main cluster-local cache object.
static getInstance( $id)
Get a cached instance of the specified type of cache object.
static newFromParams(array $params)
static newAnything()
Factory function for CACHE_ANYTHING (referenced by configuration)
static getLocalServerInstance( $fallback=CACHE_NONE)
Abstract class for any ephemeral data store.
Definition BagOStuff.php:73