Search code examples
phing

How to force Phing task to respect verbose exec command?


In other words how to display output of currently executed phing task?

<target name="backup_db">
    <mkdir dir="${dir.sql}"/>
    <exec command="mysqldump -v -h ${db.host} -u ${db.username} -p${db.password} ${db.name} > ${dir.sql}/${dump.basename}"/>
</target>

This pulls a database dump, as you see I specified -v flag to get verbose output. Command runs successfully however with no output during the dump.

Foo > backup_db:

BUILD FINISHED

Total time: 1 minute 40.81 seconds

The same command called directly in terminal will list each table one by one that's currently being dumped. How to achieve that in phing?


Solution

  • Adding passthru="true" to the exec solved the problem. Now I get the output in real time.