CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.10 Red Velvet API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 3.10
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Global
  • Cake
    • Auth
    • Cache
    • Collection
    • Command
    • Console
    • Controller
    • Core
    • Database
    • Datasource
    • Error
    • Event
    • Filesystem
    • Form
    • Http
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • Shell
      • Helper
      • Task
    • TestSuite
    • Utility
    • Validation
    • View

Class CompletionShell

Provide command completion shells such as bash.

Namespace: Cake\Shell

Constants

  • int
    CODE_ERROR ¶
    1

    Default error code

  • int
    CODE_SUCCESS ¶
    0

    Default success code

  • int
    NORMAL ¶
    ConsoleIo::NORMAL

    Output constant for making normal shells.

  • int
    QUIET ¶
    ConsoleIo::QUIET

    Output constants for making quiet shells.

  • int
    VERBOSE ¶
    ConsoleIo::VERBOSE

    Output constant making verbose shells.

Property Summary

  • $Command public @property
    Cake\Shell\Task\CommandTask
  • $OptionParser public
    Cake\Console\ConsoleOptionParser

    An instance of ConsoleOptionParser that has been configured for this class.

  • $Tasks public
    Cake\Console\TaskRegistry

    Task Collection for the command, used to create Tasks.

  • $_io protected
    Cake\Console\ConsoleIo

    ConsoleIo instance.

  • $_modelFactories protected
    array

    A list of overridden model factory functions.

  • $_modelType protected
    string

    The model type to use.

  • $_tableLocator protected
    Cake\ORM\Locator\LocatorInterface

    Table locator instance

  • $_taskMap protected
    array

    Normalized map of tasks.

  • $args public
    array

    Contains arguments parsed from the command line.

  • $command public
    string

    The command (method/task) that is being run.

  • $interactive public
    bool

    If true, the script will ask for permission to perform actions.

  • $modelClass public
    string|false|null

    This object's primary model class name. Should be a plural form. CakePHP will not inflect the name.

  • $name public
    string

    The name of the shell in camelized.

  • $params public
    array

    Contains command switches parsed from the command line.

  • $plugin public
    string

    The name of the plugin the shell belongs to. Is automatically set by ShellDispatcher when a shell is constructed.

  • $rootName protected
    string

    The root command name used when generating help output.

  • $taskNames public
    array

    Contains the loaded tasks

  • $tasks public
    array

    Contains tasks to load and instantiate

