Allows injecting mock IO into shells
$_io
protected __construct( array $args [] , boolean $bootstrap true , Cake\Console\ConsoleIo $io null )
Constructor
$args
optional [] $bootstrap
optional true Cake\Console\ConsoleIo
$io
optional null Cake\Console\ShellDispatcher::__construct()
_createShell( string $className , string $shortName )
Injects mock and stub io components into the shell
$className
$shortName
Cake\Console\Shell
Cake\Console\ShellDispatcher::_createShell()
_bootstrap( )
Initializes the environment and loads the CakePHP core.
_dispatch( array $extra [] )
Dispatch a request.
$extra
optional [] Extra parameters that you can manually pass to the Shell to be dispatched. Built-in extra parameter is : - requested
: if used, will prevent the Shell welcome message to be displayed
Cake\Console\Exception\MissingShellMethodException
_handleAlias( string $shell )
If the input matches an alias, return the aliased shell name
$shell
_initEnvironment( )
Defines current working environment.
Cake\Core\Exception\Exception
_shellExists( string $shell )
Check if a shell class exists for the given name.
$shell
addShortPluginAliases( )
For all loaded plugins, add a short alias
This permits a plugin which implements a shell of the same name to be accessed Using the shell name alone
alias( string $short , string|null $original null )
Add an alias for a shell command.
Aliases allow you to call shells by alternate names. This is most useful when dealing with plugin shells that you want to have shorter names for.
If you re-use an alias the last alias set will be the one available.
Aliasing a shell named ClassName:
$this->alias('alias', 'ClassName');
Getting the original name for a given alias:
$this->alias('alias');
$short
$original
optional null dispatch( array $extra [] )
Dispatches a CLI request
Converts a shell command result into an exit code. Null/True are treated as success. All other return values are an error.
$extra
optional [] Extra parameters that you can manually pass to the Shell to be dispatched. Built-in extra parameter is : - requested
: if used, will prevent the Shell welcome message to be displayed
findShell( string $shell )
Get shell to use, either plugin shell or application shell
All paths in the loaded shell paths are searched, handles alias dereferencing
$shell
Cake\Console\Shell
Cake\Console\Exception\MissingShellException
help( )
Shows console help. Performs an internal dispatch to the CommandList Shell
run( array $argv , array $extra [] )
Run the dispatcher
$argv
$extra
optional [] shiftArgs( )
Removes first argument and shifts other arguments up
version( )
Prints the currently installed version of CakePHP. Performs an internal dispatch to the CommandList Shell
protected Cake\Console\ConsoleIo
© 2005–2018 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.5/class-Cake.TestSuite.LegacyShellDispatcher.html