Phing 是一个基于Apache ANT 的项目构建系统,phing内置可以执行一系列替换
比如:在你的开发版本和产品版本间改变include路径、执行SQL语句、移动和复制文件、运行外部脚本等等
安装命令
#清除缓存
pearclear-cache
#(更新pear)
pearupgrade-all
# 安装Phpdocumentor
pearchannel-discover pear.phing.info
pearinstall --alldeps phing/phing
参考文档:
官网:
安装参考:
http://www.phing.info/trac/wiki/Users/Installation
执行命令
#执行build.xml 默认任务
phing
#执行build.xml 中 test 任务
phing test
自动化
phing 默认配置文件为:build.xml.
下面通过.xml 文件来介绍一下build.xml标签的用法与含义
<?xml version="1.0"encoding="UTF-8"?>
<project name="WMS" basedir="." default="exec">
<!--构建后清理-->
<target name="clean">
<delete dir="build"/>
<delete dir="src/Runtime"/>
</target>
<!--构建前准备-->
<target name="prepare">
<mkdir dir="build"/>
</target>
<!--生成api,打包发送到VSS,提示输入版本号-->
<target name="api">
<exec command="phpdoc" />
</target>
<!-- 测试 -->
<target name="phpunitserice">
<exec command="phpunit" />
</target>
<!--版本构建,文档,源码打包发送VSS,提示输入版本号-->
<target name="source">
</target>
<!--默认任务-->
<target name="exec" depends="clean,prepare,api,phpunitserice"/>
</project>
命令行输入:phing
参考文档:
phing 脚本介绍:
http://blog.csdn.net/chinabluexfw/article/details/7484101
官网文档,包括脚本介绍