comparison InputParser.inc @ 68:4dfa3f6a2dc1

Modify CacheTimeCheck to have a common parent, and two different implementations for script caches and file caches. Support for linkedcaches.
author Tom Fredrik "BFG" Klaussen <bfg@blenning.no>
date Thu, 11 Oct 2012 23:16:53 +0200
parents 74f7b64bdb78
children dd4ddedca4c5
comparison
equal deleted inserted replaced
67:37dee99c1f8c 68:4dfa3f6a2dc1
15 * @todo masterCache is currently used as is, fix so linked caches 15 * @todo masterCache is currently used as is, fix so linked caches
16 * may be used. 16 * may be used.
17 */ 17 */
18 function __construct($name, $masterCache) { 18 function __construct($name, $masterCache) {
19 $this->master = new DOMDocument(); 19 $this->master = new DOMDocument();
20 $cache = $masterCache; 20 $cache = new CacheTimeCheck($name);
21 $cache->cache_time($name); 21 $cache->addParent($masterCache);
22 $this->master->load($name); 22 $this->master->load($name);
23 23
24 $this->options = new Options($this->master); 24 $this->options = new Options($this->master);
25 $this->options->setCache($cache); 25 $this->options->setCache($cache);
26 $this->options->setBasePath(basePath()); 26 $this->options->setBasePath(basePath());
61 * Generate an appropriate response for this page, eg. 302 NOT 61 * Generate an appropriate response for this page, eg. 302 NOT
62 * MODIFIED or the actual page 62 * MODIFIED or the actual page
63 */ 63 */
64 function genPage() 64 function genPage()
65 { 65 {
66 //print_r($this->options->getCache()->cacheSet(1));
67 //exit;
66 if (CACHING && $this->options->getCacheable()) 68 if (CACHING && $this->options->getCacheable())
67 $this->options->getCache()->CheckHttpModified(); 69 $this->options->getCache()->CheckHttpModified();
68
69 print $this->master->saveXml($this->master); 70 print $this->master->saveXml($this->master);
70 //print_r($cache->cacheSet(1));
71 } 71 }
72 72
73 /** 73 /**
74 * Extracts data from a @<param@> tag. 74 * Extracts data from a @<param@> tag.
75 * 75 *