This is my command I wish to execute.
php -r "apc_clear_cache(); apc_clear_cache('user'); apc_clear_cache('opcode');"
This is my attempt in phing
<exec command='php -r "apc_clear_cache(); apc_clear_cache(\'user\'); apc_clear_cache(\'opcode\');"' outputProperty="result" />
This is what I get
BUILD FAILED
Error reading project file [wrapped: /var/virtual/abc.com/build.xml:171:26: > required]
Total time: 0.2093 seconds
Please advise.
Update:
I solved my problem by writing a bash script called RunApcClearCache.sh
that runs
php -r "apc_clear_cache(); apc_clear_cache('user'); apc_clear_cache('opcode');"
and then calling the bash script using ./RunApcClearCache.sh
If there is a better way, I would like to hear it.
I am also disinclined to write a task just for something so straightforward. Surely there must be a way to escape double quotes properly inside a exectask.