Class Horde_Memcache

Description

The Horde_memcache:: class provides easy access for Horde code to a centrally configured memcache installation.

memcached website: http://www.danga.com/memcached/

$Horde: framework/Memcache/lib/Horde/Memcache.php,v 1.1.2.7 2009/07/23 20:29:44 slusarz Exp $

Configuration parameters (set in $conf['memcache']):

   'compression' - Compress data inside memcache?
                   DEFAULT: false
   'c_threshold' - The minimum value length before attempting to compress.
                   DEFAULT: none
   'hostspec'    - The memcached host(s) to connect to.
                   DEFAULT: 'localhost'
   'large_items' - Allow storing large data items (larger than
                   MEMCACHE_MAX_SIZE)?
                   DEFAULT: true
   'persistent'  - Use persistent DB connections?
                   DEFAULT: false
   'prefix'      - The prefix to use for the memcache keys.
                   DEFAULT: 'horde'
   'port'        - The port(s) memcache is listening on. Leave empty or set
                   to 0 if using UNIX sockets.
                   DEFAULT: 11211
   'weight'      - The weight to use for each memcached host.
                   DEFAULT: none (equal weight to all servers)

Copyright 2007-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /Memcache/lib/Horde/Memcache.php (line 49)


	
			
Variable Summary
 boolean $_large
 Memcache $_memcache
 array $_noexist
 array $_params
Method Summary
 Horde_Memcache Horde_Memcache ()
 boolean delete (string $key, [integer $timeout = 0])
 void flush ()
 mixed get (mixed $keys)
 void lock (string $key)
 boolean replace (string $key, string $var, [ $expire = 0], integer $timeout)
 boolean set (string $key, string $var, [ $expire = 0], integer $timeout)
 void &singleton ()
 array stats ()
 void unlock (string $key)
 boolean _set (string $key, string $var, [ $expire = 0], [ $len = null], integer $timeout, integer $lent)
Variables
boolean $_large = true (line 76)

Allow large data items?

Memcache $_memcache (line 56)

Memcache object.

array $_noexist = array() (line 83)

A list of items known not to exist.

array $_params = array(
'compression' => 0,
'hostspec' => 'localhost',
'large_items' => true,
'persistent' => false,
'port' => 11211,
)
(line 63)

Memcache defaults.

Methods
Constructor Horde_Memcache (line 102)

Constructor.

Horde_Memcache Horde_Memcache ()
delete (line 141)

Delete a key.

  • return: True on success.
  • see: Memcache::delete()
boolean delete (string $key, [integer $timeout = 0])
  • string $key: The key.
  • integer $timeout: Expiration time in seconds.
flush (line 385)

Mark all entries on a memcache installation as expired.

void flush ()
get (line 166)

Get data associated with a key.

  • return: The string/array on success (return type is the type of $keys), false on failure.
  • see: Memcache::get()
mixed get (mixed $keys)
  • mixed $keys: The key or an array of keys.
lock (line 363)

Obtain lock on a key.

void lock (string $key)
  • string $key: The key to lock.
replace (line 331)

Replace the value of a key.

  • return: True on success, false if key doesn't exist.
  • see: Memcache::replace()
boolean replace (string $key, string $var, [ $expire = 0], integer $timeout)
  • string $key: The key.
  • string $var: The data to store.
  • integer $timeout: Expiration time in seconds.
  • $expire
set (line 266)

Set the value of a key.

  • return: True on success.
  • see: Memcache::set()
boolean set (string $key, string $var, [ $expire = 0], integer $timeout)
  • string $key: The key.
  • string $var: The data to store.
  • integer $timeout: Expiration time in seconds.
  • $expire
singleton (line 88)

Singleton.

void &singleton ()
stats (line 396)

Get the statistics output from the current memcache pool.

  • return: The output from Memcache::getExtendedStats() using the current Horde configuration values.
array stats ()
unlock (line 377)

Release lock on a key.

void unlock (string $key)
  • string $key: The key to lock.
_set (line 287)

Set the value of a key.

  • return: True on success.
  • private:
boolean _set (string $key, string $var, [ $expire = 0], [ $len = null], integer $timeout, integer $lent)
  • string $key: The key.
  • string $var: The data to store (serialized).
  • integer $timeout: Expiration time in seconds.
  • integer $lent: String length of $len.
  • $expire
  • $len

Documentation generated on Sun, 30 Jan 2011 05:19:34 +0000 by phpDocumentor 1.4.3