Show
Ignore:
Timestamp:
03/25/08 15:26:56 (8 months ago)
Author:
mikey
Message:

enhancement #133: added unit test for net::stubbles::websites::cache::stubCachingProcessor

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/websites/cache/stubCachingProcessor.php

    r1459 r1460  
    11<?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 */ 
     9stubClassLoader::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 */ 
    318class stubCachingProcessor extends stubBaseObject implements stubProcessor 
    419{ 
     
    3954     * @param  stubCachableProcessor  $processor 
    4055     */ 
    41     public function __construct(stubCachableProcessor $processor
     56    public function __construct(stubCachableProcessor $processor, stubWebsiteCache $websiteCache
    4257    { 
    4358        $this->processor = $processor; 
     
    4560        $this->session   = $this->processor->getSession(); 
    4661        $this->response  = $this->processor->getResponse(); 
     62        $this->cache     = $websiteCache; 
    4763    } 
    4864 
     
    85101    { 
    86102        return $this->response; 
    87     } 
    88  
    89     /** 
    90      * sets the website cache to be used by the processor 
    91      * 
    92      * @param  stubWebsiteCache  $websiteCache 
    93      */ 
    94     public function setWebsiteCache(stubWebsiteCache $websiteCache) 
    95     { 
    96         $this->cache = $websiteCache; 
    97103    } 
    98104 
     
    142148    public function process() 
    143149    { 
    144         $this->cache->addCacheVar('ssl', $this->processor->isSSL()); 
    145150        $isCachable = $this->processor->addCacheVars($this->cache); 
    146151        if (true === $isCachable) { 
     152            $this->cache->addCacheVar('ssl', $this->processor->isSSL()); 
    147153            if ($this->cache->retrieve($this->request, $this->response, $this->processor->getPageName()) === true) { 
    148154                $this->setSessionData();