MediaWiki
1.23.2
|
A wrapper class for the PECL memcached client. More...
Public Member Functions | |
__construct ( $params) | |
Constructor. More... | |
add ( $key, $value, $exptime=0) | |
cas ( $casToken, $key, $value, $exptime=0) | |
decr ( $key, $value=1) | |
delete ( $key, $time=0) | |
get ( $key, &$casToken=null) | |
getMulti (array $keys) | |
incr ( $key, $value=1) | |
set ( $key, $value, $exptime=0) | |
Public Member Functions inherited from MemcachedBagOStuff | |
decodeKey ( $key) | |
Decode a key encoded with encodeKey(). More... | |
encodeKey ( $key) | |
Encode a key for use on the wire inside the memcached protocol. More... | |
fixExpiry ( $expiry) | |
TTLs higher than 30 days will be detected as absolute TTLs (UNIX timestamps), and will result in the cache entry being discarded immediately because the expiry is in the past. More... | |
getClient () | |
Get the underlying client object. More... | |
Public Member Functions inherited from BagOStuff | |
clearLastError () | |
Clear the "last error" registry. More... | |
debug ( $text) | |
deleteObjectsExpiringBefore ( $date, $progressCallback=false) | |
Delete all objects expiring before a certain date. More... | |
getLastError () | |
Get the "last error" registered; clearLastError() should be called manually. More... | |
lock ( $key, $timeout=6) | |
merge ( $key, closure $callback, $exptime=0, $attempts=10) | |
Merge changes into the existing cache value (possibly creating a new one). More... | |
replace ( $key, $value, $exptime=0) | |
setDebug ( $bool) | |
unlock ( $key) | |
Protected Member Functions | |
checkResult ( $key, $result) | |
Check the return value from a client method call and take any necessary action. More... | |
Protected Member Functions inherited from MemcachedBagOStuff | |
applyDefaultParams ( $params) | |
Fill in the defaults for any parameters missing from $params, using the backwards-compatible global variables. More... | |
debugLog ( $text) | |
Send a debug message to the log. More... | |
encodeKeyCallback ( $m) | |
Protected Member Functions inherited from BagOStuff | |
convertExpiry ( $exptime) | |
Convert an optionally relative time to an absolute time. More... | |
convertToRelative ( $exptime) | |
Convert an optionally absolute expiry time to a relative time. More... | |
isInteger ( $value) | |
Check if a value is an integer. More... | |
mergeViaCas ( $key, closure $callback, $exptime=0, $attempts=10) | |
mergeViaLock ( $key, closure $callback, $exptime=0, $attempts=10) | |
setLastError ( $err) | |
Set the "last error" registry. More... | |
Additional Inherited Members | |
Public Attributes inherited from BagOStuff | |
const | ERR_NO_RESPONSE = 1 |
const | ERR_NONE = 0 |
Possible values for getLastError() More... | |
const | ERR_UNEXPECTED = 3 |
const | ERR_UNREACHABLE = 2 |
Protected Attributes inherited from MemcachedBagOStuff | |
$client | |
Protected Attributes inherited from BagOStuff | |
$lastError = self::ERR_NONE | |
A wrapper class for the PECL memcached client.
Definition at line 29 of file MemcachedPeclBagOStuff.php.
MemcachedPeclBagOStuff::__construct | ( | $params | ) |
Constructor.
Available parameters are:
Definition at line 46 of file MemcachedPeclBagOStuff.php.
References $params, MemcachedBagOStuff\applyDefaultParams(), array(), as, IP\splitHostAndPort(), and wfDebug().
MemcachedPeclBagOStuff::add | ( | $key, | |
$value, | |||
$exptime = 0 |
|||
) |
$key | string |
$value | int |
$exptime | int |
Reimplemented from MemcachedBagOStuff.
Definition at line 174 of file MemcachedPeclBagOStuff.php.
References $value, add, checkResult(), and MemcachedBagOStuff\debugLog().
MemcachedPeclBagOStuff::cas | ( | $casToken, | |
$key, | |||
$value, | |||
$exptime = 0 |
|||
) |
$casToken | float |
$key | string |
$value | |
$exptime | int |
Reimplemented from MemcachedBagOStuff.
Definition at line 147 of file MemcachedPeclBagOStuff.php.
References $value, checkResult(), and MemcachedBagOStuff\debugLog().
|
protected |
Check the return value from a client method call and take any necessary action.
Returns the value that the wrapper function should return. At present, the return value is always the same as the return value from the client, but some day we might find a case where it should be different.
string | $key | The key used by the caller, or false if there wasn't one. |
$result | Mixed The return value |
Definition at line 212 of file MemcachedPeclBagOStuff.php.
References MemcachedBagOStuff\debugLog(), BagOStuff\ERR_UNEXPECTED, BagOStuff\setLastError(), and wfDebugLog().
Referenced by add(), cas(), decr(), delete(), get(), getMulti(), incr(), and set().
MemcachedPeclBagOStuff::decr | ( | $key, | |
$value = 1 |
|||
) |
$key | string |
$value | int |
Reimplemented from BagOStuff.
Definition at line 195 of file MemcachedPeclBagOStuff.php.
References $value, checkResult(), and MemcachedBagOStuff\debugLog().
MemcachedPeclBagOStuff::delete | ( | $key, | |
$time = 0 |
|||
) |
$key | string |
$time | int |
Reimplemented from MemcachedBagOStuff.
Definition at line 157 of file MemcachedPeclBagOStuff.php.
References $time, checkResult(), and MemcachedBagOStuff\debugLog().
MemcachedPeclBagOStuff::get | ( | $key, | |
& | $casToken = null |
||
) |
$key | string |
$casToken[optional] | float |
Reimplemented from MemcachedBagOStuff.
Definition at line 120 of file MemcachedPeclBagOStuff.php.
References checkResult(), MemcachedBagOStuff\debugLog(), MemcachedBagOStuff\encodeKey(), wfProfileIn(), and wfProfileOut().
MemcachedPeclBagOStuff::getMulti | ( | array | $keys | ) |
$keys | Array |
Reimplemented from BagOStuff.
Definition at line 243 of file MemcachedPeclBagOStuff.php.
References $keys, array(), checkResult(), MemcachedBagOStuff\debugLog(), wfProfileIn(), and wfProfileOut().
MemcachedPeclBagOStuff::incr | ( | $key, | |
$value = 1 |
|||
) |
$key | string |
$value | int |
Reimplemented from BagOStuff.
Definition at line 184 of file MemcachedPeclBagOStuff.php.
References $value, checkResult(), and MemcachedBagOStuff\debugLog().
MemcachedPeclBagOStuff::set | ( | $key, | |
$value, | |||
$exptime = 0 |
|||
) |
$key | string |
$value | |
$exptime | int |
Reimplemented from MemcachedBagOStuff.
Definition at line 135 of file MemcachedPeclBagOStuff.php.
References $value, checkResult(), MemcachedBagOStuff\debugLog(), and set.