Changeset 679

Show
Ignore:
Timestamp:
05/28/07 15:21:54 (1 year ago)
Author:
mikey
Message:

added possibility to switch the config source of the registry (fixes ticket #50)

Files:

Legend:

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

    r385 r679  
    1616{ 
    1717    /** 
     18     * sets the config source 
     19     * 
     20     * @param  string  $source 
     21     */ 
     22    public function setConfigSource($source); 
     23     
     24    /** 
    1825     * initialize the Registry with configuration values 
    1926     * 
  • trunk/src/main/php/net/stubbles/util/stubRegistryXJConfInitializer.php

    r584 r679  
    2020{ 
    2121    /** 
     22     * name of the configuration file to use 
     23     * 
     24     * @var  string 
     25     */ 
     26    protected $source = 'config'; 
     27 
     28    /** 
     29     * sets the config source 
     30     * 
     31     * @param  string  $source 
     32     */ 
     33    public function setConfigSource($source) 
     34    { 
     35        $this->source = $source; 
     36    } 
     37 
     38    /** 
    2239     * returns the descriptor that identifies this initializer 
    2340     * 
     
    2643    public function getDescriptor() 
    2744    { 
    28         return 'config'
     45        return $this->source
    2946    } 
    3047 
  • trunk/src/test/php/net/stubbles/util/stubRegistryXJConfInitializerTestCase.php

    r538 r679  
    4747    { 
    4848        $this->assertEqual($this->registryXJConfInitializer->getDescriptor(), 'config'); 
     49        $this->registryXJConfInitializer->setConfigSource('test'); 
     50        $this->assertEqual($this->registryXJConfInitializer->getDescriptor(), 'test'); 
    4951    } 
    5052