Add all the phpdocs to the domframework
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1246 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
72
cli.php
72
cli.php
@@ -1,41 +1,45 @@
|
||||
<?php
|
||||
/** DomFramework
|
||||
@package domframework
|
||||
@author Dominique Fournier <dominique@fournier38.fr> */
|
||||
|
||||
/** Allow to interract with controllers and models from the CLI */
|
||||
class cli
|
||||
{
|
||||
/** Run in CLI mode with parameters */
|
||||
/* Example of cli code :
|
||||
#!/usr/bin/php5
|
||||
<?php
|
||||
require ("domframework/cli.php");
|
||||
$cli = new cli;
|
||||
$cli->run(); */
|
||||
|
||||
public function run ()
|
||||
{
|
||||
global $argv;
|
||||
$launcher = $argv[0];
|
||||
chdir (dirname ($argv[0])."/..");
|
||||
array_shift ($argv);
|
||||
|
||||
if (isset ($argv[0]) && $argv[0] === "-h")
|
||||
/** Run in CLI mode with parameters
|
||||
Example of cli code :
|
||||
#!/usr/bin/php5
|
||||
<?php
|
||||
require ("domframework/cli.php");
|
||||
$cli = new cli;
|
||||
$cli->run(); */
|
||||
public function run ()
|
||||
{
|
||||
echo "Execute in CLI a controller or a model (in expert mode)\n";
|
||||
echo " $launcher -h : display this help\n";
|
||||
echo " $launcher -list : display controllers\n";
|
||||
echo " $launcher -expert -list : display controllers and models\n";
|
||||
echo " $launcher -listmethods <class> : \n";
|
||||
echo " display the methods available the controller class\n";
|
||||
echo " $launcher -expert -listmethods <class> :\n";
|
||||
echo " display the methods available the model or controller class\n";
|
||||
echo " $launcher -listmethodsdetails <class> : \n";
|
||||
echo " display the methods available the controller class\n";
|
||||
echo " $launcher -expert -listmethodsdetails <class> :\n";
|
||||
echo " display the methods available the model or controller class\n";
|
||||
echo " $launcher <class> <method> [args]\n";
|
||||
echo " execute the method with the provided args\n";
|
||||
echo " $launcher -expert <class> <method> [args]\n";
|
||||
echo " execute the method with the provided args\n";
|
||||
echo "You can replace ONE arg by a dash (-) to read from stdin\n";
|
||||
exit;
|
||||
global $argv;
|
||||
$launcher = $argv[0];
|
||||
chdir (dirname ($argv[0])."/..");
|
||||
array_shift ($argv);
|
||||
|
||||
if (isset ($argv[0]) && $argv[0] === "-h")
|
||||
{
|
||||
echo "Execute in CLI a controller or a model (in expert mode)\n";
|
||||
echo " $launcher -h : display this help\n";
|
||||
echo " $launcher -list : display controllers\n";
|
||||
echo " $launcher -expert -list : display controllers and models\n";
|
||||
echo " $launcher -listmethods <class> : \n";
|
||||
echo " display the methods available the controller class\n";
|
||||
echo " $launcher -expert -listmethods <class> :\n";
|
||||
echo " display the methods available the model or controller class\n";
|
||||
echo " $launcher -listmethodsdetails <class> : \n";
|
||||
echo " display the methods available the controller class\n";
|
||||
echo " $launcher -expert -listmethodsdetails <class> :\n";
|
||||
echo " display the methods available the model or controller class\n";
|
||||
echo " $launcher <class> <method> [args]\n";
|
||||
echo " execute the method with the provided args\n";
|
||||
echo " $launcher -expert <class> <method> [args]\n";
|
||||
echo " execute the method with the provided args\n";
|
||||
echo "You can replace ONE arg by a dash (-) to read from stdin\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$EXPERT = FALSE;
|
||||
|
||||
Reference in New Issue
Block a user