获取并安装Phing
要获得Phing,您需要将PEAR与PHP一起安装。在Windows系统上,您可以通过运行go-pear.bat文件并在其中的提示运行来安装PEAR。
要获取Phing,只需运行以下命令。
pear channel-discover pear.phing.info pear install --alldeps phing/phing
您应该看到如下所示的安装输出:
downloading phing-current.tgz ... Starting to download phing-current.tgz (361,527 bytes) .........................................................................done: 361,527 bytes install ok: channel://pear.php.net/phing-2.1.1
现在,您可以通过键入以下命令来运行Phing:
phing
但是,这将自动尝试在当前目录中找到一个名为build.xml的文件,如果找不到该文件,它将仅声明以下内容:
Buildfile:build.xmldoesnotexist!
停止之前。该build.xml文件(尽管不必称为此文件)是控制phing进行操作的内容,也是您将花费大量时间查看的文件。
您可以使用-v参数查看正在运行的phing版本。
phing-v
打印出类似以下内容的内容:
Phingversion2.1.1
要查看可用命令的列表,请使用-h参数。
phing-h
将会打印出:
phing [options] [target [target2 [target3] ...]] Options: -h -help print this message -l -list list available targets in this project -v -version print the version information and exit -q -quiet be extra quiet -verbose be extra verbose -debug print debugging information -logfileuse given file for log -logger the class which is to perform logging -f -buildfile use given buildfile -D = use value for given property -find search for buildfile towards the root of the filesystem and use it Report bugs to <[email protected]>
使用Phing进行自动构建