$commands
$commands : array
Command list
Collection for Commands.
Used by Applications to whitelist their console commands. CakePHP will use the mapped commands to construct and dispatch shell commands.
add(string $name, string|\Cake\Console\Shell|\Cake\Console\Command $command) : $this
Add a command to the collection
string | $name | The name of the command you want to map. |
string|\Cake\Console\Shell|\Cake\Console\Command | $command | The command to map. |
get(string $name) : string|\Cake\Console\Shell
Get the target for a command.
string | $name | The named shell. |
when unknown commands are fetched.
Either the shell class or an instance.
discoverPlugin(string $plugin) : array
Auto-discover shell & commands from the named plugin.
Discovered commands will have their names de-duplicated with
existing commands in the collection. If a command is already
defined in the collection and discovered in a plugin, only
the long name (plugin.command
) will be returned.
string | $plugin | The plugin to scan. |
Discovered plugin commands.
autoDiscover() : array
Automatically discover shell commands in CakePHP, the application and all plugins.
Commands will be located using filesystem conventions. Commands are discovered in the following order:
Commands defined in the application will ovewrite commands with the same name provided by CakePHP.
An array of command names and their classes.
Loading…