Method Summary

  • __construct() public

    Constructs this Shell instance.

  • __debugInfo() public

    Returns an array that can be used to describe the internal state of this object.

  • __get() public

    Overload get for lazy building of tasks

  • _displayHelp() protected

    Display the help in the correct format

  • _mergeProperty() protected

    Merge a single property with the values declared in all parent classes.

  • _mergePropertyData() protected

    Merge each of the keys in a property together.

  • _mergeVars() protected

    Merge the list of $properties with all parent classes of the current class.

  • _output() protected

    Emit results as a string, space delimited

  • _setModelClass() protected

    Set the modelClass and modelKey properties based on conventions.

  • _setOutputLevel() protected

    Set the output level based on the parameters.

  • _stop() protected

    Stop execution of the current script. Raises a StopException to try and halt the execution.

  • _validateTasks() protected

    Checks that the tasks in the task map are actually available

  • _welcome() protected

    Displays a header for the shell

  • abort() public

    Displays a formatted error message and exits the application with an error code.

  • clear() public

    Clear the console

  • commands() public

    list commands

  • createFile() public

    Creates a file at given path

  • dispatchShell() public

    Dispatch a command to another Shell. Similar to Object::requestAction() but intended for running shells from other shells.

  • err() public

    Outputs a single or multiple error messages to stderr. If no parameters are passed outputs just a newline.

  • error() public deprecated

    Displays a formatted error message and exits the application with status code 1

  • fuzzy() public

    Guess autocomplete from the whole argument string

  • getIo() public

    Get the io object for this shell.

  • getModelType() public

    Get the model type to be used by this class

  • getOptionParser() public

    Gets the option parser instance and configures it.

  • getTableLocator() public

    Gets the table locator.

  • hasMethod() public

    Check to see if this shell has a callable method by the given name.

  • hasTask() public

    Check to see if this shell has a task with the provided name.

  • helper() public

    Render a Console Helper

  • hr() public

    Outputs a series of minus characters to the standard output, acts as a visual separator.

  • in() public

    Prompts the user for input, and returns it.

  • info() public

    Convenience method for out() that wraps message between tag

  • initialize() public

    Initializes the Shell acts as constructor for subclasses allows configuration of tasks prior to shell execution

  • io() public deprecated

    Get/Set the io object for this shell.

  • loadModel() public

    Loads and constructs repository objects required by this object

  • loadTasks() public

    Loads tasks defined in public $tasks

  • log() public

    Convenience method to write a message to Log. See Log::write() for more information on writing to logs.

  • main() public

    Not called by the autocomplete shell - this is for curious users

  • modelFactory() public

    Override a existing callable to generate repositories of a given type.

  • modelType() public deprecated

    Set or get the model type to be used by this class

  • nl() public

    Returns a single or multiple linefeeds sequences.

  • options() public

    list options for the named command

  • out() public

    Outputs a single or multiple messages to stdout. If no parameters are passed outputs just a newline.

  • param() public

    Safely access the values in $this->params.

  • parseDispatchArguments() public

    Parses the arguments for the dispatchShell() method.

  • quiet() public

    Output at all levels.

  • runCommand() public

    Runs the Shell with the provided argv.

  • setIo() public

    Set the io object for this shell.

  • setModelType() public

    Set the model type to be used by this class

  • setRootName() public

    Set the root command name for help output.

  • setTableLocator() public

    Sets the table locator.

  • shortPath() public

    Makes absolute file path easier to read

  • startup() public

    Echo no header by overriding the startup method

  • subcommands() public

    list subcommands for the named command

  • success() public

    Convenience method for out() that wraps message between tag

  • tableLocator() public deprecated

    Sets the table locator. If no parameters are passed, it will return the currently used locator.

  • verbose() public

    Output at the verbose level.

  • warn() public

    Convenience method for err() that wraps message between tag

  • wrapMessageWithType() protected deprecated

    Wraps a message with a given message type, e.g.

  • wrapText() public

    Wrap a block of text. Allows you to set the width, and indenting on a block of text.

Method Detail

__construct() ¶ public

__construct(Cake\Console\ConsoleIo|null $io = null, Cake\ORM\Locator\LocatorInterface|null $locator = null)

Constructs this Shell instance.

Parameters
Cake\Console\ConsoleIo|null $io optional

An io instance.

Cake\ORM\Locator\LocatorInterface|null $locator optional

Table locator instance.

Links
https://book.cakephp.org/3/en/console-and-shells.html#Shell

__debugInfo() ¶ public

__debugInfo(): array

Returns an array that can be used to describe the internal state of this object.

Returns
array

__get() ¶ public

__get(string $name): Cake\Console\Shell

Overload get for lazy building of tasks

Parameters
string $name

The task to get.

Returns
Cake\Console\Shell

_displayHelp() ¶ protected

_displayHelp(string $command): int|bool

Display the help in the correct format

Parameters
string $command

The command to get help for.

Returns
int|bool

_mergeProperty() ¶ protected

_mergeProperty(string $property, array $parentClasses, array $options): void

Merge a single property with the values declared in all parent classes.

Parameters
string $property

The name of the property being merged.

array $parentClasses

An array of classes you want to merge with.

array $options

Options for merging the property, see _mergeVars()

Returns
void

_mergePropertyData() ¶ protected

_mergePropertyData(array $current, array $parent, bool $isAssoc): mixed

Merge each of the keys in a property together.

Parameters
array $current

The current merged value.

array $parent

The parent class' value.

bool $isAssoc

Whether or not the merging should be done in associative mode.

Returns
mixed

_mergeVars() ¶ protected

_mergeVars(string[] $properties, array $options = []): void

Merge the list of $properties with all parent classes of the current class.

Options:

  • associative - A list of properties that should be treated as associative arrays. Properties in this list will be passed through Hash::normalize() before merging.
Parameters
string[] $properties

An array of properties and the merge strategy for them.

array $options optional

The options to use when merging properties.

Returns
void

_output() ¶ protected

_output(array $options = []): int|bool|null

Emit results as a string, space delimited

Parameters
array $options optional

The options to output

