MediaWiki
REL1_19
|
A wrapper class for the pure-PHP memcached client, exposing a BagOStuff interface. More...
Public Member Functions | |
__construct ($params) | |
Constructor. | |
add ($key, $value, $exptime=0) | |
decodeKey ($key) | |
Decode a key encoded with encodeKey(). | |
decr ($key, $value=1) | |
delete ($key, $time=0) | |
encodeKey ($key) | |
Encode a key for use on the wire inside the memcached protocol. | |
get ($key) | |
getClient () | |
Get the underlying client object. | |
incr ($key, $value=1) | |
lock ($key, $timeout=0) | |
replace ($key, $value, $exptime=0) | |
set ($key, $value, $exptime=0) | |
setDebug ($debug) | |
unlock ($key) | |
Protected Member Functions | |
encodeKeyCallback ($m) | |
Protected Attributes | |
$client |
A wrapper class for the pure-PHP memcached client, exposing a BagOStuff interface.
Definition at line 6 of file MemcachedPhpBagOStuff.php.
MemcachedPhpBagOStuff::__construct | ( | $ | params | ) |
Constructor.
Available parameters are:
$params | array |
Definition at line 26 of file MemcachedPhpBagOStuff.php.
MemcachedPhpBagOStuff::add | ( | $ | key, |
$ | value, | ||
$ | exptime = 0 |
||
) |
$key | string |
$value | int |
Reimplemented from BagOStuff.
Definition at line 107 of file MemcachedPhpBagOStuff.php.
References encodeKey().
MemcachedPhpBagOStuff::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 MemcachedPhpBagOStuff.php.
MemcachedPhpBagOStuff::decr | ( | $ | key, |
$ | value = 1 |
||
) |
$key | string |
$value | int |
Reimplemented from BagOStuff.
Definition at line 135 of file MemcachedPhpBagOStuff.php.
References encodeKey().
MemcachedPhpBagOStuff::delete | ( | $ | key, |
$ | time = 0 |
||
) |
$key | string |
$time | int |
Reimplemented from BagOStuff.
Definition at line 81 of file MemcachedPhpBagOStuff.php.
References encodeKey().
MemcachedPhpBagOStuff::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.
Definition at line 157 of file MemcachedPhpBagOStuff.php.
Referenced by add(), decr(), delete(), get(), incr(), lock(), replace(), set(), and unlock().
MemcachedPhpBagOStuff::encodeKeyCallback | ( | $ | m | ) | [protected] |
Definition at line 162 of file MemcachedPhpBagOStuff.php.
MemcachedPhpBagOStuff::get | ( | $ | key | ) |
$key | string |
Reimplemented from BagOStuff.
Definition at line 62 of file MemcachedPhpBagOStuff.php.
References encodeKey().
Get the underlying client object.
This is provided for debugging purposes.
Definition at line 145 of file MemcachedPhpBagOStuff.php.
MemcachedPhpBagOStuff::incr | ( | $ | key, |
$ | value = 1 |
||
) |
$key | string |
$value | int |
Reimplemented from BagOStuff.
Definition at line 126 of file MemcachedPhpBagOStuff.php.
References encodeKey().
MemcachedPhpBagOStuff::lock | ( | $ | key, |
$ | timeout = 0 |
||
) |
$key | |
$timeout | int |
Reimplemented from BagOStuff.
Definition at line 90 of file MemcachedPhpBagOStuff.php.
References encodeKey().
MemcachedPhpBagOStuff::replace | ( | $ | key, |
$ | value, | ||
$ | exptime = 0 |
||
) |
$key | string |
$value | int |
$exptime |
Reimplemented from BagOStuff.
Definition at line 117 of file MemcachedPhpBagOStuff.php.
References encodeKey().
MemcachedPhpBagOStuff::set | ( | $ | key, |
$ | value, | ||
$ | exptime = 0 |
||
) |
$key | string |
$value | |
$exptime | int |
Reimplemented from BagOStuff.
Definition at line 72 of file MemcachedPhpBagOStuff.php.
References encodeKey().
MemcachedPhpBagOStuff::setDebug | ( | $ | debug | ) |
$debug | bool |
Reimplemented from BagOStuff.
Definition at line 54 of file MemcachedPhpBagOStuff.php.
MemcachedPhpBagOStuff::unlock | ( | $ | key | ) |
$key | string |
Reimplemented from BagOStuff.
Definition at line 98 of file MemcachedPhpBagOStuff.php.
References encodeKey().
MemcachedPhpBagOStuff::$client [protected] |
Definition at line 11 of file MemcachedPhpBagOStuff.php.