Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

EasyFileCache Class Reference
[EasyCache System]

Inheritance diagram for EasyFileCache:

EasyCache List of all members.

Detailed Description

this class caches data to files in the filesystem.

it is good if you do not have access to memcache (which is the ideal caching solution). The downside to this class is that it must look up each key individually, and you also have to include your CacheLife on gets, because there is no way to store that for the set call. it's generally not a bad option.

Definition at line 350 of file cache.inc.php.

Public Member Functions

 __construct ($path="/tmp/EasyCache/", $life=null)
 create our object.
 get ($key)
 set ($key, $data)
 saves our data to the cache.
 delete ($key)
 deletes our cached data.
 flush ()
 completely wipe the cache and start over

Protected Member Functions

 isCached ($key)
 determines if the data is still cached or not.
 getCachePath ($key)
 get the full path to the cached page file.

Private Attributes

 $path


Member Function Documentation

EasyFileCache::__construct path = "/tmp/EasyCache/",
life = null
 

create our object.

where and how long to store it.

Parameters:
$path the path to store the object. the hash of the data name will be appended directly after this.
$life the life of the cached data in seconds.

Definition at line 361 of file cache.inc.php.

EasyFileCache::delete key  ) 
 

deletes our cached data.

Parameters:
$key the key identifying your data.

Reimplemented from EasyCache.

Definition at line 426 of file cache.inc.php.

References getCachePath().

EasyFileCache::flush  ) 
 

completely wipe the cache and start over

Reimplemented from EasyCache.

Definition at line 436 of file cache.inc.php.

References Util::shellExec().

EasyFileCache::get key  ) 
 

Parameters:
$name a unique name you assign to the data to identify it.

Reimplemented from EasyCache.

Definition at line 375 of file cache.inc.php.

References get(), and isCached().

Referenced by get().

EasyFileCache::getCachePath key  )  [protected]
 

get the full path to the cached page file.

Parameters:
$key the key you assigned to the cache file

Definition at line 474 of file cache.inc.php.

Referenced by delete(), and isCached().

EasyFileCache::isCached key  )  [protected]
 

determines if the data is still cached or not.

checks for nonexistant as well as old/stale data. if its old, it also cleans up.

Parameters:
$key the key you assigned to this data.
Returns:
bool on using cache or not

Definition at line 450 of file cache.inc.php.

References getCachePath().

Referenced by get().

EasyFileCache::set key,
data
 

saves our data to the cache.

Parameters:
$key the key to identify the data.
$data the data to save.
Returns:
the number of bytes written

Reimplemented from EasyCache.

Definition at line 414 of file cache.inc.php.

References set().

Referenced by set().


Member Data Documentation

EasyFileCache::$path [private]
 

Definition at line 352 of file cache.inc.php.


The documentation for this class was generated from the following file:
Generated on Fri Oct 27 12:26:41 2006 for BaseJumper by doxygen 1.3.9.1