Overview

Packages

  • Cache

Classes

  • Horde_Cache
  • Horde_Cache_Exception
  • Horde_Cache_Storage_Apc
  • Horde_Cache_Storage_Base
  • Horde_Cache_Storage_Eaccelerator
  • Horde_Cache_Storage_File
  • Horde_Cache_Storage_Memcache
  • Horde_Cache_Storage_Mock
  • Horde_Cache_Storage_Null
  • Horde_Cache_Storage_Session
  • Horde_Cache_Storage_Sql
  • Horde_Cache_Storage_Stack
  • Horde_Cache_Storage_Xcache
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Cache_Storage_File

This class provides cache storage in the filesystem.

Copyright 1999-2012 Horde LLC (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Horde_Cache_Storage_Base
Extended by Horde_Cache_Storage_File
Package: Cache
Category: Horde
License: LGPL 2.1
Author: Anil Madhavapeddy anil@recoil.org
Author: Chuck Hagenbuch chuck@horde.org
Author: Michael Slusarz slusarz@horde.org
Located at Horde/Cache/Storage/File.php
Methods summary
public
# __construct( array $params = array() )

Constructor.

Constructor.

Parameters

$params
Optional parameters: <pre><span class="php-quote">'dir'</span> - (string) The base directory to store the cache files in. <span class="php-keyword1">DEFAULT</span>: <span class="php-keyword2">System</span> <span class="php-keyword1">default</span> <span class="php-quote">'prefix'</span> - (string) The filename prefix to <span class="php-keyword1">use</span> <span class="php-keyword1">for</span> the cache files. <span class="php-keyword1">DEFAULT</span>: <span class="php-quote">'cache_'</span> <span class="php-quote">'sub'</span> - (integer) <span class="php-keyword1">If</span> non-zero, the number of subdirectories to create to store the <span class="php-keyword2">file</span> (i.e. PHP<span class="php-quote">'s session.save_path). DEFAULT: 0</span></pre>

Overrides

Horde_Cache_Storage_Base::__construct()
public
# __destruct( )

Destructor.

Destructor.

public mixed
# get( string $key, integer $lifetime = 0 )

Parameters

$key
Object ID to query.
$lifetime
Lifetime of the object in seconds.

Returns

mixed
Cached data, or false if none was found.
public
# set( string $key, mixed $data, integer $lifetime = 0 )

Parameters

$key
Object ID used as the caching key.
$data
Data to store in the cache.
$lifetime
<p>Object lifetime - i.e. the time before the data becomes available for garbage collection. If 0 will not be GC'd.</p>
public boolean
# exists( string $key, integer $lifetime = 0 )

Parameters

$key
Cache key to check.
$lifetime
Lifetime of the key in seconds.

Returns

boolean
Existence.
public boolean
# expire( string $key )

Parameters

$key
Cache key to expire.

Returns

boolean
Success or failure.
public
# clear( )

Throws

Horde_Cache_Exception
Methods inherited from Horde_Cache_Storage_Base
setLogger()
Constants summary
string GC_FILE
# 'horde_cache_gc'
API documentation generated by ApiGen