Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Commit

Permalink
Add install instructions to the -H help printout
Browse files Browse the repository at this point in the history
  • Loading branch information
shaneharter committed Aug 8, 2011
1 parent 67ed9d5 commit 4c85791
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Core/Daemon.php
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ protected function show_help($msg = "") {

echo get_class($this) . "\n\n";
echo "USAGE:\n";
echo " # " . basename(self::$filename) . " -H | [-d] [-v] [-p PID_FILE]\n\n";
echo " # " . basename(self::$filename) . " -H | -i | [-d] [-v] [-p PID_FILE]\n\n";
echo "OPTIONS:\n";
echo " -i Print any daemon install instructions to the screen\n";
echo " -d Daemon, detach and run in the background\n";
Expand Down
10 changes: 9 additions & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Requires:
PHP 5.3 or Higher
POSIX and PCNTL Extensions for PHP

Changes in 1.1.1:
* Several Bugfixes
* Add simple "Installation Instructions" feature: Pass -i to your daemon to print out simple installation instructions (crontab entries, file permissions, etc). Easily define these instructions in your daemon by adding messages to an array.

Changes in 1.1.0:
* Add a simple Plugin interface.
Expand Down Expand Up @@ -55,15 +58,20 @@ A plugin can be created very easily by implementing the Core_PluginInterface. Cu
* Simple Config Loading
A simple Plugin loader is included, and the first plugin created will help you use and validate Ini files. This functionality was moved from the daemon core into a Plugin for the 1.1.0 release to simplify daemon core.

* Simple Installation Guidance
Help sysadmins and users of your Daemon by definig installation instructions directly in your daemon. Add messages to the
$this->install_instructions array in your daemon's constructor. Then when you call the daemon with a "-i" argument, a complete list of your instructions and Core_Daemon instructions will be displayed to the daemon user.

* Command Line Switches
You can run a '-H' help command when you run the Daemon. It will dump a help menu that looks like this, but can be easily overridden for your daemon:

Example_Daemon

USAGE:
# run.php -H | [-d] [-v] [-p PID_FILE]
# run.php -H | -i | [-d] [-v] [-p PID_FILE]

OPTIONS:
-i Print any daemon install instructions to the screen
-d Daemon, detach and run in the background
-v Verbose, echo any logged messages. Ignored in Daemon mode.
-H Shows this help
Expand Down

0 comments on commit 4c85791

Please sign in to comment.