note 50907 added to features.commandline

From: Date: Sun, 13 Mar 2005 21:52:43 +0000
Subject: note 50907 added to features.commandline
Groups: php.notes 
Request: Send a blank email to php-notes+get-86373@lists.php.net to get a copy of this message
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 ---- Manual Page -- http://www.php.net/manual/en/features.commandline.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+50907 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50907&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50907&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50907&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50907&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50907&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+50907&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#86373) next »