MediaWiki  REL1_24
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:
mixed$casToken
string$key
mixed$value
int$exptime
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:
string$key
int$value
Returns:
int

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
mixed$casTokenCas 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
int$valueValue to add to $key (Default 1)
Returns:
int|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:
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 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
mixed$valueObject 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: