Class ConsoleShell
Provides a very basic 'interactive' console for CakePHP apps.
- AppShell
- ConsoleShell
Deprecated: 3.0.0 Deprecated since version 2.4, will be removed in 3.0
Copyright: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
License: MIT License
Location: Cake/Console/Command/ConsoleShell.php
Properties summary
-
$_finished
protectedmixed
_finished -
$_methodPatterns
protectedarray
_methodPatterns -
$associations
publicarray
Available binding types -
$badCommandChars
publicarray
Chars that describe invalid commands -
$models
publicarray
Available models
Method Summary
-
_bind() protected deprecated
Bind an association -
_columns() protected deprecated
Show the columns for a model -
_exit() protected deprecated
Set the finiished property so that the loop in main method ends -
_find() protected deprecated
Perform a find -
_isValidModel() protected deprecated
Tells if the specified model is included in the list of available models -
_loadRoutes() protected deprecated
Reloads the routes configuration from app/Config/routes.php, and compiles all routes found
-
_method() protected deprecated
Determine the method to process the current command -
_models() protected deprecated
List all models -
_routeToArray() protected deprecated
Parse a string URL and show as an array -
_routeToString() protected deprecated
Parse an array URL and show the equivalent URL as a string -
_routesReload() protected deprecated
Reload route definitions -
_routesShow() protected deprecated
Show all routes -
_save() protected deprecated
Save a record -
_unbind() protected deprecated
Unbind an association -
getOptionParser() public deprecated
Gets the option parser instance and configures it. -
help() public deprecated
Prints the help message -
main() public deprecated
Override main() to handle action -
startup() public deprecated
Override startup of the Shell
Method Detail
_bind() protected deprecated ¶
_bind( mixed $command )
Bind an association
Parameters
- mixed $command
- The command to run.
_columns() protected deprecated ¶
_columns( mixed $command )
Show the columns for a model
Parameters
- mixed $command
- The command to run.
_exit() protected deprecated ¶
_exit( )
Set the finiished property so that the loop in main method ends
_find() protected deprecated ¶
_find( mixed $command )
Perform a find
Parameters
- mixed $command
- The command to run.
_isValidModel() protected deprecated ¶
_isValidModel( string $modelToCheck )
Tells if the specified model is included in the list of available models
Parameters
- string $modelToCheck
- The model to check.
Returns
true if is an available model, false otherwise
_loadRoutes() protected deprecated ¶
_loadRoutes( )
Reloads the routes configuration from app/Config/routes.php, and compiles all routes found
Returns
True if config reload was a success, otherwise false
_method() protected deprecated ¶
_method( string $command )
Determine the method to process the current command
Parameters
- string $command
- The command to run.
Returns
or false
_routeToArray() protected deprecated ¶
_routeToArray( mixed $command )
Parse a string URL and show as an array
Parameters
- mixed $command
- The command to run.
_routeToString() protected deprecated ¶
_routeToString( mixed $command )
Parse an array URL and show the equivalent URL as a string
Parameters
- mixed $command
- The command to run.
_save() protected deprecated ¶
_save( mixed $command )
Save a record
Parameters
- mixed $command
- The command to run.
_unbind() protected deprecated ¶
_unbind( mixed $command )
Unbind an association
Parameters
- mixed $command
- The command to run.
Properties detail
$_finished ¶
_finished
This shell is perpetual, setting this property to true exits the process
false
$_methodPatterns ¶
_methodPatterns
array( 'help' => '/^(help|\?)/', '_exit' => '/^(quit|exit)/', '_models' => '/^models/i', '_bind' => '/^(\w+) bind (\w+) (\w+)/', '_unbind' => '/^(\w+) unbind (\w+) (\w+)/', '_find' => '/.+->find/', '_save' => '/.+->save/', '_columns' => '/^(\w+) columns/', '_routesReload' => '/^routes\s+reload/i', '_routesShow' => '/^routes\s+show/i', '_routeToString' => '/^route\s+(\(.*\))$/i', '_routeToArray' => '/^route\s+(.*)$/i', )
$associations ¶
Available binding types
array('hasOne', 'hasMany', 'belongsTo', 'hasAndBelongsToMany')