MediaWiki  REL1_24
MultiWriteBagOStuff Class Reference

A cache class that replicates all writes to multiple child caches. More...

Inheritance diagram for MultiWriteBagOStuff:
Collaboration diagram for MultiWriteBagOStuff:

List of all members.

Public Member Functions

 __construct ($params)
 Constructor.
 add ($key, $value, $exptime=0)
 cas ($casToken, $key, $value, $exptime=0)
 clearLastError ()
 Clear the "last error" registry.
 decr ($key, $value=1)
 delete ($key, $time=0)
 deleteObjectsExpiringBefore ($date, $progressCallback=false)
 Delete objects expiring before a certain date.
 get ($key, &$casToken=null)
 getLastError ()
 Get the "last error" registered; clearLastError() should be called manually.
 incr ($key, $value=1)
 lock ($key, $timeout=0)
 merge ($key, Closure $callback, $exptime=0, $attempts=10)
 set ($key, $value, $exptime=0)
 setDebug ($debug)
 unlock ($key)

Protected Member Functions

 doWrite ($method)

Protected Attributes

array $caches
 BagOStuff[] *.

Detailed Description

A cache class that replicates all writes to multiple child caches.

Reads are implemented by reading from the caches in the order they are given in the configuration until a cache gives a positive result.

Definition at line 31 of file MultiWriteBagOStuff.php.


Constructor & Destructor Documentation

Constructor.

Parameters are:

  • caches: This should have a numbered array of cache parameter structures, in the style required by $wgObjectCaches. See the documentation of $wgObjectCaches for more detail.
Parameters:
array$params
Exceptions:
MWException

Definition at line 44 of file MultiWriteBagOStuff.php.


Member Function Documentation

MultiWriteBagOStuff::add ( key,
value,
exptime = 0 
)
Parameters:
string$key
mixed$value
int$exptime
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 113 of file MultiWriteBagOStuff.php.

MultiWriteBagOStuff::cas ( casToken,
key,
value,
exptime = 0 
)
Parameters:
mixed$casToken
string$key
mixed$value
mixed$exptime
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 84 of file MultiWriteBagOStuff.php.

Clear the "last error" registry.

Since:
1.23

Reimplemented from BagOStuff.

Definition at line 176 of file MultiWriteBagOStuff.php.

MultiWriteBagOStuff::decr ( key,
value = 1 
)
Parameters:
string$key
int$value
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 131 of file MultiWriteBagOStuff.php.

MultiWriteBagOStuff::delete ( key,
time = 0 
)
Parameters:
string$key
int$time
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 103 of file MultiWriteBagOStuff.php.

MultiWriteBagOStuff::deleteObjectsExpiringBefore ( date,
progressCallback = false 
)

Delete objects expiring before a certain date.

Succeed if any of the child caches succeed.

Parameters:
string$date
bool | callable$progressCallback
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 207 of file MultiWriteBagOStuff.php.

MultiWriteBagOStuff::doWrite ( method) [protected]
Parameters:
string$method
Returns:
bool

Definition at line 186 of file MultiWriteBagOStuff.php.

MultiWriteBagOStuff::get ( key,
&$  casToken = null 
)
Parameters:
string$key
mixed$casToken[optional]
Returns:
bool|mixed

Reimplemented from BagOStuff.

Definition at line 67 of file MultiWriteBagOStuff.php.

Get the "last error" registered; clearLastError() should be called manually.

Returns:
int ERR_* constant for the "last error" registry
Since:
1.23

Reimplemented from BagOStuff.

Definition at line 172 of file MultiWriteBagOStuff.php.

References BagOStuff\ERR_NONE.

MultiWriteBagOStuff::incr ( key,
value = 1 
)
Parameters:
string$key
int$value
Returns:
bool|null

Reimplemented from BagOStuff.

Definition at line 122 of file MultiWriteBagOStuff.php.

MultiWriteBagOStuff::lock ( key,
timeout = 0 
)
Parameters:
string$key
int$timeout
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 140 of file MultiWriteBagOStuff.php.

MultiWriteBagOStuff::merge ( key,
Closure $  callback,
exptime = 0,
attempts = 10 
)
Parameters:
string$key
Closure$callbackCallback method to be executed
int$exptimeEither an interval in seconds or a unix timestamp for expiry
int$attemptsThe amount of times to attempt a merge in case of failure
Returns:
bool Success

Reimplemented from BagOStuff.

Definition at line 168 of file MultiWriteBagOStuff.php.

MultiWriteBagOStuff::set ( key,
value,
exptime = 0 
)
Parameters:
string$key
mixed$value
int$exptime
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 94 of file MultiWriteBagOStuff.php.

Parameters:
bool$debug

Reimplemented from BagOStuff.

Definition at line 58 of file MultiWriteBagOStuff.php.

Parameters:
string$key
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 153 of file MultiWriteBagOStuff.php.


Member Data Documentation

array MultiWriteBagOStuff::$caches [protected]

BagOStuff[] *.

Definition at line 32 of file MultiWriteBagOStuff.php.


The documentation for this class was generated from the following file: