MediaWiki  REL1_20
MemcachedPeclBagOStuff Class Reference

A wrapper class for the PECL memcached client. More...

Inheritance diagram for MemcachedPeclBagOStuff:
Collaboration diagram for MemcachedPeclBagOStuff:

List of all members.

Public Member Functions

 __construct ($params)
 Constructor.
 add ($key, $value, $exptime=0)
 decr ($key, $value=1)
 delete ($key, $time=0)
 get ($key)
 getMulti (array $keys)
 incr ($key, $value=1)
 replace ($key, $value, $exptime=0)
 set ($key, $value, $exptime=0)

Protected Member Functions

 checkResult ($key, $result)
 Check the return value from a client method call and take any necessary action.

Detailed Description

A wrapper class for the PECL memcached client.

Definition at line 29 of file MemcachedPeclBagOStuff.php.


Constructor & Destructor Documentation

Constructor.

Available parameters are:

  • servers: The list of IP:port combinations holding the memcached servers.
  • 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
  • serializer: May be either "php" or "igbinary". Igbinary produces more compact values, but serialization is much slower unless the php.ini option igbinary.compact_strings is off.

Definition at line 44 of file MemcachedPeclBagOStuff.php.

References $params, MemcachedBagOStuff\applyDefaultParams(), IP\splitHostAndPort(), and wfDebug().


Member Function Documentation

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

Reimplemented from MemcachedBagOStuff.

Definition at line 147 of file MemcachedPeclBagOStuff.php.

References $value, checkResult(), and MemcachedBagOStuff\debugLog().

MemcachedPeclBagOStuff::checkResult ( key,
result 
) [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.

Parameters:
$keystring The key used by the caller, or false if there wasn't one.
$resultMixed The return value
Returns:
Mixed

Definition at line 196 of file MemcachedPeclBagOStuff.php.

References $result, MemcachedBagOStuff\debugLog(), and wfDebugLog().

Referenced by add(), decr(), delete(), get(), getMulti(), incr(), replace(), and set().

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

Reimplemented from BagOStuff.

Definition at line 179 of file MemcachedPeclBagOStuff.php.

References $result, $value, checkResult(), and MemcachedBagOStuff\debugLog().

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

Reimplemented from MemcachedBagOStuff.

Definition at line 130 of file MemcachedPeclBagOStuff.php.

References $result, checkResult(), and MemcachedBagOStuff\debugLog().

Parameters:
$keystring
Returns:
Mixed

Reimplemented from MemcachedBagOStuff.

Definition at line 109 of file MemcachedPeclBagOStuff.php.

References checkResult(), and MemcachedBagOStuff\debugLog().

Parameters:
$keysArray
Returns:
Array

Reimplemented from BagOStuff.

Definition at line 226 of file MemcachedPeclBagOStuff.php.

References $result, checkResult(), and MemcachedBagOStuff\debugLog().

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

Reimplemented from BagOStuff.

Definition at line 168 of file MemcachedPeclBagOStuff.php.

References $result, $value, checkResult(), and MemcachedBagOStuff\debugLog().

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

Reimplemented from MemcachedBagOStuff.

Definition at line 158 of file MemcachedPeclBagOStuff.php.

References $value, checkResult(), and MemcachedBagOStuff\debugLog().

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

Reimplemented from MemcachedBagOStuff.

Definition at line 120 of file MemcachedPeclBagOStuff.php.

References $value, checkResult(), and MemcachedBagOStuff\debugLog().


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