Свойство | Type | Description | |
---|---|---|---|
$commands | array | ||
$defaultCommand | string | ||
$exitOnException | boolean | ||
$helpCommand | string | ||
$helpCommandClass | string | ||
$optionsParser | consolekit\OptionsParser | ||
$singleCommand | boolean | ||
$textWriter | consolekit\TextWriter | ||
$verboseException | boolean |
Méthode | 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 |
Résultat |
public addCommands ( array $commands ) : |
||
$commands | array | |
Résultat |
public getCommand ( string $name ) : string | ||
$name | string | |
Résultat | string |
public getOptionsParser ( ) : consolekit\OptionsParser | ||
Résultat | consolekit\OptionsParser |
public getTextWriter ( ) : consolekit\TextWriter | ||
Résultat | consolekit\TextWriter |
public hasCommand ( string $name ) : boolean | ||
$name | string | |
Résultat | boolean |
public setDefaultCommand ( string $name = null ) : |
||
$name | string | |
Résultat |
public setExitOnException ( boolean $exit = true ) : |
||
$exit | boolean | |
Résultat |
public setOptionsParser ( consolekit\OptionsParser $parser ) : |
||
$parser | consolekit\OptionsParser | |
Résultat |
public setSingleCommand ( type $singleCommand ) : |
||
$singleCommand | type | |
Résultat |
public setTextWriter ( consolekit\TextWriter $writer ) : |
||
$writer | consolekit\TextWriter | |
Résultat |
public setVerboseException ( boolean $enable = true ) | ||
$enable | boolean |
public writeException ( Exception $e ) : |
||
$e | Exception | |
Résultat |
protected OptionsParser,consolekit $optionsParser | ||
Résultat | consolekit\OptionsParser |
protected TextWriter,consolekit $textWriter | ||
Résultat | consolekit\TextWriter |