|
Doctrine 1.2.4
|
Public Member Functions | |
| __construct (array $config=array(), Doctrine_Cli_Formatter $formatter=null) | |
| getConfig () | |
| getConfigValue ($name) | |
| getFormatter () | |
| getLoadedTasks () | |
| getRegisteredTasks () | |
| getTaskInstance () | |
| hasConfigValue ($name, $value=null, $strict=false) | |
| loadTasks ($directory=null) | |
| notify ($notification=null, $style= 'HEADER') | |
| printTasks ($taskName=null, $full=false) | |
| registerIncludedTaskClasses () | |
| registerTaskClass ($className) | |
| run (array $args) | |
| setConfig (array $config) | |
| setFormatter (Doctrine_Cli_Formatter $formatter) | |
| setRegisteredTasks (array $registeredTask) | |
| setTaskInstance (Doctrine_Task $task) | |
| taskClassIsRegistered ($className) | |
| taskNameIsRegistered ($taskName, &$className=null) | |
Protected Member Functions | |
| _getTaskClassFromArgs (array $args) | |
| _run (array $args) | |
| assembleArgumentList (array $argumentsDescriptions, array $config, Doctrine_Cli_Formatter $formatter) | |
| classIsTask ($className) | |
| createTaskInstance ($className, Doctrine_Cli $cli) | |
| executeTask (Doctrine_Task $task, array $preparedArguments) | |
| formatExceptionMessage (Exception $exception) | |
| includeAndRegisterDoctrineTaskClasses ($directories=null) | |
| includeAndRegisterTaskClasses () | |
| includeDoctrineTaskClasses ($directory) | |
| notifyException (Exception $exception) | |
| prepareArgs (array $args) | |
| Doctrine_Cli::__construct | ( | array | $config = array(), |
| Doctrine_Cli_Formatter | $formatter = null |
||
| ) |
__construct
| array | [$config=array()] |
| object|null | [$formatter=null] Doctrine_Cli_Formatter |
|
protected |
|
protected |
Run the actual task execution with the passed arguments
| array | $args | Array of arguments for this task being executed |
| Doctrine_Cli_Exception | If the requested task has not been registered or if required arguments are missing |
Definition at line 476 of file Cli.php.
|
protected |
| array | $argumentsDescriptions | |
| array | $config | |
| object | $formatter | Doctrine_Cli_Formatter |
Definition at line 611 of file Cli.php.
|
protected |
|
protected |
Creates, and returns, a new instance of the specified Task class
Displays a message, and returns FALSE, if there were problems instantiating the class
| string | $className | |
| object | $cli | Doctrine_Cli |
Definition at line 374 of file Cli.php.
|
protected |
Executes the task with the specified prepared arguments
| object | $task | Doctrine_Task |
| array | $preparedArguments |
| Doctrine_Cli_Exception | If required arguments are missing |
|
protected |
Formats, and then returns, the message in the specified exception
| Exception | $exception |
Definition at line 416 of file Cli.php.
| Doctrine_Cli::getConfig | ( | ) |
| Doctrine_Cli::getConfigValue | ( | $name | ) |
Returns the specified value from the config, or the default value, if specified
| string | $name |
| OutOfBoundsException | If the element does not exist in the config |
Definition at line 123 of file Cli.php.
| Doctrine_Cli::getFormatter | ( | ) |
Definition at line 111 of file Cli.php.
| Doctrine_Cli::getLoadedTasks | ( | ) |
Old method retained for backwards compatibility
| Doctrine_Cli::getRegisteredTasks | ( | ) |
| Doctrine_Cli::getTaskInstance | ( | ) |
Definition at line 229 of file Cli.php.
| Doctrine_Cli::hasConfigValue | ( | $name, | |
$value = null, |
|||
$strict = false |
|||
| ) |
Returns TRUE if the element in the config has the specified value, or FALSE otherwise
If $value is not passed, this method will return TRUE if the specified element has any value, or FALSE if the element is not set
For strict checking, set $strict to TRUE - the default is FALSE
| string | $name | |
| mixed | [$value=null] | |
| bool | [$strict=false] |
Definition at line 149 of file Cli.php.
|
protected |
Includes and registers Doctrine-style tasks from the specified directory / directories
If no directory is given it looks in the default Doctrine/Task folder for the core tasks
| mixed | [$directories=null] Can be a string path or array of paths |
Definition at line 258 of file Cli.php.
|
protected |
Called by the constructor, this method includes and registers Doctrine core Tasks and then registers all other loaded Task classes
The second round of registering will pick-up loaded custom Tasks. Methods are provided that will allow users to register Tasks loaded after creating an instance of Doctrine_Cli.
Definition at line 241 of file Cli.php.
|
protected |
Attempts to include Doctrine-style Task-classes from the specified directory - and nothing more besides
Returns an array containing the names of Task classes included
This method effectively makes two assumptions:
This means that a file called "Foo.php", say, will be expected to contain a Task class called "Doctrine_Task_Foo". Hence the method's name, "include*Doctrine*TaskClasses".
| string | $directory |
| InvalidArgumentException | If the directory does not exist |
Definition at line 287 of file Cli.php.
| Doctrine_Cli::loadTasks | ( | $directory = null | ) |
Old method retained for backwards compatibility
Definition at line 654 of file Cli.php.
| Doctrine_Cli::notify | ( | $notification = null, |
|
$style = 'HEADER' |
|||
| ) |
Notify the formatter of a message
| string | $notification | The notification message |
| string | $style | Style to format the notification with(INFO, ERROR) |
Definition at line 400 of file Cli.php.
|
protected |
Notify the formatter of an exception
N.B. This should really only be called by Doctrine_Cli::run(). Exceptions should be thrown when errors occur: it's up to Doctrine_Cli::run() to determine how those exceptions are reported.
| Exception | $exception |
|
protected |
Prepare the raw arguments for execution. Combines with the required and optional argument list in order to determine a complete array of arguments for the task
| array | $args | Array of raw arguments |
Definition at line 527 of file Cli.php.
| Doctrine_Cli::printTasks | ( | $taskName = null, |
|
$full = false |
|||
| ) |
Prints an index of all the available tasks in the CLI instance
| string|null | [$taskName=null] |
| bool | [$full=false] |
Definition at line 573 of file Cli.php.
| Doctrine_Cli::registerIncludedTaskClasses | ( | ) |
Registers all loaded classes - by default - or the specified loaded Task classes
This method will skip registered task classes, so it can be safely called many times over
Definition at line 384 of file Cli.php.
| Doctrine_Cli::registerTaskClass | ( | $className | ) |
Registers the specified included task-class
| string | $className |
| InvalidArgumentException | If the class does not exist or the task-name is blank |
| DomainException | If the class is not a Doctrine Task |
Definition at line 335 of file Cli.php.
| Doctrine_Cli::run | ( | array | $args | ) |
Public function to run the loaded task with the passed arguments
| array | $args |
| Doctrine_Cli_Exception |
Definition at line 449 of file Cli.php.
| Doctrine_Cli::setConfig | ( | array | $config | ) |
| Doctrine_Cli::setFormatter | ( | Doctrine_Cli_Formatter | $formatter | ) |
| object | $formatter | Doctrine_Cli_Formatter |
Definition at line 103 of file Cli.php.
| Doctrine_Cli::setRegisteredTasks | ( | array | $registeredTask | ) |
| Doctrine_Cli::setTaskInstance | ( | Doctrine_Task | $task | ) |
| object | $task | Doctrine_Task |
Definition at line 221 of file Cli.php.
| Doctrine_Cli::taskClassIsRegistered | ( | $className | ) |
| Doctrine_Cli::taskNameIsRegistered | ( | $taskName, | |
| & | $className = null |
||
| ) |
Returns TRUE if a task with the specified name is registered, or FALSE otherwise
If a matching task is found, $className is set with the name of the implementing class
| string | $taskName | |
| string|null | [&$className=null] |
Definition at line 206 of file Cli.php.