note 50907 deleted from features.commandline by nlopess
| From: | nlopess@php.net | Date: | Sun, 25 May 2008 08:59:59 +0000 |
| Subject: | note 50907 deleted from features.commandline by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-139725@lists.php.net to get a copy of this message | ||
Note Submitter:
----
Here is very simple, but usefull Command Line handler class. it may be usefull for your apps.
http://www.pure-php.de/node/16
<?
require_once("CliHandler.class.php");
class AnyClass{
public function start(){
return "started";
}
public function stop(){
return "stoppded";
}
}
$cli = new CliHandler(new AnyClass());
$cli->run();
?>
CliHandler accepts any class als argument.
Try this.
/usr/local/php/PHP5 CliHandler.class.php
output: Try these command:
start
stop
enter "start"
output: started