PHP Exit Codes
Commonly used exit codes for usage in console applications and commands., (*1)
Using appropriate exit codes greatly helps users of your project or library to
include them in their own scripting and take appropriate decisions based on
the returned code. Simply always using the catch-all exit code 1, as is most
common, does not help the user in any way unless there is only a single source
of error in the complete script; which is very unlikely., (*2)
Installation
Open a terminal, enter your project directory and execute the following command
to add this package to your dependencies:, (*3)
$ composer require fleshgrinder/exit-codes
This command requires you to have Composer installed globally, as explained in
the installation chapter of the
Composer documentation., (*4)
Usage
The constants are automatically loaded if you include the Composer provided
auto-loader in your script., (*5)
<?php
include __DIR__ . '/vendor/autoload.php';
exit(EXIT_SUCCESS);
Weblinks
License
This is free and unencumbered software released into the public domain., (*6)
, (*7)