Is there a way to have a PHP standalone script return an exit code to the shell? It does not seem like this is possible since the return types of die() and exit() are void.
I'm a build engineer and want to use PHP as part of the build process. If I have a makefile with a target, and I run a PHP script to build that target, I want
the PHP script to return a value. That way, make will behave properly.
all: target1 target2
target1:
php -q -f script1.php
target2:
php -q -f script2.php
If script1.php has a non-zero return code, I want make to fail and I do not want script2.php to run.
Any tricks or suggestions would be appreciated.
Thanks!