Phing에서 처음으로 PHP 서버를 실행 한 다음 PHP 단위 테스트를 실행하고 싶습니다.Phing에서 PHP 서버 실행
이것은 내가 지금까지 무엇을 가지고 :
<target name="test">
<!-- Run the PHP server -->
<exec executable="php">
<arg line="-S localhost:81 server.php"/>
</exec>
<!-- Run my tests -->
<exec executable="${phpunit.bin}" dir="${test.dir}" passthru="true" returnProperty="test.result">
<arg line="IntegrationTests"/>
</exec>
<!-- Check if succeeded -->
<condition property="test.succeeded">
<equals arg1="${test.result}" arg2="0"/>
</condition>
<fail unless="test.succeeded" message="Unit Tests Failed"/>
</target>
문제는 Phing는 PHP 서버를 생성 한 후 달려 있다는 것입니다.
문제는과 같이 스폰 속성을 추가하여 해결된다 :
과정이 결코 실제로 Phing이 종료 된 후에도 종료하는 것을 제외하고 예상대로이 작동<exec executable="php" spawn="true">
. 즉, Phing이 작업을 완료 한 후에도 PHP 서버가 계속 실행되고 있습니다.
따라서 내 질문은 제대로 Phing 백그라운드에서 PHP 서버를 실행하는 것입니다?