PHP CLI by Aley Rob

PHP CLI by Aley Rob

Author:Aley, Rob [Aley, Rob]
Language: eng
Format: azw3, epub, mobi, pdf
Published: 2016-02-04T16:00:00+00:00


Further Reading

POSIX Signals on Wikipedia

http://en.wikipedia.org/wiki/Unix_signal#POSIX_signals

Any other positive integer is generally construed as exiting due to an unspecified error. So, for instance, if you decide the command line arguments provided by your user are not in the correct format, you should terminate your script using exit(2). If instead all goes well and your script continues to the end of its script file, you can actually let it exit by itself (or by calling exit without a parameter), as it returns status code 0 by default.

As with web scripts, you can register functions to be executed when your PHP script exits using the register_shutdown_function() function. One use for this may be to check that all is well and evaluate which exit code should be returned. The exit code used as the parameter to exit or die within a registered shutdown functions overrides the code used in the initial exit call that initiated shutdown. This means that you can happily exit(0) everywhere, then exit(76) from your shutdown function if you detect that the foo conflaganation isn’t aligned with the bar initispations in your metaspacialatific object. Or similar.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.