![]() |
Jeff PHP framework
0.99
Modular, extensible, OOP, MVC, lightweight php framework designed to ease the programmers in the development of web applications.
|
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. | |
Cache implementation to store data structures.
$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
| dataCache::__construct | ( | $ | enable = true | ) |
| dataCache::get | ( | $ | grp, |
| $ | id, | ||
| $ | tc | ||
| ) |
Tries to retrieve cached data.
If data are cached and not expired returns them, else returns false.
| string | $grp | the output data group |
| mixed | $id | the output data identifier |
| mixed | $tc | the caching time |
Definition at line 282 of file cache.php.
Here is the call graph for this function:| dataCache::save | ( | $ | data | ) |