我在phing构建文件中遇到了格式错误的XML问题。我想有一个任务,将枪击压缩文件,然后管道它到mysql恢复数据库备份。我发现在命令中使用"<“符号会导致错误。
下面是我当前正在破坏构建脚本的代码行:
<exec command="gunzip < ${mysql.backup} | mysql -u ${mysql.username} -p ${mysql.password} ${mysql.database}"
logoutput="true" checkreturn="true" />输出:
BUILD FAILED
exception 'BuildException' with message 'Error reading project file [wrapped: /home/ec2-user/project/build.xml:206:30: > required]' in /usr/share/pear/phing/parser/ProjectConfigurator.php:197有什么方法可以避开command=""部分吗?
或者是一种更好的方法呢?
发布于 2012-01-17 07:38:23
应该对不是开始元素的符号进行转义;在您的情况下,使用<是最简单的方法。
https://stackoverflow.com/questions/8887792
复制相似问题