Returns
int|bool|null

_setModelClass() ¶ protected

_setModelClass(string $name): void

Set the modelClass and modelKey properties based on conventions.

If the properties are already set they will not be overwritten

Parameters
string $name

Class name.

Returns
void

_setOutputLevel() ¶ protected

_setOutputLevel(): void

Set the output level based on the parameters.

This reconfigures both the output level for out() and the configured stdout/stderr logging

Returns
void

_stop() ¶ protected

_stop(int|string $status = self::CODE_SUCCESS): void

Stop execution of the current script. Raises a StopException to try and halt the execution.

Parameters
int|string $status optional

see https://secure.php.net/exit for values

Returns
void
Throws
Cake\Console\Exception\StopException

_validateTasks() ¶ protected

_validateTasks(): void

Checks that the tasks in the task map are actually available

Returns
void
Throws
RuntimeException

_welcome() ¶ protected

_welcome(): void

Displays a header for the shell

Returns
void

abort() ¶ public

abort(string $message, int $exitCode = self::CODE_ERROR): void

Displays a formatted error message and exits the application with an error code.

Parameters
string $message

The error message

int $exitCode optional

The exit code for the shell task.

Returns
void
Throws
Cake\Console\Exception\StopException
Links
https://book.cakephp.org/3/en/console-and-shells.html#styling-output

clear() ¶ public

clear(): void

Clear the console

Returns
void
Links
https://book.cakephp.org/3/en/console-and-shells.html#console-output

commands() ¶ public

commands(): int|bool|null

list commands

Returns
int|bool|null

createFile() ¶ public

createFile(string $path, string $contents): bool

Creates a file at given path

Parameters
string $path

Where to put the file.

string $contents

Content to put in the file.

Returns
bool
Links
https://book.cakephp.org/3/en/console-and-shells.html#creating-files

dispatchShell() ¶ public

dispatchShell(): int

Dispatch a command to another Shell. Similar to Object::requestAction() but intended for running shells from other shells.

Usage:

With a string command:

return $this->dispatchShell('schema create DbAcl');

Avoid using this form if you have string arguments, with spaces in them. The dispatched will be invoked incorrectly. Only use this form for simple command dispatching.

With an array command:

return $this->dispatchShell('schema', 'create', 'i18n', '--dry');

With an array having two key / value pairs:

  • command can accept either a string or an array. Represents the command to dispatch
  • extra can accept an array of extra parameters to pass on to the dispatcher. This parameters will be available in the param property of the called Shell

return $this->dispatchShell([ 'command' => 'schema create DbAcl', 'extra' => ['param' => 'value'] ]);

or

return $this->dispatchShell([ 'command' => ['schema', 'create', 'DbAcl'], 'extra' => ['param' => 'value'] ]);

Returns
int
Links
https://book.cakephp.org/3/en/console-and-shells.html#invoking-other-shells-from-your-shell

err() ¶ public

err(string|string[]|null $message = null, int $newlines = 1): int|bool

Outputs a single or multiple error messages to stderr. If no parameters are passed outputs just a newline.

Parameters
string|string[]|null $message optional

A string or an array of strings to output

int $newlines optional

Number of newlines to append

Returns
int|bool

error() ¶ public

error(string $title, string|null $message = null, int $exitCode = self::CODE_ERROR): int

Displays a formatted error message and exits the application with status code 1

Parameters
string $title

Title of the error

string|null $message optional

An optional error message

int $exitCode optional

The exit code for the shell task.

Returns
int
Throws
Cake\Console\Exception\StopException
Links
https://book.cakephp.org/3/en/console-and-shells.html#styling-output

fuzzy() ¶ public

fuzzy(): int|bool|null

Guess autocomplete from the whole argument string

Returns
int|bool|null

getIo() ¶ public

getIo(): Cake\Console\ConsoleIo

Get the io object for this shell.

Returns
Cake\Console\ConsoleIo

getModelType() ¶ public

getModelType(): string

Get the model type to be used by this class

Returns
string

getOptionParser() ¶ public

getOptionParser(): Cake\Console\ConsoleOptionParser

Gets the option parser instance and configures it.

By overriding this method you can configure the ConsoleOptionParser before returning it.

Returns
Cake\Console\ConsoleOptionParser

