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

EasyCache Class Reference
[EasyCache System]

Inheritance diagram for EasyCache:

EasyDBCache EasyFileCache EasyMemCache NoCache List of all members.

Detailed Description

A class that handles creating / updating / saving of data to be cached.

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

Public Member Functions

 __construct ($life=null)
 create an EasyCache object.
 get ($key)
 get data from the cache
 set ($key, $data)
 set the data to the cache
 delete ($key)
 delete data from the cache
 flush ()
 completely wipe the cache and start over

Static Public Member Functions

 markCacheHit ($key, $type= 'get')
 mark a hit in the cache.
 drawCacheStats ()
 use then when you've enabled cache tracking.

Static Public Attributes

 $life = 3600
 how long do we store the data for once we set it?)
 $hits = 0
 this is used to track how many cache hits we do per page.

Static Private Attributes

 $keys = array()
 if we have cache tracking on, this will contain all the keys hit.


Member Function Documentation

EasyCache::__construct life = null  ) 
 

create an EasyCache object.

this object will do the actual caching.

Parameters:
$life the default lifespan in seconds of cached data

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

EasyCache::delete key  )  [abstract]
 

delete data from the cache

Parameters:
$key the key to delete from teh cache

Reimplemented in EasyMemCache, EasyFileCache, EasyDBCache, and NoCache.

EasyCache::drawCacheStats  )  [static]
 

use then when you've enabled cache tracking.

it will spit out a list of keys that have been hit, and link them to the Main module where you can view them, and/or delete them.

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

EasyCache::flush  )  [abstract]
 

completely wipe the cache and start over

Reimplemented in EasyMemCache, EasyFileCache, EasyDBCache, and NoCache.

EasyCache::get key  )  [abstract]
 

get data from the cache

Parameters:
$key the key of the data in the cache to get. can be a string or an array of keys to fetch.
Returns:
if the data is found, it will return the data as the appropriate object. if not found, it will return false. if you passed in an array, the return will be an array with the same keys, with either data or false for values, as appropriate.

Reimplemented in EasyMemCache, EasyFileCache, EasyDBCache, and NoCache.

EasyCache::markCacheHit key,
type = 'get'
[static]
 

mark a hit in the cache.

if 'bj_track_cache' is set in the config, it will also track which keys are hit.

Parameters:
$key the key that you hit
$type the type of cache hit: get, set, delete

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

References Config::get().

EasyCache::set key,
data
[abstract]
 

set the data to the cache

Parameters:
$key the key to save the data under
$data the data to save to cache. this can be anything, the cachebot will automatically run any variable through serialize and unserialize to make it as seamless as possible.

Reimplemented in EasyMemCache, EasyFileCache, EasyDBCache, and NoCache.


Member Data Documentation

EasyCache::$hits = 0 [static]
 

this is used to track how many cache hits we do per page.

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

EasyCache::$keys = array() [static, private]
 

if we have cache tracking on, this will contain all the keys hit.

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

EasyCache::$life = 3600 [static]
 

how long do we store the data for once we set it?)

Definition at line 145 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