MediaWiki  REL1_20
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)
 decr ($key, $value=1)
 delete ($key, $time=0)
 deleteObjectsExpiringBefore ($date, $progressCallback=false)
 Delete objects expiring before a certain date.
 get ($key)
 incr ($key, $value=1)
 lock ($key, $timeout=0)
 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, and ObjectCache\newFromParams().


Member Function Documentation

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

Reimplemented from BagOStuff.

Definition at line 101 of file MultiWriteBagOStuff.php.

References $value, and doWrite().

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

Reimplemented from BagOStuff.

Definition at line 129 of file MultiWriteBagOStuff.php.

References $value, and doWrite().

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

Reimplemented from BagOStuff.

Definition at line 91 of file MultiWriteBagOStuff.php.

References 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 184 of file MultiWriteBagOStuff.php.

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

Definition at line 163 of file MultiWriteBagOStuff.php.

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

Parameters:
$keystring
Returns:
bool|mixed

Reimplemented from BagOStuff.

Definition at line 66 of file MultiWriteBagOStuff.php.

References $value.

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

Reimplemented from BagOStuff.

Definition at line 120 of file MultiWriteBagOStuff.php.

References $value, and doWrite().

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

Reimplemented from BagOStuff.

Definition at line 138 of file MultiWriteBagOStuff.php.

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

Reimplemented from BagOStuff.

Definition at line 111 of file MultiWriteBagOStuff.php.

References $value, and doWrite().

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

Reimplemented from BagOStuff.

Definition at line 82 of file MultiWriteBagOStuff.php.

References $value, and doWrite().

Parameters:
$debugbool

Reimplemented from BagOStuff.

Definition at line 58 of file MultiWriteBagOStuff.php.

References doWrite().

Parameters:
$keystring
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 151 of file MultiWriteBagOStuff.php.


Member Data Documentation

MultiWriteBagOStuff::$caches

Definition at line 32 of file MultiWriteBagOStuff.php.


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