MediaWiki  REL1_22
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)
 decr ($key, $value=1)
 delete ($key, $time=0)
 deleteObjectsExpiringBefore ($date, $progressCallback=false)
 Delete objects expiring before a certain date.
 get ($key, &$casToken=null)
 incr ($key, $value=1)
 lock ($key, $timeout=0)
 merge ($key, closure $callback, $exptime=0, $attempts=10)
 replace ($key, $value, $exptime=0)
 set ($key, $value, $exptime=0)
 setDebug ($debug)
 unlock ($key)

Public Attributes

 $caches

Protected Member Functions

 doWrite ($method)

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:
$paramsarray
Exceptions:
MWException

Definition at line 44 of file MultiWriteBagOStuff.php.

References $params, array(), as, and ObjectCache\newFromParams().


Member Function Documentation

MultiWriteBagOStuff::add ( key,
value,
exptime = 0 
)
Parameters:
$keystring
$valuemixed
$exptimeint
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 113 of file MultiWriteBagOStuff.php.

References $key, $value, and doWrite().

MultiWriteBagOStuff::cas ( casToken,
key,
value,
exptime = 0 
)
Parameters:
$casTokenmixed
$keystring
$valuemixed
$exptimeint
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 84 of file MultiWriteBagOStuff.php.

MultiWriteBagOStuff::decr ( key,
value = 1 
)
Parameters:
$keystring
$valueint
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 141 of file MultiWriteBagOStuff.php.

References $key, $value, and doWrite().

MultiWriteBagOStuff::delete ( key,
time = 0 
)
Parameters:
$keystring
$timeint
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 103 of file MultiWriteBagOStuff.php.

References $key, $time, and doWrite().

MultiWriteBagOStuff::deleteObjectsExpiringBefore ( date,
progressCallback = false 
)

Delete objects expiring before a certain date.

Succeed if any of the child caches succeed.

Parameters:
$datestring
$progressCallbackbool|callback
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 207 of file MultiWriteBagOStuff.php.

References $cache, $ret, and as.

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

Definition at line 186 of file MultiWriteBagOStuff.php.

References $cache, $ret, array(), and as.

Referenced by add(), decr(), delete(), incr(), merge(), replace(), set(), and setDebug().

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

Reimplemented from BagOStuff.

Definition at line 67 of file MultiWriteBagOStuff.php.

References $cache, $key, $value, and as.

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

Reimplemented from BagOStuff.

Definition at line 132 of file MultiWriteBagOStuff.php.

References $key, $value, and doWrite().

MultiWriteBagOStuff::lock ( key,
timeout = 0 
)
Parameters:
$keystring
$timeoutint
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 150 of file MultiWriteBagOStuff.php.

References $key.

MultiWriteBagOStuff::merge ( key,
closure $  callback,
exptime = 0,
attempts = 10 
)
Parameters:
$keystring
$callbackclosure Callback 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 178 of file MultiWriteBagOStuff.php.

References $key, and doWrite().

MultiWriteBagOStuff::replace ( key,
value,
exptime = 0 
)
Parameters:
$keystring
$valuemixed
$exptimeint
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 123 of file MultiWriteBagOStuff.php.

References $key, $value, and doWrite().

MultiWriteBagOStuff::set ( key,
value,
exptime = 0 
)
Parameters:
$keystring
$valuemixed
$exptimeint
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 94 of file MultiWriteBagOStuff.php.

References $key, $value, and doWrite().

Parameters:
$debugbool

Reimplemented from BagOStuff.

Definition at line 58 of file MultiWriteBagOStuff.php.

References $debug, and doWrite().

Parameters:
$keystring
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 163 of file MultiWriteBagOStuff.php.

References $key.


Member Data Documentation

MultiWriteBagOStuff::$caches

Definition at line 32 of file MultiWriteBagOStuff.php.


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