MediaWiki  REL1_19
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)
 Delete an item.
 deleteObjectsExpiringBefore ($date, $progressCallback=false)
 Delete objects expiring before a certain date.
 get ($key)
 Get an item with the given key.
 incr ($key, $value=1)
 lock ($key, $timeout=0)
 replace ($key, $value, $exptime=0)
 set ($key, $value, $exptime=0)
 Set an item.
 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 8 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

Definition at line 20 of file MultiWriteBagOStuff.php.

References ObjectCache\newFromParams().

Here is the call graph for this function:


Member Function Documentation

MultiWriteBagOStuff::add ( key,
value,
exptime = 0 
)

Reimplemented from BagOStuff.

Definition at line 53 of file MultiWriteBagOStuff.php.

References doWrite().

Here is the call graph for this function:

MultiWriteBagOStuff::decr ( key,
value = 1 
)

Reimplemented from BagOStuff.

Definition at line 65 of file MultiWriteBagOStuff.php.

References doWrite().

Here is the call graph for this function:

MultiWriteBagOStuff::delete ( key,
time = 0 
)

Delete an item.

Parameters:
$keystring
$timeint Amount of time to delay the operation (mostly memcached-specific)

Reimplemented from BagOStuff.

Definition at line 49 of file MultiWriteBagOStuff.php.

References doWrite().

Here is the call graph for this function:

MultiWriteBagOStuff::deleteObjectsExpiringBefore ( date,
progressCallback = false 
)

Delete objects expiring before a certain date.

Succeed if any of the child caches succeed.

Reimplemented from BagOStuff.

Definition at line 104 of file MultiWriteBagOStuff.php.

MultiWriteBagOStuff::doWrite ( method) [protected]

Definition at line 86 of file MultiWriteBagOStuff.php.

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

Here is the caller graph for this function:

Get an item with the given key.

Returns false if it does not exist.

Parameters:
$keystring
Returns:
bool|Object

Reimplemented from BagOStuff.

Definition at line 35 of file MultiWriteBagOStuff.php.

MultiWriteBagOStuff::incr ( key,
value = 1 
)
Parameters:
$keyString: Key to increase
$valueInteger: Value to add to $key (Default 1)
Returns:
null if lock is not possible else $key value increased by $value

Reimplemented from BagOStuff.

Definition at line 61 of file MultiWriteBagOStuff.php.

References doWrite().

Here is the call graph for this function:

MultiWriteBagOStuff::lock ( key,
timeout = 0 
)

Reimplemented from BagOStuff.

Definition at line 69 of file MultiWriteBagOStuff.php.

MultiWriteBagOStuff::replace ( key,
value,
exptime = 0 
)

Reimplemented from BagOStuff.

Definition at line 57 of file MultiWriteBagOStuff.php.

References doWrite().

Here is the call graph for this function:

MultiWriteBagOStuff::set ( key,
value,
exptime = 0 
)

Set an item.

Parameters:
$keystring
$valuemixed
$exptimeint Either an interval in seconds or a unix timestamp for expiry

Reimplemented from BagOStuff.

Definition at line 45 of file MultiWriteBagOStuff.php.

References doWrite().

Here is the call graph for this function:

Parameters:
$boolbool

Reimplemented from BagOStuff.

Definition at line 31 of file MultiWriteBagOStuff.php.

References doWrite().

Here is the call graph for this function:

Reimplemented from BagOStuff.

Definition at line 78 of file MultiWriteBagOStuff.php.


Member Data Documentation

MultiWriteBagOStuff::$caches

Definition at line 9 of file MultiWriteBagOStuff.php.


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