Changeset 1744

Show
Ignore:
Timestamp:
07/28/08 10:41:40 (4 months ago)
Author:
mikey
Message:

support for setting an own config file

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • framework/trunk/src/main/php/org/stubbles/phing/tasks/stubInitConfigTask.php

    r1641 r1744  
    2121{ 
    2222    /** 
    23      * Target folder of the generated proxy files 
     23     * path where config file can be found 
    2424     * 
    25      * @var string 
     25     * @var string 
    2626     */ 
    2727    protected $configPath; 
     28    /** 
     29     * config file to use 
     30     * 
     31     * @var  string 
     32     */ 
     33    protected $configFile = 'php/config.php'; 
    2834 
    2935    /** 
    30      * set the config path 
     36     * sets the config path 
    3137     * 
    3238     * @param  string  $configPath 
     
    3541    { 
    3642        $this->configPath = realpath($configPath); 
     43    } 
     44 
     45    /** 
     46     * sets the config file 
     47     * 
     48     * @param  string  $configFile 
     49     */ 
     50    public function setConfigFile($configFile) 
     51    { 
     52        $this->configFile = $configFile; 
    3753    } 
    3854 
     
    5066    public function main() 
    5167    { 
    52         @include_once $this->configPath . '/php/config.php'
     68        @include_once $this->configPath . DIRECTORY_SEPARATOR . $this->configFile
    5369        if (!class_exists('stubConfig', false)) { 
    54             $this->log('Error loading Stubbles configuration from ' . $this->configPath . '/php/config.php', Project::MSG_ERR); 
    55             throw new BuildException('Error loading Stubbles configuration from ' . $this->configPath . '/php/config.php'); 
     70            $this->log('Error loading Stubbles configuration from ' . $this->configPath . DIRECTORY_SEPARATOR . $this->configFile, Project::MSG_ERR); 
     71            throw new BuildException('Error loading Stubbles configuration from ' . $this->configPath . DIRECTORY_SEPARATOR . $this->configFile); 
    5672        } 
    5773    } 
  • framework/trunk/src/main/resources/phing/build-stubbles.xml

    r1705 r1744  
    172172      <isset property="first.project"/> 
    173173      <then> 
    174         <stubInitConfig configPath="${stubbles.projects.path}/${first.project}/config"/> 
     174        <if> 
     175          <isset property="config.file"/> 
     176          <then> 
     177            <stubInitConfig configPath="${stubbles.projects.path}/${first.project}/config" 
     178                            configFile="${config.file}"/> 
     179          </then> 
     180          <else> 
     181            <stubInitConfig configPath="${stubbles.projects.path}/${first.project}/config"/> 
     182          </else> 
     183        </if> 
    175184        <stubInitClassLoader/> 
    176185        <foreach list="${projects}" param="stubbles.project" target="generate-client-project"/>