php – 如何在给定双引号和单引号的phing中执行任务
发布时间:2020-12-13 17:22:50 所属栏目:PHP教程 来源:网络整理
导读:这是我希望执行的命令. php -r "apc_clear_cache(); apc_clear_cache('user'); apc_clear_cache('opcode');" 这是我对phing的尝试 exec command='php -r "apc_clear_cache(); apc_clear_cache('user'); apc_clear_cache('opcode');"' outputProperty="resu
这是我希望执行的命令.
php -r "apc_clear_cache(); apc_clear_cache('user'); apc_clear_cache('opcode');" 这是我对phing的尝试 <exec command='php -r "apc_clear_cache(); apc_clear_cache('user'); apc_clear_cache('opcode');"' outputProperty="result" /> 这就是我得到的 BUILD FAILED Error reading project file [wrapped: /var/virtual/abc.com/build.xml:171:26: > required] Total time: 0.2093 seconds 请指教. 更新: 我通过编写一个名为RunApcClearCache.sh的bash脚本来解决我的问题 php -r "apc_clear_cache(); apc_clear_cache('user'); apc_clear_cache('opcode');" 然后使用./RunApcClearCache.sh调用bash脚本 如果有更好的方法,我想听听. 我也不愿意为一件如此简单的事情写一个任务.当然必须有一种方法可以在exectask中正确地避开双引号. 解决方法
Phing需要有效的XML.
在有效的XML中,您不能直接在属性中使用. 你需要逃避/使用它的等效实体. < represents "<" > represents ">" & represents "&" ' represents ' " represents " 尝试使用实体而不是字符. https://en.wikipedia.org/wiki/XML#Escaping (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |