Changeset 1380

Show
Ignore:
Timestamp:
02/26/08 18:05:19 (6 months ago)
Author:
mikey
Message:

fixed bug #124: target clear-cache in build-stubbles.xml fails on updated stubbles.php

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/stubbles/build.xml

    r1368 r1380  
    9898    <copy todir="${build.src.dir}/src/main/php/org/stubbles/phing/tasks"> 
    9999      <fileset dir="${stubbles.base.dir}/src/main/php/org/stubbles/phing/tasks/"> 
    100         <include name="stubInitTask.php"/> 
     100        <include name="stubInitConfigTask.php"/> 
     101        <include name="stubInitClassLoaderTask.php"/> 
    101102        <include name="stubGenerateJsonRpcProxiesTask.php"/> 
    102103        <include name="stubGenerateRewriteRulesTask.php"/> 
  • trunk/src/main/php/org/stubbles/phing/tasks/stubInitConfigTask.php

    r1333 r1380  
    11<?php 
    22/** 
    3  * Task to load stubbles 
     3 * Task to load stubbles configuration options. 
    44 * 
    55 * @author      Stephan Schmidt <schst@stubbles.net> 
     
    88 * @subpackage  phing_tasks 
    99 */ 
    10  
    1110/** 
    1211 * Uses the Phing Task 
     
    1413require_once 'phing/Task.php'; 
    1514/** 
    16  * Task to load stubbles 
     15 * Task to load stubbles configuration options. 
    1716 * 
    1817 * @package     stubbles 
    1918 * @subpackage  phing_tasks 
    2019 */ 
    21 class stubInitTask extends Task 
     20class stubInitConfigTask extends Task 
    2221{ 
    2322    /** 
     
    3332     * @param  string  $configPath 
    3433     */ 
    35     public function setConfigPath($configPath) { 
     34    public function setConfigPath($configPath) 
     35    { 
    3636        $this->configPath = realpath($configPath); 
    3737    } 
     
    5555            throw new BuildException('Error loading Stubbles configuration from ' . $this->configPath . '/php/config.php'); 
    5656        } 
    57         if (stubConfig::useStar() == true) { 
    58             if (!@include_once stubConfig::getLibPath() . '/stubbles.php') { 
    59                 $this->log('Error loading Stubbles library from ' . stubConfig::getLibPath() . '/stubbles.php', Project::MSG_ERR); 
    60                 $this->log('Either stubConfig::getLibPath() is not correctly set, or stubbles.php does not exist.', Project::MSG_ERR); 
    61                 throw new BuildException('Error loading Stubbles library from ' . stubConfig::getLibPath() . '/stubbles.php'); 
    62             } 
    63         } else { 
    64             if (!@include_once stubConfig::getLibPath() . '/starReader.php') { 
    65                 $this->log('Error loading StarReader from ' . stubConfig::getLibPath() . '/starReader.php', Project::MSG_ERR); 
    66                 $this->log('Either stubConfig::getLibPath() is not correctly set, or starReader.php does not exist.', Project::MSG_ERR); 
    67                 throw new BuildException('Error loading StarReader from ' . stubConfig::getLibPath() . '/starReader.php'); 
    68             } 
    69             if (!@include_once stubConfig::getSourcePath() . '/php/net/stubbles/stubClassLoader.php') { 
    70                 $this->log('Error loading stubClassLoader from ' . stubConfig::getSourcePath() . '/php/net/stubbles/stubClassLoader.php', Project::MSG_ERR); 
    71                 $this->log('Either stubConfig::getSourcePath() is not correctly set, or you are not using a source distribution.', Project::MSG_ERR); 
    72                 throw new BuildException('Error loading stubClassLoader from ' . stubConfig::getSourcePath() . '/php/net/stubbles/stubClassLoader.php'); 
    73             } 
    74         } 
    7557 
    7658        $this->project->setProperty('stubbles.config.path', stubConfig::getConfigPath()); 
     
    7961        $this->project->setProperty('stubbles.src.path', stubConfig::getSourcePath()); 
    8062        $this->project->setProperty('stubbles.log.path', stubConfig::getLogPath()); 
    81  
    82         stubClassLoader::load('net::stubbles::util::stubFactory'); 
    8363    } 
    8464} 
  • trunk/src/main/resources/phing/build-stubbles.xml

    r1361 r1380  
    55  <property name="processors.dist.file" value="config/xml/processors-dist.xml" /> 
    66  <property name="processors.all" value="xml,page,jsonrpc" /> 
    7   <taskDef name="stubInit" classname="stubInitTask" classpath="${phing.task.dir}" /> 
     7  <taskDef name="stubInitConfig" classname="stubInitConfigTask" classpath="${phing.task.dir}" /> 
     8  <taskDef name="stubInitClassLoader" classname="stubInitClassLoaderTask" classpath="${phing.task.dir}" /> 
    89  <taskDef name="stubGenerateJsonRpcProxies" classname="stubGenerateJsonRpcProxiesTask" classpath="${phing.task.dir}" /> 
    910  <taskDef name="stubGenerateRewriteRules" classname="stubGenerateRewriteRulesTask" classpath="${phing.task.dir}" /> 
     
    194195    Loads Stubbles configuration and sets Phing properties 
    195196  --> 
    196   <target name="init-stubbles" description="Loads necessary configuration files."> 
     197  <target name="init-stubbles-config" description="Loads necessary configuration files."> 
    197198    <echo>----------------------------------</echo> 
    198199    <echo>| Loading Stubbles configuration |</echo> 
    199200    <echo>----------------------------------</echo> 
    200201    <property file="build.properties" /> 
    201     <stubInit configPath="${project.basedir}/config/"/> 
     202    <stubInitConfig configPath="${project.basedir}/config/"/> 
    202203    <echo>Config directory : ${stubbles.config.path}</echo> 
    203204    <echo>Cache directory  : ${stubbles.cache.path}</echo> 
     
    208209 
    209210  <!-- 
     211    Loads Stubbles class loader 
     212  --> 
     213  <target name="init-stubbles" depends="init-stubbles-config" description="Loads class loader."> 
     214    <echo>----------------------------------</echo> 
     215    <echo>| Loading Stubbles classloader   |</echo> 
     216    <echo>----------------------------------</echo> 
     217    <stubInitClassLoader/> 
     218  </target> 
     219 
     220  <!-- 
    210221   Clears all cache files 
    211222  --> 
    212   <target name="clear-cache" depends="init-stubbles" description="Removes all cache files."> 
     223  <target name="clear-cache" depends="init-stubbles-config" description="Removes all cache files."> 
    213224    <echo>----------------------------------</echo> 
    214225    <echo>| Clearing cache                 |</echo> 
     
    218229      <fileset dir="${stubbles.cache.path}"> 
    219230        <include name="**/*.cache" /> 
     231        <include name="**/*.xml" /> 
    220232      </fileset> 
    221233    </delete>