Class Horde_Cache

Description

The Horde_Cache:: class provides a common abstracted interface into the various caching backends. It also provides functions for checking in, retrieving, and flushing a cache.

$Horde: framework/Cache/Cache.php,v 1.31.10.18 2010/06/13 18:01:37 mrubinsk Exp $

Copyright 1999-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 /Cache/Cache.php (line 19)


	
			
Direct descendents
Class Description
 class Horde_Cache_file The Horde_Cache_file:: class provides a filesystem implementation of the Horde caching system.
 class Horde_Cache_sql The Horde_Cache_sql:: class provides a SQL implementation of the Horde Caching system.
 class Horde_Cache_apc The Horde_Cache_apc:: class provides an Alternative PHP Cache implementation of the Horde caching system.
 class Horde_Cache_eaccelerator The Horde_Cache_eaccelerator:: class provides a eAccelerator content cache (version 0.9.5+) implementation of the Horde caching system.
 class Horde_Cache_zps4 The Horde_Cache_zps4:: class provides a Zend Performance Suite (version 4.0+) implementation of the Horde caching system.
 class Horde_Cache_xcache The Horde_Cache_xcache:: class provides an XCache implementation of the Horde caching system.
 class Horde_Cache_memcache The Horde_Cache_memcache:: class provides a memcached implementation of the Horde caching system.
Variable Summary
 array $_params
Method Summary
 Horde_Cache Horde_Cache ([array $params = array()])
 boolean exists (string $key, [integer $lifetime = 1])
 boolean expire (string $key)
 Horde_Cache factory (mixed $driver, [array $params = array()])
 mixed get (string $key, [integer $lifetime = 1])
 boolean output (string $key, [integer $lifetime = 1])
 boolean set (string $key, mixed $data, [integer $lifetime = null])
 Horde_Cache &singleton (mixed $driver, [array $params = array()])
 void _getLifetime (mixed $lifetime)
Variables
array $_params = array() (line 26)

Cache parameters.

Methods
Constructor Horde_Cache (line 33)

Construct a new Horde_Cache object.

Horde_Cache Horde_Cache ([array $params = array()])
  • array $params: Parameter array.
exists (line 116)

Checks if a given key exists in the cache, valid for the given lifetime.

  • return: Existance.
  • abstract:
boolean exists (string $key, [integer $lifetime = 1])
  • string $key: Cache key to check.
  • integer $lifetime: Lifetime of the key in seconds.

Redefined in descendants as:
expire (line 130)

Expire any existing data for the given key.

  • return: Success or failure.
  • abstract:
boolean expire (string $key)
  • string $key: Cache key to expire.

Redefined in descendants as:
factory (line 162)

Attempts to return a concrete Horde_Cache instance based on $driver.

  • return: The newly created concrete Horde_Cache instance, or false on error.
Horde_Cache factory (mixed $driver, [array $params = array()])
  • mixed $driver: The type of concrete Horde_Cache subclass to return. If $driver is an array, then we will look in $driver[0]/lib/Cache/ for the subclass implementation named $driver[1].php.
  • array $params: A hash containing any additional configuration or connection parameters a subclass might need.
get (line 59)

Attempts to retrieve a cached object and return it to the caller.

  • return: Cached data, or false if none was found.
  • abstract:
mixed get (string $key, [integer $lifetime = 1])
  • string $key: Object ID to query.
  • integer $lifetime: Lifetime of the object in seconds.

Redefined in descendants as:
output (line 94)

Attempts to directly output a cached object.

  • return: True if output or false if no object was found.
  • abstract:
boolean output (string $key, [integer $lifetime = 1])
  • string $key: Object ID to query.
  • integer $lifetime: Lifetime of the object in seconds.

Redefined in descendants as:
set (line 79)

Attempts to store an object in the cache.

  • return: True on success, false on failure.
  • abstract:
  • since: Horde 3.2
boolean set (string $key, mixed $data, [integer $lifetime = null])
  • string $key: Object ID used as the caching key.
  • mixed $data: Data to store in the cache.
  • integer $lifetime: Object lifetime - i.e. the time before the data becomes available for garbage collection. If null use the default Horde GC time. If 0 will not be GC'd.

Redefined in descendants as:
singleton (line 213)

Attempts to return a reference to a concrete Horde_Cache instance based on $driver. It will only create a new instance if no Horde_Cache instance with the same parameters currently exists.

This should be used if multiple cache backends (and, thus, multiple Horde_Cache instances) are required.

This method must be invoked as: $var = &Horde_Cache::singleton()

  • return: The concrete Horde_Cache reference, or PEAR_Error.
Horde_Cache &singleton (mixed $driver, [array $params = array()])
  • mixed $driver: The type of concrete Horde_Cache subclass to return. If $driver is an array, then we will look in $driver[0]/lib/Cache/ for the subclass implementation named $driver[1].php.
  • array $params: A hash containing any additional configuration or connection parameters a subclass might need.
_getLifetime (line 143)

Determine the default lifetime for data.

  • since: Horde 3.2
  • private:
void _getLifetime (mixed $lifetime)
  • mixed $lifetime: The lifetime to use or null for default.

Documentation generated on Sun, 30 Jan 2011 05:15:40 +0000 by phpDocumentor 1.4.3