Property | Type | Description | |
---|---|---|---|
$commands | array | ||
$defaultCommand | string | ||
$exitOnException | boolean | ||
$helpCommand | string | ||
$helpCommandClass | string | ||
$optionsParser | consolekit\OptionsParser | ||
$singleCommand | boolean | ||
$textWriter | consolekit\TextWriter | ||
$verboseException | boolean |
Method | Description | |
---|---|---|
__construct ( array $commands = [], consolekit\OptionsParser $parser = null, consolekit\TextWriter $writer = null ) | ||
addCommand ( callback $callback, string $alias = null, boolean $default = false ) : |
Registers a command | |
addCommands ( array $commands ) : |
Adds multiple commands at once | |
addCommandsFromDir ( string $dir, string $namespace = '', boolean $includeFiles = false ) : |
Registers commands from a directory | |
areExceptionsVerbose ( ) : boolean | ||
execute ( string $command = null, array $args = [], array $options = [] ) : mixed | Executes a command | |
exitsOnException ( ) : boolean | ||
getCommand ( string $name ) : string | ||
getCommands ( ) : array | ||
getDefaultCommand ( ) : string | ||
getOptionsParser ( ) : consolekit\OptionsParser | ||
getTextWriter ( ) : consolekit\TextWriter | ||
hasCommand ( string $name ) : boolean | ||
run ( array $argv = null ) : mixed | ||
setDefaultCommand ( string $name = null ) : |
||
setExitOnException ( boolean $exit = true ) : |
Sets whether to call exit(1) when an exception is caught | |
setOptionsParser ( consolekit\OptionsParser $parser ) : |
||
setSingleCommand ( type $singleCommand ) : |
Turn off command parsing | |
setTextWriter ( consolekit\TextWriter $writer ) : |
||
setVerboseException ( boolean $enable = true ) | Sets whether a detailed error message is displayed when exception are caught | |
write ( string $text, $pipe = TextWriter::STDOUT ) : |
Writes some text to the text writer | |
writeException ( Exception $e ) : |
Writes an error message to stderr | |
writeln ( string $text = '', $pipe = TextWriter::STDOUT ) : |
Writes a line of text |
public __construct ( array $commands = [], consolekit\OptionsParser $parser = null, consolekit\TextWriter $writer = null ) | ||
$commands | array | |
$parser | consolekit\OptionsParser | |
$writer | consolekit\TextWriter |
public addCommand ( callback $callback, string $alias = null, boolean $default = false ) : |
||
$callback | callback | Associated class name, function name, Command instance or closure |
$alias | string | Command name to be used in the shell |
$default | boolean | True to set the command as the default one |
return |
public addCommands ( array $commands ) : |
||
$commands | array | |
return |
public getOptionsParser ( ) : consolekit\OptionsParser | ||
return | consolekit\OptionsParser |
public getTextWriter ( ) : consolekit\TextWriter | ||
return | consolekit\TextWriter |
public setDefaultCommand ( string $name = null ) : |
||
$name | string | |
return |
public setExitOnException ( boolean $exit = true ) : |
||
$exit | boolean | |
return |
public setOptionsParser ( consolekit\OptionsParser $parser ) : |
||
$parser | consolekit\OptionsParser | |
return |
public setSingleCommand ( type $singleCommand ) : |
||
$singleCommand | type | |
return |
public setTextWriter ( consolekit\TextWriter $writer ) : |
||
$writer | consolekit\TextWriter | |
return |
public setVerboseException ( boolean $enable = true ) | ||
$enable | boolean |
public writeException ( Exception $e ) : |
||
$e | Exception | |
return |
protected OptionsParser,consolekit $optionsParser | ||
return | consolekit\OptionsParser |
protected TextWriter,consolekit $textWriter | ||
return | consolekit\TextWriter |