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
    • Slack
    • Paid Support
CakePHP

C CakePHP 2.7 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 2.7
      • 4.2
      • 4.1
      • 4.0
      • 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

Packages

  • Cake
    • Cache
      • Engine
    • Configure
    • Console
      • Command
        • Task
    • Controller
      • Component
        • Acl
        • Auth
    • Core
    • Error
    • Event
    • I18n
    • Log
      • Engine
    • Model
      • Behavior
      • Datasource
        • Database
        • Session
      • Validator
    • Network
      • Email
      • Http
    • Routing
      • Filter
      • Route
    • TestSuite
      • Coverage
      • Fixture
      • Reporter
    • Utility
    • View
      • Helper

Classes

  • AclShell
  • ApiShell
  • BakeShell
  • CommandListShell
  • CompletionShell
  • ConsoleShell
  • I18nShell
  • SchemaShell
  • ServerShell
  • TestShell
  • TestsuiteShell
  • UpgradeShell

Class ConsoleShell

Provides a very basic 'interactive' console for CakePHP apps.

AppShell
Extended by ConsoleShell
Package: Cake\Console\Command
Deprecated: 3.0.0 Deprecated since version 2.4, will be removed in 3.0
Copyright: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
License: MIT License
Location: Cake/Console/Command/ConsoleShell.php

Properties summary

  • $_finished protected
    mixed
    _finished
  • $_methodPatterns protected
    array
    _methodPatterns
  • $associations public
    array
    Available binding types
  • $badCommandChars public
    array
    Chars that describe invalid commands
  • $models public
    array
    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
boolean
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
boolean
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
string
or false

_models() protected deprecated ¶

_models( )

List all models

_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.

_routesReload() protected deprecated ¶

_routesReload( )

Reload route definitions

_routesShow() protected deprecated ¶

_routesShow( )

Show all routes

_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.

getOptionParser() public deprecated ¶

getOptionParser( )

Gets the option parser instance and configures it.

Returns
ConsoleOptionParser

help() public deprecated ¶

help( )

Prints the help message

main() public deprecated ¶

main( string $command = null )

Override main() to handle action

Parameters
string $command optional null
The command to run.

startup() public deprecated ¶

startup( )

Override startup of the Shell

Properties detail

$_finished ¶

protected mixed

_finished

This shell is perpetual, setting this property to true exits the process

false

$_methodPatterns ¶

protected array

_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 ¶

public array

Available binding types

array('hasOne', 'hasMany', 'belongsTo', 'hasAndBelongsToMany')

$badCommandChars ¶

public array

Chars that describe invalid commands

array('$', ';')

$models ¶

public array

Available models

array()
OpenHub
Rackspace
Rackspace
  • 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
  • Slack
  • Paid Support

Generated using CakePHP API Docs