Jeff PHP framework
0.99
Modular, extensible, OOP, MVC, lightweight php framework designed to ease the programmers in the development of web applications.
|
Cache implemetation to store html/text/xml outputs. More...
Public Member Functions | |
__construct (&$buffer, $enable=true) | |
Constructs a outputCache instance. | |
start ($grp, $id, $tc) | |
Starts the caching process. | |
stop ($data) | |
Stops the caching process. | |
Protected Attributes | |
$_buffer | |
reference to the output to which add the cached data |
Cache implemetation to store html/text/xml outputs.
$buffer = "previous text-"; $cache = new outputCache($buffer); if($cache->start("group_name", "id", 3600)) { $cache_buffer = "some content-"; $cache->stop($cache_buffer); } $buffer .= "next text";
the result is:
$buffer = "previous text-somec content-next text";
if the content is cached the if statement is skipped and the content is concatenated to $buffer, if content is not cached the if statemet runs, the content is prepared and then saved in cache and added to $buffer (through stop method)
outputCache::__construct | ( | &$ | buffer, |
$ | enable = true |
||
) |
Constructs a outputCache instance.
mixed | &$buffer | reference to the $_buffer variable |
mixed | $enable | status |
Definition at line 183 of file cache.php.
outputCache::start | ( | $ | grp, |
$ | id, | ||
$ | tc | ||
) |
Starts the caching process.
If data are cached and not expired adds data to the $_buffer member and returns false, else returns true.
string | $grp | the output data group |
mixed | $id | the output data identifier |
mixed | $tc | the caching time |
Definition at line 200 of file cache.php.
outputCache::stop | ( | $ | data | ) |
outputCache::$_buffer [protected] |