- Timestamp:
- 03/25/08 15:26:56 (8 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/websites/cache/stubCachingProcessor.php
r1459 r1460 1 1 <?php 2 2 /** 3 * Processor that can be applied onto any processor implementing the stubCachableProcessor interface. 4 * 5 * @author Frank Kleine <mikey@stubbles.net> 6 * @package stubbles 7 * @subpackage websites_cache 8 */ 9 stubClassLoader::load('net::stubbles::websites::cache::stubCachableProcessor', 10 'net::stubbles::websites::cache::stubWebsiteCache' 11 ); 12 /** 13 * Processor that can be applied onto any processor implementing the stubCachableProcessor interface. 14 * 15 * @package stubbles 16 * @subpackage websites_cache 17 */ 3 18 class stubCachingProcessor extends stubBaseObject implements stubProcessor 4 19 { … … 39 54 * @param stubCachableProcessor $processor 40 55 */ 41 public function __construct(stubCachableProcessor $processor )56 public function __construct(stubCachableProcessor $processor, stubWebsiteCache $websiteCache) 42 57 { 43 58 $this->processor = $processor; … … 45 60 $this->session = $this->processor->getSession(); 46 61 $this->response = $this->processor->getResponse(); 62 $this->cache = $websiteCache; 47 63 } 48 64 … … 85 101 { 86 102 return $this->response; 87 }88 89 /**90 * sets the website cache to be used by the processor91 *92 * @param stubWebsiteCache $websiteCache93 */94 public function setWebsiteCache(stubWebsiteCache $websiteCache)95 {96 $this->cache = $websiteCache;97 103 } 98 104 … … 142 148 public function process() 143 149 { 144 $this->cache->addCacheVar('ssl', $this->processor->isSSL());145 150 $isCachable = $this->processor->addCacheVars($this->cache); 146 151 if (true === $isCachable) { 152 $this->cache->addCacheVar('ssl', $this->processor->isSSL()); 147 153 if ($this->cache->retrieve($this->request, $this->response, $this->processor->getPageName()) === true) { 148 154 $this->setSessionData();
