MediaWiki  REL1_22
XCacheBagOStuff Class Reference

Wrapper for XCache object caching functions; identical interface to the APC wrapper. More...

Inheritance diagram for XCacheBagOStuff:
Collaboration diagram for XCacheBagOStuff:

List of all members.

Public Member Functions

 cas ($casToken, $key, $value, $exptime=0)
 decr ($key, $value=1)
 Decrease stored value of $key by $value while preserving its TTL.
 delete ($key, $time=0)
 Remove a value from the XCache object cache.
 get ($key, &$casToken=null)
 Get a value from the XCache object cache.
 incr ($key, $value=1)
 Increase stored value of $key by $value while preserving its TTL.
 merge ($key, closure $callback, $exptime=0, $attempts=10)
 Merge an item.
 set ($key, $value, $expire=0)
 Store a value in the XCache object cache.

Detailed Description

Wrapper for XCache object caching functions; identical interface to the APC wrapper.

Definition at line 30 of file XCacheBagOStuff.php.


Member Function Documentation

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

Reimplemented from BagOStuff.

Definition at line 78 of file XCacheBagOStuff.php.

XCacheBagOStuff::decr ( key,
value = 1 
)

Decrease stored value of $key by $value while preserving its TTL.

Parameters:
$keyString
$valueInteger
Returns:
integer

Reimplemented from BagOStuff.

Definition at line 114 of file XCacheBagOStuff.php.

References $key, and $value.

XCacheBagOStuff::delete ( key,
time = 0 
)

Remove a value from the XCache object cache.

Parameters:
string$keycache key
int$timenot used in this implementation
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 90 of file XCacheBagOStuff.php.

References $key.

XCacheBagOStuff::get ( key,
&$  casToken = null 
)

Get a value from the XCache object cache.

Parameters:
string$keycache key
$casTokenmixed: cas token
Returns:
mixed

Reimplemented from BagOStuff.

Definition at line 38 of file XCacheBagOStuff.php.

References $key, and BagOStuff\isInteger().

XCacheBagOStuff::incr ( key,
value = 1 
)

Increase stored value of $key by $value while preserving its TTL.

Parameters:
string$keyKey to increase
$valueInteger: Value to add to $key (Default 1)
Returns:
integer|bool New value or false on failure

Reimplemented from BagOStuff.

Definition at line 110 of file XCacheBagOStuff.php.

References $key, and $value.

XCacheBagOStuff::merge ( key,
closure $  callback,
exptime = 0,
attempts = 10 
)

Merge an item.

XCache does not seem to support any way of performing CAS - this however will provide a way to perform CAS-like functionality.

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 106 of file XCacheBagOStuff.php.

References $key, and BagOStuff\mergeViaLock().

XCacheBagOStuff::set ( key,
value,
expire = 0 
)

Store a value in the XCache object cache.

Parameters:
string$keycache key
$valueMixed: object to store
int$expireexpiration time
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 62 of file XCacheBagOStuff.php.

References $key, $value, and BagOStuff\isInteger().


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