getTableLocator() ¶ public

getTableLocator(): Cake\ORM\Locator\LocatorInterface

Gets the table locator.

Returns
Cake\ORM\Locator\LocatorInterface

hasMethod() ¶ public

hasMethod(string $name): bool

Check to see if this shell has a callable method by the given name.

Parameters
string $name

The method name to check.

Returns
bool
Links
https://book.cakephp.org/3/en/console-and-shells.html#shell-tasks

hasTask() ¶ public

hasTask(string $task): bool

Check to see if this shell has a task with the provided name.

Parameters
string $task

The task name to check.

Returns
bool
Links
https://book.cakephp.org/3/en/console-and-shells.html#shell-tasks

helper() ¶ public

helper(string $name, array $settings = []): Cake\Console\Helper

Render a Console Helper

Create and render the output for a helper object. If the helper object has not already been loaded, it will be loaded and constructed.

Parameters
string $name

The name of the helper to render

array $settings optional

Configuration data for the helper.

Returns
Cake\Console\Helper

hr() ¶ public

hr(int $newlines = 0, int $width = 63): void

Outputs a series of minus characters to the standard output, acts as a visual separator.

Parameters
int $newlines optional

Number of newlines to pre- and append

int $width optional

Width of the line, defaults to 63

Returns
void
Links
https://book.cakephp.org/3/en/console-and-shells.html#Shell::hr

in() ¶ public

in(string $prompt, string|array|null $options = null, string|null $default = null): string|null

Prompts the user for input, and returns it.

Parameters
string $prompt

Prompt text.

string|array|null $options optional

Array or string of options.

string|null $default optional

Default input value.

Returns
string|null
Links
https://book.cakephp.org/3/en/console-and-shells.html#Shell::in

info() ¶ public

info(string|string[]|null $message = null, int $newlines = 1, int $level = Shell::NORMAL): int|bool

Convenience method for out() that wraps message between tag

Parameters
string|string[]|null $message optional

A string or an array of strings to output

int $newlines optional

Number of newlines to append

int $level optional

The message's output level, see above.

Returns
int|bool
See Also
https://book.cakephp.org/3/en/console-and-shells.html#Shell::out

initialize() ¶ public

initialize(): void

Initializes the Shell acts as constructor for subclasses allows configuration of tasks prior to shell execution

Returns
void
Links
https://book.cakephp.org/3/en/console-and-shells.html#Cake\Console\ConsoleOptionParser::initialize

io() ¶ public

io(Cake\Console\ConsoleIo|null $io = null): Cake\Console\ConsoleIo

Get/Set the io object for this shell.

Parameters
Cake\Console\ConsoleIo|null $io optional

The ConsoleIo object to use.

Returns
Cake\Console\ConsoleIo

loadModel() ¶ public

loadModel(string|null $modelClass = null, string|null $modelType = null): Cake\Datasource\RepositoryInterface

Loads and constructs repository objects required by this object

Typically used to load ORM Table objects as required. Can also be used to load other types of repository objects your application uses.

If a repository provider does not return an object a MissingModelException will be thrown.

Parameters
string|null $modelClass optional

Name of model class to load. Defaults to $this->modelClass. The name can be an alias like 'Post' or FQCN like App\Model\Table\PostsTable::class.

string|null $modelType optional

The type of repository to load. Defaults to the modelType() value.

Returns
Cake\Datasource\RepositoryInterface
Throws
Cake\Datasource\Exception\MissingModelException
If the model class cannot be found.
InvalidArgumentException
When using a type that has not been registered.
UnexpectedValueException
If no model type has been defined

loadTasks() ¶ public

loadTasks(): bool

Loads tasks defined in public $tasks

Returns
bool

log() ¶ public

log(mixed $message, int|string $level = LogLevel::ERROR, string|array $context = []): bool

Convenience method to write a message to Log. See Log::write() for more information on writing to logs.

Parameters
mixed $message

Log message.

int|string $level optional

Error level.

string|array $context optional

Additional log data relevant to this message.

Returns
bool

main() ¶ public

main(): int|bool

Not called by the autocomplete shell - this is for curious users

Returns
int|bool

modelFactory() ¶ public

modelFactory(string $type, callable $factory): void

Override a existing callable to generate repositories of a given type.

Parameters
string $type

