MediaWiki  REL1_19
MemcachedPhpBagOStuff Class Reference

A wrapper class for the pure-PHP memcached client, exposing a BagOStuff interface. More...

Inheritance diagram for MemcachedPhpBagOStuff:
Collaboration diagram for MemcachedPhpBagOStuff:

List of all members.

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

Detailed Description

A wrapper class for the pure-PHP memcached client, exposing a BagOStuff interface.

Definition at line 6 of file MemcachedPhpBagOStuff.php.


Constructor & Destructor Documentation

Constructor.

Available parameters are:

  • servers: The list of IP:port combinations holding the memcached servers.
  • debug: Whether to set the debug flag in the underlying client.
  • persistent: Whether to use a persistent connection
  • compress_threshold: The minimum size an object must be before it is compressed
  • timeout: The read timeout in microseconds
  • connect_timeout: The connect timeout in seconds
Parameters:
$paramsarray

Definition at line 26 of file MemcachedPhpBagOStuff.php.


Member Function Documentation

MemcachedPhpBagOStuff::add ( key,
value,
exptime = 0 
)
Parameters:
$keystring
$valueint
Returns:
Mixed

Reimplemented from BagOStuff.

Definition at line 107 of file MemcachedPhpBagOStuff.php.

References encodeKey().

Here is the call graph for this function:

Decode a key encoded with encodeKey().

This is provided as a convenience function for debugging.

Parameters:
$keystring
Returns:
string

Definition at line 174 of file MemcachedPhpBagOStuff.php.

MemcachedPhpBagOStuff::decr ( key,
value = 1 
)
Parameters:
$keystring
$valueint
Returns:
Mixed

Reimplemented from BagOStuff.

Definition at line 135 of file MemcachedPhpBagOStuff.php.

References encodeKey().

Here is the call graph for this function:

MemcachedPhpBagOStuff::delete ( key,
time = 0 
)
Parameters:
$keystring
$timeint
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 81 of file MemcachedPhpBagOStuff.php.

References encodeKey().

Here is the call graph for this function:

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().

Here is the caller graph for this function:

Definition at line 162 of file MemcachedPhpBagOStuff.php.

Parameters:
$keystring
Returns:
Mixed

Reimplemented from BagOStuff.

Definition at line 62 of file MemcachedPhpBagOStuff.php.

References encodeKey().

Here is the call graph for this function:

Get the underlying client object.

This is provided for debugging purposes.

Returns:
MemCachedClientforWiki

Definition at line 145 of file MemcachedPhpBagOStuff.php.

MemcachedPhpBagOStuff::incr ( key,
value = 1 
)
Parameters:
$keystring
$valueint
Returns:
Mixed

Reimplemented from BagOStuff.

Definition at line 126 of file MemcachedPhpBagOStuff.php.

References encodeKey().

Here is the call graph for this function:

MemcachedPhpBagOStuff::lock ( key,
timeout = 0 
)
Parameters:
$key
$timeoutint
Returns:

Reimplemented from BagOStuff.

Definition at line 90 of file MemcachedPhpBagOStuff.php.

References encodeKey().

Here is the call graph for this function:

MemcachedPhpBagOStuff::replace ( key,
value,
exptime = 0 
)
Parameters:
$keystring
$valueint
$exptime
Returns:
Mixed

Reimplemented from BagOStuff.

Definition at line 117 of file MemcachedPhpBagOStuff.php.

References encodeKey().

Here is the call graph for this function:

MemcachedPhpBagOStuff::set ( key,
value,
exptime = 0 
)
Parameters:
$keystring
$value
$exptimeint
Returns:
bool

Reimplemented from BagOStuff.

Definition at line 72 of file MemcachedPhpBagOStuff.php.

References encodeKey().

Here is the call graph for this function:

Parameters:
$debugbool

Reimplemented from BagOStuff.

Definition at line 54 of file MemcachedPhpBagOStuff.php.

Parameters:
$keystring
Returns:
Mixed

Reimplemented from BagOStuff.

Definition at line 98 of file MemcachedPhpBagOStuff.php.

References encodeKey().

Here is the call graph for this function:


Member Data Documentation

MemcachedPhpBagOStuff::$client [protected]

Definition at line 11 of file MemcachedPhpBagOStuff.php.


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