Changeset 1380
- Timestamp:
- 02/26/08 18:05:19 (6 months ago)
- Files:
-
- trunk/build/stubbles/build.xml (modified) (1 diff)
- trunk/src/main/php/org/stubbles/phing/tasks/stubInitClassLoaderTask.php (added)
- trunk/src/main/php/org/stubbles/phing/tasks/stubInitConfigTask.php (moved) (moved from trunk/src/main/php/org/stubbles/phing/tasks/stubInitTask.php) (6 diffs)
- trunk/src/main/resources/phing/build-stubbles.xml (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/build/stubbles/build.xml
r1368 r1380 98 98 <copy todir="${build.src.dir}/src/main/php/org/stubbles/phing/tasks"> 99 99 <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"/> 101 102 <include name="stubGenerateJsonRpcProxiesTask.php"/> 102 103 <include name="stubGenerateRewriteRulesTask.php"/> trunk/src/main/php/org/stubbles/phing/tasks/stubInitConfigTask.php
r1333 r1380 1 1 <?php 2 2 /** 3 * Task to load stubbles 3 * Task to load stubbles configuration options. 4 4 * 5 5 * @author Stephan Schmidt <schst@stubbles.net> … … 8 8 * @subpackage phing_tasks 9 9 */ 10 11 10 /** 12 11 * Uses the Phing Task … … 14 13 require_once 'phing/Task.php'; 15 14 /** 16 * Task to load stubbles 15 * Task to load stubbles configuration options. 17 16 * 18 17 * @package stubbles 19 18 * @subpackage phing_tasks 20 19 */ 21 class stubInit Task extends Task20 class stubInitConfigTask extends Task 22 21 { 23 22 /** … … 33 32 * @param string $configPath 34 33 */ 35 public function setConfigPath($configPath) { 34 public function setConfigPath($configPath) 35 { 36 36 $this->configPath = realpath($configPath); 37 37 } … … 55 55 throw new BuildException('Error loading Stubbles configuration from ' . $this->configPath . '/php/config.php'); 56 56 } 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 }75 57 76 58 $this->project->setProperty('stubbles.config.path', stubConfig::getConfigPath()); … … 79 61 $this->project->setProperty('stubbles.src.path', stubConfig::getSourcePath()); 80 62 $this->project->setProperty('stubbles.log.path', stubConfig::getLogPath()); 81 82 stubClassLoader::load('net::stubbles::util::stubFactory');83 63 } 84 64 } trunk/src/main/resources/phing/build-stubbles.xml
r1361 r1380 5 5 <property name="processors.dist.file" value="config/xml/processors-dist.xml" /> 6 6 <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}" /> 8 9 <taskDef name="stubGenerateJsonRpcProxies" classname="stubGenerateJsonRpcProxiesTask" classpath="${phing.task.dir}" /> 9 10 <taskDef name="stubGenerateRewriteRules" classname="stubGenerateRewriteRulesTask" classpath="${phing.task.dir}" /> … … 194 195 Loads Stubbles configuration and sets Phing properties 195 196 --> 196 <target name="init-stubbles " description="Loads necessary configuration files.">197 <target name="init-stubbles-config" description="Loads necessary configuration files."> 197 198 <echo>----------------------------------</echo> 198 199 <echo>| Loading Stubbles configuration |</echo> 199 200 <echo>----------------------------------</echo> 200 201 <property file="build.properties" /> 201 <stubInit configPath="${project.basedir}/config/"/>202 <stubInitConfig configPath="${project.basedir}/config/"/> 202 203 <echo>Config directory : ${stubbles.config.path}</echo> 203 204 <echo>Cache directory : ${stubbles.cache.path}</echo> … … 208 209 209 210 <!-- 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 <!-- 210 221 Clears all cache files 211 222 --> 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."> 213 224 <echo>----------------------------------</echo> 214 225 <echo>| Clearing cache |</echo> … … 218 229 <fileset dir="${stubbles.cache.path}"> 219 230 <include name="**/*.cache" /> 231 <include name="**/*.xml" /> 220 232 </fileset> 221 233 </delete>
