Jeff PHP framework  0.99
Modular, extensible, OOP, MVC, lightweight php framework designed to ease the programmers in the development of web applications.
dataCache Class Reference

Cache implementation to store data structures. More...

+ Inheritance diagram for dataCache:
+ Collaboration diagram for dataCache:

Public Member Functions

 __construct ($enable=true)
 Constructs a dataCache instance.
 get ($grp, $id, $tc)
 Tries to retrieve cached data.
 save ($data)
 Saves data in cache.

Detailed Description

Cache implementation to store data structures.

Usage

 $cache = new dataCache();
 if(!$data = $cache->get('group_name', 'id', 3600)) {

        $data = someCalculations();
        $cache->save($data);

}

if data is stored it's returned by get method and if statement is not processed, otherwise data is calculated and saved in cache

Author:
abidibo abidi.nosp@m.bo@g.nosp@m.mail..nosp@m.com
Version:
0.99
Date:
2011-2012

Definition at line 256 of file cache.php.


Constructor & Destructor Documentation

dataCache::__construct ( enable = true)

Constructs a dataCache instance.

Parameters:
mixed$enablestatus
Returns:
dataCache instance

Definition at line 264 of file cache.php.

+ Here is the call graph for this function:


Member Function Documentation

dataCache::get ( grp,
id,
tc 
)

Tries to retrieve cached data.

If data are cached and not expired returns them, else returns false.

Parameters:
string$grpthe output data group
mixed$idthe output data identifier
mixed$tcthe caching time
Returns:
data if are already cached and not expired, false otherwise

Definition at line 282 of file cache.php.

+ Here is the call graph for this function:

dataCache::save ( data)

Saves data in cache.

Parameters:
string$datathe data to put in cache
Returns:
void

Definition at line 299 of file cache.php.

+ Here is the call graph for this function:


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