Public Member Functions | Protected Member Functions | Protected Attributes

FileCache Class Reference

Inheritance diagram for FileCache:
Collaboration diagram for FileCache:

List of all members.

Public Member Functions

 __construct ()

Protected Member Functions

 _has ($name, $group)
 _has_group ($group)
 _get_group ($group)
 _get ($name, $group)
 _set ($name, $value, $expiry, $group, $keep)
 _expire ($name, $group, $match_mode= 'strict')
 _expired ($name, $group)
 _extend ($name, $expiry, $group)
 _purge ()

Protected Attributes

 $cache_location
 $enabled = false
 $cache_files = array()
 $cache_data = array()
 $index_file

Detailed Description

Contains the FileCache class

Stores cache data in local files

Definition at line 14 of file filecache.php.


Constructor & Destructor Documentation

FileCache::__construct (  ) 

Constructor for FileCache

Sets up paths etc. and reads cache index, if it exists.

Definition at line 27 of file filecache.php.


Member Function Documentation

FileCache::_expire ( name,
group,
match_mode = 'strict' 
) [protected]

Expires the named value from the cache.

Parameters:
string $name The name of the cached item
string $group The name of the cache group
string $match_mode (optional) how to match bucket names ('strict', 'regex', 'glob') (default 'strict')

Definition at line 173 of file filecache.php.

FileCache::_expired ( name,
group 
) [protected]

Return whether a named cache value has expired

Parameters:
string $name The name of the cached item
string $group The group of the cached item
Returns:
boolean true if the stored value has expired

Reimplemented from Cache.

Definition at line 229 of file filecache.php.

FileCache::_extend ( name,
expiry,
group 
) [protected]

Extend the expiration of the named cached value.

Parameters:
string $name The name of the cached item
integer $expiry The duration in seconds to extend the cache expiration by

Reimplemented from Cache.

Definition at line 252 of file filecache.php.

FileCache::_get ( name,
group 
) [protected]

Returns the named value from the cache.

Parameters:
string $name The name of the cached item
Returns:
mixed The item value or null if it doesn't exist in cache

Reimplemented from Cache.

Definition at line 122 of file filecache.php.

FileCache::_get_group ( group  )  [protected]

Returns the group from the cache.

Parameters:
string $name The name of the cached item
Returns:
mixed The group or array() if it doesn't exist in cache

Reimplemented from Cache.

Definition at line 96 of file filecache.php.

Referenced by _expire(), and _set().

FileCache::_has ( name,
group 
) [protected]

Is record with $name in the cache?

Parameters:
string $name name of the cached item
Returns:
boolean true if item is cached, false if not

Reimplemented from Cache.

Definition at line 52 of file filecache.php.

FileCache::_has_group ( group  )  [protected]

Is group in the cache?

Parameters:
string $name name of the cached item
Returns:
boolean true if item is cached, false if not

Reimplemented from Cache.

Definition at line 71 of file filecache.php.

FileCache::_purge (  )  [protected]

Remove all cache files

Definition at line 275 of file filecache.php.

FileCache::_set ( name,
value,
expiry,
group,
keep 
) [protected]

A cache instance implements this to set the named value in the cache with an expiration.

Parameters:
string $name The name of the cached item
mixed $value The value to store
integer $expiry Number of second after the call that the cache will expire

Reimplemented from Cache.

Definition at line 139 of file filecache.php.


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