MediaWiki
REL1_22
|
Base class for memcached clients. More...
Public Member Functions | |
add ($key, $value, $exptime=0) | |
cas ($casToken, $key, $value, $exptime=0) | |
decodeKey ($key) | |
Decode a key encoded with encodeKey(). | |
delete ($key, $time=0) | |
encodeKey ($key) | |
Encode a key for use on the wire inside the memcached protocol. | |
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. | |
get ($key, &$casToken=null) | |
getClient () | |
Get the underlying client object. | |
replace ($key, $value, $exptime=0) | |
set ($key, $value, $exptime=0) | |
Protected Member Functions | |
applyDefaultParams ($params) | |
Fill in the defaults for any parameters missing from $params, using the backwards-compatible global variables. | |
debugLog ($text) | |
Send a debug message to the log. | |
encodeKeyCallback ($m) | |
Protected Attributes | |
$client |
Base class for memcached clients.
Definition at line 29 of file MemcachedBagOStuff.php.
MemcachedBagOStuff::add | ( | $ | key, |
$ | value, | ||
$ | exptime = 0 |
||
) |
$key | string | |
$value | int | |
int | $exptime | (default 0) |
Reimplemented from BagOStuff.
Reimplemented in MemcachedPeclBagOStuff.
Definition at line 105 of file MemcachedBagOStuff.php.
References $key, $value, encodeKey(), and fixExpiry().
MemcachedBagOStuff::applyDefaultParams | ( | $ | params | ) | [protected] |
Fill in the defaults for any parameters missing from $params, using the backwards-compatible global variables.
Definition at line 36 of file MemcachedBagOStuff.php.
References $params.
Referenced by MemcachedPhpBagOStuff\__construct(), and MemcachedPeclBagOStuff\__construct().
MemcachedBagOStuff::cas | ( | $ | casToken, |
$ | key, | ||
$ | value, | ||
$ | exptime = 0 |
||
) |
$key | string |
$casToken | mixed |
$value | |
$exptime | int |
Reimplemented from BagOStuff.
Reimplemented in MemcachedPeclBagOStuff.
Definition at line 85 of file MemcachedBagOStuff.php.
References $key, $value, encodeKey(), and fixExpiry().
MemcachedBagOStuff::debugLog | ( | $ | text | ) | [protected] |
Send a debug message to the log.
Definition at line 181 of file MemcachedBagOStuff.php.
References wfDebugLog().
Referenced by MemcachedPeclBagOStuff\add(), MemcachedPeclBagOStuff\cas(), MemcachedPeclBagOStuff\checkResult(), MemcachedPeclBagOStuff\decr(), MemcachedPeclBagOStuff\delete(), MemcachedPeclBagOStuff\get(), MemcachedPeclBagOStuff\getMulti(), MemcachedPeclBagOStuff\incr(), MemcachedPeclBagOStuff\replace(), and MemcachedPeclBagOStuff\set().
MemcachedBagOStuff::decodeKey | ( | $ | key | ) |
Decode a key encoded with encodeKey().
This is provided as a convenience function for debugging.
$key | string |
Definition at line 174 of file MemcachedBagOStuff.php.
References $key.
MemcachedBagOStuff::delete | ( | $ | key, |
$ | time = 0 |
||
) |
$key | string |
$time | int |
Reimplemented from BagOStuff.
Reimplemented in MemcachedPeclBagOStuff.
Definition at line 95 of file MemcachedBagOStuff.php.
References $key, $time, and encodeKey().
MemcachedBagOStuff::encodeKey | ( | $ | key | ) |
Encode a key for use on the wire inside the memcached protocol.
We encode spaces and line breaks to avoid protocol errors. We encode the other control characters for compatibility with libmemcached verify_key. We leave other punctuation alone, to maximise backwards compatibility.
$key | string |
Definition at line 139 of file MemcachedBagOStuff.php.
Referenced by add(), cas(), MemcachedPhpBagOStuff\decr(), delete(), get(), MemcachedPeclBagOStuff\get(), MemcachedPhpBagOStuff\incr(), MemcachedPhpBagOStuff\lock(), replace(), set(), and MemcachedPhpBagOStuff\unlock().
MemcachedBagOStuff::encodeKeyCallback | ( | $ | m | ) | [protected] |
MemcachedBagOStuff::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.
Clamp expiries >30d at 30d, unless they're >=1e9 in which case they are likely to really be absolute (1e9 = 2011-09-09)
Definition at line 159 of file MemcachedBagOStuff.php.
MemcachedBagOStuff::get | ( | $ | key, |
&$ | casToken = null |
||
) |
$key | string |
$casToken[optional] | mixed |
Reimplemented from BagOStuff.
Reimplemented in MemcachedPeclBagOStuff.
Definition at line 63 of file MemcachedBagOStuff.php.
References $key, and encodeKey().
Get the underlying client object.
This is provided for debugging purposes.
Definition at line 125 of file MemcachedBagOStuff.php.
MemcachedBagOStuff::replace | ( | $ | key, |
$ | value, | ||
$ | exptime = 0 |
||
) |
$key | string |
$value | int |
$exptime |
Reimplemented from BagOStuff.
Reimplemented in MemcachedPeclBagOStuff.
Definition at line 116 of file MemcachedBagOStuff.php.
References $key, $value, encodeKey(), and fixExpiry().
MemcachedBagOStuff::set | ( | $ | key, |
$ | value, | ||
$ | exptime = 0 |
||
) |
$key | string |
$value | |
$exptime | int |
Reimplemented from BagOStuff.
Reimplemented in MemcachedPeclBagOStuff.
Definition at line 73 of file MemcachedBagOStuff.php.
References $key, $value, encodeKey(), and fixExpiry().
MemcachedBagOStuff::$client [protected] |
Definition at line 30 of file MemcachedBagOStuff.php.