Changeset 742

Show
Ignore:
Timestamp:
06/21/07 16:49:13 (1 year ago)
Author:
mikey
Message:

added possibility to configure cache via xjconf

Files:

Legend:

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

    r741 r742  
    1313 * @subpackage  util_cache 
    1414 */ 
    15 abstract class stubAbstractCacheContainer extends stubBaseObject 
     15abstract class stubAbstractCacheContainer extends stubSerializableObject 
    1616{ 
    1717    /** 
     
    3838     * 
    3939     * @param  string             $id        id of the container 
    40      * @param  stubCacheStrategy  $strategy  strategy the container should use 
    41      */ 
    42     public function __construct($id, stubCacheStrategy $strategy) 
    43     { 
    44         $this->id       = $id; 
    45         $this->strategy = $strategy; 
     40     */ 
     41    public function __construct($id) 
     42    { 
     43        $this->id = $id; 
    4644    } 
    4745 
  • trunk/src/main/php/net/stubbles/util/cache/stubCache.php

    r738 r742  
    6363        return isset(self::$containers[$id]); 
    6464    } 
     65 
     66    /** 
     67     * returns a list of all container ids 
     68     * 
     69     * @return  array<string> 
     70     */ 
     71    public static function getContainerIds() 
     72    { 
     73        return array_keys(self::$containers); 
     74    } 
    6575} 
    6676?> 
  • trunk/src/main/php/net/stubbles/util/cache/stubCacheContainer.php

    r741 r742  
    1414 * @subpackage  util_cache 
    1515 */ 
    16 interface stubCacheContainer extends stubObject 
     16interface stubCacheContainer extends stubObject, stubSerializable 
    1717{ 
    1818    /** 
  • trunk/src/main/php/net/stubbles/util/cache/stubCacheStrategy.php

    r741 r742  
    1414 * @subpackage  util_cache 
    1515 */ 
    16 interface stubCacheStrategy extends stubObject 
     16interface stubCacheStrategy extends stubObject, stubSerializable 
    1717{ 
    1818    /** 
  • trunk/src/main/php/net/stubbles/util/cache/stubDefaultCacheStrategy.php

    r741 r742  
    1414 * @subpackage  util_cache 
    1515 */ 
    16 class stubDefaultCacheStrategy extends stubBaseObject implements stubCacheStrategy 
     16class stubDefaultCacheStrategy extends stubSerializableObject implements stubCacheStrategy 
    1717{ 
    1818    /** 
  • trunk/src/test/php/net/stubbles/util/cache/stubAbstractCacheContainerTestCase.php

    r741 r742  
    9898    { 
    9999        $this->mockCacheStrategy = new MockstubCacheStrategy(); 
    100         $this->cacheContainer   = new TeststubAbstractCacheContainer('foo', $this->mockCacheStrategy); 
     100        $this->cacheContainer    = new TeststubAbstractCacheContainer('foo'); 
     101        $this->cacheContainer->setStrategy($this->mockCacheStrategy); 
    101102    } 
    102103 
  • trunk/src/test/php/net/stubbles/util/cache/stubFileCacheContainerTestCase.php

    r741 r742  
    4343        $this->cacheDirectory    = TEST_SRC_PATH . '/tmp/util_cache'; 
    4444        $this->mockCacheStrategy = new MockstubCacheStrategy(); 
    45         $this->cacheContainer    = new stubFileCacheContainer('foo', $this->mockCacheStrategy); 
     45        $this->cacheContainer    = new stubFileCacheContainer('foo'); 
     46        $this->cacheContainer->setStrategy($this->mockCacheStrategy); 
    4647        $this->cacheContainer->setCacheDirectory($this->cacheDirectory); 
    4748        $this->cacheDirectory   .= '/foo'; 
  • trunk/src/test/runIntegration.php

    r740 r742  
    3232         
    3333        $testSuite->addTestFile(TEST_SRC_PATH . '/php/net/stubbles/integration/AnnotationTestCase.php'); 
     34        $testSuite->addTestFile(TEST_SRC_PATH . '/php/net/stubbles/integration/CacheTestCase.php'); 
    3435        $testSuite->addTestFile(TEST_SRC_PATH . '/php/net/stubbles/integration/DatabaseTestCase.php'); 
    3536        $testSuite->addTestFile(TEST_SRC_PATH . '/php/net/stubbles/integration/InterceptorTestCase.php');