I've been trying to convert a command I run in bash to start a resque consumer using Phing but I couldn't find a way to set environment variables before exec the php command.
This is the command I'm trying to convert:
APPLICATION_ENV=dev VVERBOSE=1 QUEUE=myqueue APP_INCLUDE=app/cli/bootstrap.php php composer/chrisboulton/php-resque/resque.php
I've tried:
<!-- Resque start consumer -->
<target name="start_resque_consumer" description="Spans a resque consumer">
<property environment="APPLICATION_ENV" value="dev"/>
<property environment="VVERBOSE" value="1"/>
<property environment="QUEUE" value="myqueue"/>
<property environment="APP_INCLUDE" value="${project.basedir}/app/cli/bootstrap.php"/>
<exec executable="php" checkreturn="true" passthru="true" dir="${project.basedir}/composer/chrisboulton/php-resque">
<arg line="resque.php"/>
</exec>
</target>
And:
<!-- Resque start consumer -->
<target name="start_resque_consumer" description="Spans a resque consumer">
<exec executable="APPLICATION_ENV=dev
VVERBOSE=1
QUEUE=myqueue
APP_INCLUDE=${project.basedir}/app/cli/bootstrap.php
php" checkreturn="true" passthru="true" dir="${project.basedir}/composer/chrisboulton/php-resque">
<arg line="resque.php"/>
</exec>
</target>
Any idea how can I make this work? Is it even possible to set environment variables using Phing?