The name of the repository type the factory function is for.

callable $factory

The factory function used to create instances.

Returns
void

modelType() ¶ public

modelType(string|null $modelType = null): string|$this

Set or get the model type to be used by this class

Parameters
string|null $modelType optional

The model type or null to retrieve the current

Returns
string|$this

nl() ¶ public

nl(int $multiplier = 1): string

Returns a single or multiple linefeeds sequences.

Parameters
int $multiplier optional

Number of times the linefeed sequence should be repeated

Returns
string
Links
https://book.cakephp.org/3/en/console-and-shells.html#Shell::nl

options() ¶ public

options(): int|bool|null

list options for the named command

Returns
int|bool|null

out() ¶ public

out(string|string[]|null $message = null, int $newlines = 1, int $level = Shell::NORMAL): int|bool

Outputs a single or multiple messages to stdout. If no parameters are passed outputs just a newline.

Output levels

There are 3 built-in output level. Shell::QUIET, Shell::NORMAL, Shell::VERBOSE. The verbose and quiet output levels, map to the verbose and quiet output switches present in most shells. Using Shell::QUIET for a message means it will always display. While using Shell::VERBOSE means it will only display when verbose output is toggled.

Parameters
string|string[]|null $message optional

A string or an array of strings to output

int $newlines optional

Number of newlines to append

int $level optional

The message's output level, see above.

Returns
int|bool
Links
https://book.cakephp.org/3/en/console-and-shells.html#Shell::out

param() ¶ public

param(string $name): string|bool|null

Safely access the values in $this->params.

Parameters
string $name

The name of the parameter to get.

Returns
string|bool|null

parseDispatchArguments() ¶ public

parseDispatchArguments(array $args): array

Parses the arguments for the dispatchShell() method.

Parameters
array $args

Arguments fetch from the dispatchShell() method with func_get_args()

Returns
array

quiet() ¶ public

quiet(string|string[] $message, int $newlines = 1): int|bool

Output at all levels.

Parameters
string|string[] $message

A string or an array of strings to output

int $newlines optional

Number of newlines to append

Returns
int|bool

runCommand() ¶ public

runCommand(array $argv, bool $autoMethod = false, array $extra = []): int|bool|null

Runs the Shell with the provided argv.

Delegates calls to Tasks and resolves methods inside the class. Commands are looked up with the following order:

  • Method on the shell.
  • Matching task name.
  • main() method.

If a shell implements a main() method, all missing method calls will be sent to main() with the original method name in the argv.

For tasks to be invoked they must be exposed as subcommands. If you define any subcommands, you must define all the subcommands your shell needs, whether they be methods on this class or methods on tasks.

Parameters
array $argv

Array of arguments to run the shell with. This array should be missing the shell name.

bool $autoMethod optional

Set to true to allow any public method to be called even if it was not defined as a subcommand. This is used by ShellDispatcher to make building simple shells easy.

array $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
Returns
int|bool|null
Links
https://book.cakephp.org/3/en/console-and-shells.html#the-cakephp-console

setIo() ¶ public

setIo(Cake\Console\ConsoleIo $io): void

Set the io object for this shell.

Parameters
Cake\Console\ConsoleIo $io

The ConsoleIo object to use.

Returns
void

setModelType() ¶ public

setModelType(string $modelType): $this

Set the model type to be used by this class

Parameters
string $modelType

The model type

Returns
$this

setRootName() ¶ public

setRootName(string $name): $this

Set the root command name for help output.

Parameters
string $name

The name of the root command.

Returns
$this

setTableLocator() ¶ public

setTableLocator(Cake\ORM\Locator\LocatorInterface $tableLocator): $this

Sets the table locator.

Parameters
Cake\ORM\Locator\LocatorInterface $tableLocator

LocatorInterface instance.

Returns
$this

shortPath() ¶ public

shortPath(string $file): string

Makes absolute file path easier to read

Parameters
string $file

Absolute file path

Returns
string
Links
https://book.cakephp.org/3/en/console-and-shells.html#Shell::shortPath

startup() ¶ public

startup(): void

Echo no header by overriding the startup method

Override this method if you want to remove the welcome information, or otherwise modify the pre-command flow.

Returns
void

subcommands() ¶ public

subcommands(): int|bool|null

