MediaWiki
REL1_32
ProcessCacheLRU.php
Go to the documentation of this file.
1
<?php
32
class
ProcessCacheLRU
{
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
}
MapCacheLRU
Handles a simple LRU key/value map with a maximum number of entries.
Definition
MapCacheLRU.php:37
ProcessCacheLRU
Class for process caching individual properties of expiring items.
Definition
ProcessCacheLRU.php:32
ProcessCacheLRU\$cache
MapCacheLRU $cache
Definition
ProcessCacheLRU.php:34
ProcessCacheLRU\clear
clear( $keys=null)
Clear one or several cache entries, or all cache entries.
Definition
ProcessCacheLRU.php:89
ProcessCacheLRU\has
has( $key, $prop, $maxAge=0.0)
Check if a property field exists for a cache entry.
Definition
ProcessCacheLRU.php:66
ProcessCacheLRU\__construct
__construct( $maxKeys)
Definition
ProcessCacheLRU.php:40
ProcessCacheLRU\resize
resize( $maxKeys)
Resize the maximum number of cache entries, removing older entries as needed.
Definition
ProcessCacheLRU.php:100
ProcessCacheLRU\getSize
getSize()
Get cache size.
Definition
ProcessCacheLRU.php:108
cache
you have access to all of the normal MediaWiki so you can get a DB use the cache
Definition
maintenance.txt:55
$value
$value
Definition
styleTest.css.php:49
$keys
$keys
Definition
testCompression.php:67
includes
libs
ProcessCacheLRU.php
Generated on Mon Nov 25 2024 15:57:17 for MediaWiki by
1.10.0