PHP-Daemon
PHP-Daemon copied to clipboard
Make it easier for developers to add their own Help documentation
Refactor the Core_Daemon::show_help()
method to work like show_install_instructions()
.
Create two instance vars on Core_Daemon
:
protected $help_usage = array();
protected $help_options = array();
Change the Core_Daemon::getopt()
method to write to these arrays. Change the show_help()
method to just implode these arrays and print them with a similar format to the existing code.
This will enable application developers to parse their own command line options by overloading getopt (and calling parent::getopt() when they're done), while writing help instructions that get displayed alongside the library-specific instructions.