list subcommands for the named command

Returns
int|bool|null
Throws
ReflectionException

success() ¶ public

success(string|string[]|null $message = null, int $newlines = 1, int $level = Shell::NORMAL): int|bool

Convenience method for out() that wraps message between tag

Parameters
string|string[]|null $message optional

A string or an array of strings to output

int $newlines optional

Number of newlines to append

int $level optional

The message's output level, see above.

Returns
int|bool
See Also
https://book.cakephp.org/3/en/console-and-shells.html#Shell::out

tableLocator() ¶ public

tableLocator(Cake\ORM\Locator\LocatorInterface|null $tableLocator = null): Cake\ORM\Locator\LocatorInterface

Sets the table locator. If no parameters are passed, it will return the currently used locator.

Parameters
Cake\ORM\Locator\LocatorInterface|null $tableLocator optional

LocatorInterface instance.

Returns
Cake\ORM\Locator\LocatorInterface

verbose() ¶ public

verbose(string|string[] $message, int $newlines = 1): int|bool

Output at the verbose level.

Parameters
string|string[] $message

A string or an array of strings to output

int $newlines optional

Number of newlines to append

Returns
int|bool

warn() ¶ public

warn(string|string[]|null $message = null, int $newlines = 1): int|bool

Convenience method for err() that wraps message between tag

Parameters
string|string[]|null $message optional

A string or an array of strings to output

int $newlines optional

Number of newlines to append

Returns
int|bool
See Also
https://book.cakephp.org/3/en/console-and-shells.html#Shell::err

wrapMessageWithType() ¶ protected

wrapMessageWithType(string $messageType, string|array $message): array|string

Wraps a message with a given message type, e.g.

Parameters
string $messageType

The message type, e.g. "warning".

string|array $message

The message to wrap.

Returns
array|string

wrapText() ¶ public

wrapText(string $text, int|array $options = []): string

Wrap a block of text. Allows you to set the width, and indenting on a block of text.

Options

  • width The width to wrap to. Defaults to 72
  • wordWrap Only wrap on words breaks (spaces) Defaults to true.
  • indent Indent the text with the string provided. Defaults to null.
Parameters
string $text

Text the text to format.

int|array $options optional

Array of options to use, or an integer to wrap the text to.

Returns
string
See Also
\Cake\Utility\Text::wrap()
Links
https://book.cakephp.org/3/en/console-and-shells.html#Shell::wrapText

Property Detail

$Command ¶ public @property

Type
Cake\Shell\Task\CommandTask

$OptionParser ¶ public

An instance of ConsoleOptionParser that has been configured for this class.

Type
Cake\Console\ConsoleOptionParser

$Tasks ¶ public

Task Collection for the command, used to create Tasks.

Type
Cake\Console\TaskRegistry

$_io ¶ protected

ConsoleIo instance.

Type
Cake\Console\ConsoleIo

$_modelFactories ¶ protected

A list of overridden model factory functions.

Type
array

$_modelType ¶ protected

The model type to use.

Type
string

$_tableLocator ¶ protected

Table locator instance

Type
Cake\ORM\Locator\LocatorInterface

$_taskMap ¶ protected

Normalized map of tasks.

Type
array

$args ¶ public

Contains arguments parsed from the command line.

Type
array

$command ¶ public

The command (method/task) that is being run.

Type
string

$interactive ¶ public

If true, the script will ask for permission to perform actions.

Type
bool

$modelClass ¶ public

This object's primary model class name. Should be a plural form. CakePHP will not inflect the name.

Example: For an object named 'Comments', the modelClass would be 'Comments'. Plugin classes should use Plugin.Comments style names to correctly load models from the correct plugin.

Use false to not use auto-loading on this object. Null auto-detects based on controller name.

Type
string|false|null

$name ¶ public

The name of the shell in camelized.

Type
string

$params ¶ public

Contains command switches parsed from the command line.

Type
array

$plugin ¶ public

The name of the plugin the shell belongs to. Is automatically set by ShellDispatcher when a shell is constructed.

Type
string

$rootName ¶ protected

The root command name used when generating help output.

Type
string

$taskNames ¶ public

Contains the loaded tasks

Type
array

$tasks ¶ public

Contains tasks to load and instantiate

Type
array
OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs