Phing,默认情况下,甚至对于任何内置记录器(phing.listener.NoBannerLogger,phing.listener.AnsiColorLogger,phing.listener.XmlLogger和phing.listener.HtmlColorLogger)都具有相当详细的输出。
我的用例是使用Phing作为预提交的挂钩来运行测试。因此,我并不关心日志网络钓鱼中提供的所有信息。我只是将其用作运行测试的多平台工具。
示例:
Buildfile: /private/var/workspace/www/me_com/build.xml
SBKSWWW > main:
[delete] Deleting /private/var/workspace/www/me_com/temp/pre-commit-hook/changed_files
[delete] Deleting directory /private/var/workspace/www/me_com/temp/pre-commit-hook
[mkdir] Created dir: /private/var/workspace/www/me_com/temp/pre-commit-hook
[phplint] Parse error: parse error in ./www/MyTest.php on line 2
[phpcodesniffer] 2 files where checked
[phpcodesniffer] No syntax errors detected
BUILD FINISHED
Total time: 0.3430 seconds
其中许多行对于我的用例来说确实是多余的,没有用。实际上,我什至不运行“ build”的原始含义。
我希望使phing日志看起来像这样……
✔ Commited code matches coding standards
✘ Commited code has syntax errors!
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE in MyTest.php on line 2
如果您认为我出于这个目的使用了不良工具,请告诉我,我很高兴知道还有其他事情。
您可以尝试使用phing.listener.XmlLogger
,并使用您自己的样式表将其通过xsltproc
进行管道传递。
给出了一个基本的build.xml
文件,它只是减少了您的PHP:
自Phing 2.11.0起,您将使用phing.listener.SilentLogger
u在第2行mytest上出现语法错误