Class Horde_Cache_file

Description

The Horde_Cache_file:: class provides a filesystem implementation of the Horde caching system.

Optional parameters:

   'dir'     The base directory to store the cache files in.
   'prefix'  The filename prefix to use for the cache files.
   'sub'     An integer. If non-zero, the number of subdirectories to
             create to store the file (i.e. PHP's session.save_path).

$Horde: framework/Cache/Cache/file.php,v 1.28.10.21 2009/01/06 15:22:56 jan 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/file.php (line 24)

Horde_Cache
   |
   --Horde_Cache_file
Variable Summary
 string $_dir
 array $_file
 string $_prefix
 integer $_sub
Method Summary
 Horde_Cache_file Horde_Cache_file ([array $params = array()])
 boolean exists (string $key, [integer $lifetime = 1])
 boolean expire (string $key)
 mixed get (string $key, [integer $lifetime = 1])
 boolean output (string $key, [integer $lifetime = 1])
 boolean set (string $key, mixed $data, [integer $lifetime = null])
 void _gcDir ( $dir,  &$excepts)
Variables
string $_dir (line 31)

The location of the temp directory.

array $_file = array() (line 52)

List of key to filename mappings.

string $_prefix = 'cache_' (line 38)

The filename prefix for cache files.

integer $_sub = 0 (line 45)

The subdirectory level the cache files should live at.

Inherited Variables

Inherited from Horde_Cache

Horde_Cache::$_params
Methods
Constructor Horde_Cache_file (line 59)

Construct a new Horde_Cache_file object.

Horde_Cache_file Horde_Cache_file ([array $params = array()])
  • array $params: Parameter array.
exists (line 167)

Checks if a given key exists in the cache, valid for the given lifetime. If it exists but is expired, delete the file.

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

Redefinition of:
Horde_Cache::exists()
Checks if a given key exists in the cache, valid for the given lifetime.
expire (line 197)

Expire any existing data for the given key.

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

Redefinition of:
Horde_Cache::expire()
Expire any existing data for the given key.
get (line 93)

Attempts to retrieve cached data from the filesystem and return it to the caller.

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

Redefinition of:
Horde_Cache::get()
Attempts to retrieve a cached object and return it to the caller.
output (line 211)

Attempts to directly output a cached object.

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

Redefinition of:
Horde_Cache::output()
Attempts to directly output a cached object.
set (line 120)

Attempts to store data to the filesystem.

  • return: True on success, false on failure.
boolean set (string $key, mixed $data, [integer $lifetime = null])
  • string $key: Cache key.
  • mixed $data: Data to store in the cache. (MUST BE A STRING)
  • integer $lifetime: Data lifetime. @since Horde 3.2

Redefinition of:
Horde_Cache::set()
Attempts to store an object in the cache.
_gcDir (line 299)
  • private:
void _gcDir ( $dir,  &$excepts)
  • $dir
  • &$excepts

Inherited Methods

Inherited From Horde_Cache

 Horde_Cache::Horde_Cache()
 Horde_Cache::exists()
 Horde_Cache::expire()
 Horde_Cache::factory()
 Horde_Cache::get()
 Horde_Cache::output()
 Horde_Cache::set()
 Horde_Cache::singleton()
 Horde_Cache::_getLifetime()

Documentation generated on Sun, 30 Jan 2011 05:17:14 +0000 by phpDocumentor 1.4.3