4 * This class extends Cache_Lite and uses output buffering to get the data to cache.
6 * There are some examples in the 'docs/examples' file
7 * Technical choices are described in the 'docs/technical' file
10 * @version $Id: Output.php,v 1.4 2006/01/29 00:22:07 fab Exp $
11 * @author Fabien MARTY <fab@php.net>
14 require_once('Cache/Lite.php');
16 class Cache_Lite_Output
extends Cache_Lite
19 // --- Public methods ---
24 * $options is an assoc. To have a look at availables options,
25 * see the constructor of the Cache_Lite class in 'Cache_Lite.php'
27 * @param array $options options
30 function Cache_Lite_Output($options)
32 $this->Cache_Lite($options);
38 * @param string $id cache id
39 * @param string $group name of the cache group
40 * @param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested
41 * @return boolean true if the cache is hit (false else)
44 function start($id, $group = 'default', $doNotTestCacheValidity = false)
46 $data = $this->get($id, $group, $doNotTestCacheValidity);
47 if ($data !== false) {
52 ob_implicit_flush(false);
63 $data = ob_get_contents();
65 $this->save($data, $this->_id
, $this->_group
);