Drive all the controllers of the application from CLI The application must be hide in a directory (by example ./bin). Don't forget to limit access to this directory by an .htaccess file containing deny from all
#!/usr/bin/php5
<?php
require ("domframework/cli.php");
$cli = new Domframework\Cli;
$cli->run();
');
The CLI file must be executable by chmod 755 cli.php. The available commands are :
Execute in CLI a controller or a model (in expert mode)
./cli.php -h : display this help
./cli.php -list : display controllers
./cli.php -expert -list : display controllers and models
./cli.php -listmethods <class> :
display the methods available in the controller class
./cli.php -expert -listmethods <class> :
display the methods available in the model or controller class
./cli.php -listmethodsdetails <class> :
display the methods available in the controller class
./cli.php -expert -listmethodsdetails <class> :
display the methods available in the model or controller class
./cli.php <class> <method> [args]
execute the method with the provided args
./cli.php -expert <class> <method> [args]
execute the method with the provided args
You can replace ONE arg by a dash (-) to read from stdin
Arrays must be coded like key1=val1&key2=val2&key3=val3...</pre>
Namespace Domframework
/** Allow to interract with controllers and models from the CLI
No property available
/** The construtor define the catching of the errors
/** The error handler for CLI : display error in STDERR@param integer $errno
The error type@param string $errstr
The string to send in error@param string $errfile
The error file which generate the error@param integer $errline
The line with an error
/**
Define the controllers path
@param string|array $path
The controllers pathes to use
/**
Define the models path
@param string|array $path
The models pathes to use
/** The real application launcher and helpers