我正在尝试使用 phing 自动化我的部署。使用 svnlastrevision 任务时出现以下错误
由于以下原因,目标“builddiff”的执行失败:/home/ramjee/Work/Projects/it/dev-stack/build.xml:88:1:无法解析“svn info --xml”的输出。
在进一步调试问题时,我将其归零为以下内容:
下面是一个重现问题的小程序:
$cmd = "/usr/bin/svn info --non-interactive '/home/ramjee/Work/Projects/trunk/src' '--xml'";
exec("$cmd 2>&1",$out,$ret_var);
print_r($out);
当我执行上述
一世。使用随 bitnami lampstack.1.2-5 提供的 PHP (5.2.17)。我得到以下结果(不是预期的):
Array
(
[0] => /usr/bin/svn: /home/ramjee/Work/lampstack-1.2-5/common/lib/libsasl2.so.2: no version information available (required by /usr/lib/libldap_r-2.4.so.2)
[1] => /usr/bin/svn: /home/ramjee/Work/lampstack-1.2-5/common/lib/libsasl2.so.2: no version information available (required by /usr/lib/libsvn_ra_svn-1.so.1)
[2] => <?xml version="1.0"?>
[3] => <info>
[4] => <entry
[5] => kind="dir"
[6] => path="/home/ramjee/Work/Projects/trunk/src"
[7] => revision="818">
[8] => <url>svn://abc.abc.abc.abc/data/repositories/src</url>
[9] => <repository>
[10] => <root>svn://abc.abc.abc.abc/data/repositories/</root>
[11] => <uuid>f74a063e-5e8e-11e0-b400-13ff509e0209</uuid>
[12] => </repository>
[13] => <wc-info>
[14] => <schedule>normal</schedule>
[15] => <depth>infinity</depth>
[16] => </wc-info>
[17] => <commit
[18] => revision="802">
[19] => <author>shweta</author>
[20] => <date>2012-01-03T12:07:46.427638Z</date>
[21] => </commit>
[22] => </entry>
[23] => </info>
)
ii. 使用作为 Lampp 设置一部分的 PHP (5.3.17)。我得到以下结果(预期):
Array
(
[0] => <?xml version="1.0"?>
[1] => <info>
[2] => <entry
[3] => kind="dir"
[4] => path="/home/ramjee/Work/Projects/trunk/src"
[5] => revision="818">
[6] => <url>svn://abc.abc.abc.abc/data/repositories/src</url>
[7] => <repository>
[8] => <root>svn://abc.abc.abc.abc/data/repositories/</root>
[9] => <uuid>f74a063e-5e8e-11e0-b400-13ff509e0209</uuid>
[10] => </repository>
[11] => <wc-info>
[12] => <schedule>normal</schedule>
[13] => <depth>infinity</depth>
[14] => </wc-info>
[15] => <commit
[16] => revision="802">
[17] => <author>shweta</author>
[18] => <date>2012-01-03T12:07:46.427638Z</date>
[19] => </commit>
[20] => </entry>
[21] => </info>
)
在第一行中,我们有两条不需要的行导致 phing 任务抛出错误。
我不知道如何解决这个问题?对此的任何帮助都将非常有价值。