MediaWiki  master
ProcessCacheLRU.php
Go to the documentation of this file.
1 <?php
34  protected $cache;
35 
40  public function __construct( $maxKeys ) {
41  $this->cache = new MapCacheLRU( $maxKeys );
42  }
43 
54  public function set( $key, $prop, $value ) {
55  $this->cache->setField( $key, $prop, $value );
56  }
57 
66  public function has( $key, $prop, $maxAge = 0.0 ) {
67  return $this->cache->hasField( $key, $prop, $maxAge );
68  }
69 
79  public function get( $key, $prop ) {
80  return $this->cache->getField( $key, $prop );
81  }
82 
89  public function clear( $keys = null ) {
90  $this->cache->clear( $keys );
91  }
92 
100  public function resize( $maxKeys ) {
101  $this->cache->setMaxSize( $maxKeys );
102  }
103 
108  public function getSize() {
109  return $this->cache->getMaxSize();
110  }
111 }
$value
__construct( $maxKeys)
getSize()
Get cache size.
you have access to all of the normal MediaWiki so you can get a DB use the cache
Definition: maintenance.txt:52
MapCacheLRU $cache
resize( $maxKeys)
Resize the maximum number of cache entries, removing older entries as needed.
clear( $keys=null)
Clear one or several cache entries, or all cache entries.
has( $key, $prop, $maxAge=0.0)
Check if a property field exists for a cache entry.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not null
Definition: hooks.txt:780
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
Class for process caching individual properties of expiring items.