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

Cache implemetation to store html/text/xml outputs. More...

+ Inheritance diagram for outputCache:
+ Collaboration diagram for outputCache:

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

Detailed Description

Cache implemetation to store html/text/xml outputs.

Usage

 $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)

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

Definition at line 169 of file cache.php.


Constructor & Destructor Documentation

outputCache::__construct ( &$  buffer,
enable = true 
)

Constructs a outputCache instance.

Parameters:
mixed&$bufferreference to the $_buffer variable
mixed$enablestatus
Returns:
outputCache instance

Definition at line 183 of file cache.php.

+ Here is the call graph for this function:


Member Function Documentation

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.

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

Definition at line 200 of file cache.php.

+ Here is the call graph for this function:

outputCache::stop ( data)

Stops the caching process.

Writes data to file and adds it to the $_buffer member.

Parameters:
string$datathe output data
Returns:
void

Definition at line 223 of file cache.php.

+ Here is the call graph for this function:


Field Documentation

outputCache::$_buffer [protected]

reference to the output to which add the cached data

Definition at line 174 of file cache.php.


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