Created
June 21, 2013 12:53
-
-
Save pleckey/5830962 to your computer and use it in GitHub Desktop.
Phing targets to start PHP 5.4 testing server and localtunnel server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<property name="project.displayName" value="MyProject"/> | |
<property name="project.publicFolder" value="./public"/> | |
<property name="project.publicPort" value="8000"/> | |
<!-- ============================================ --> | |
<!-- Target: Server --> | |
<!-- ============================================ --> | |
<target name="server" description="starts a local testing server"> | |
<echo message="Starting ${project.displayName} server in ${project.publicFolder} on port ${project.publicPort}"/> | |
<exec command="php -S 0.0.0.0:${project.publicPort}" dir="${project.publicFolder}" logoutput="true" passthru="true"/> | |
</target> | |
<!-- ============================================ --> | |
<!-- Target: Tunnel Server --> | |
<!-- localtunnel output is redirected to stderr --> | |
<!-- because phing (even on passthru) won't flush --> | |
<!-- at the amount of data localtunnel spits out --> | |
<!-- --> | |
<!-- localtunnel: http://progrium.com/localtunnel --> | |
<!-- ============================================ --> | |
<target name="tunnel-server" description="starts a localtunneled testing server"> | |
<echo message="Starting ${project.displayName} server in ${project.publicFolder} on port ${project.publicPort}"/> | |
<exec command="php -S 0.0.0.0:${project.publicPort}" dir="${project.publicFolder}" logoutput="true" passthru="true" spawn="true"/> | |
<echo message="Starting tunnel to port ${project.publicPort}"/> | |
<exec command="localtunnel ${project.publicPort} 1>&2" dir="${builddir}" logoutput="true" passthru="true"/> | |
</target> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment