ShellDispatcher Class Info:

Class Declaration:

class ShellDispatcher

File name:
Cake/Console/ShellDispatcher.php
Description:

Shell dispatcher handles dispatching cli commands.

Package
Cake.Console

Properties:

  • args array

    Contains arguments parsed from the command line.

  • params array

    Contains command switches parsed from the command line.

_bootstrap

top

Initializes the environment and loads the Cake core.

Method defined in:
Cake/Console/ShellDispatcher.php on line 122
Return

boolean Success.

__construct

top

Constructor

The execution of the script is stopped after dispatching the request with a status code of either 0 or 1 according to the result of the dispatch.

Parameters:
  • array $args optional array ( )

    the argv from PHP

  • boolean $bootstrap optional true

    Should the environment be bootstrapped.

Method defined in:
Cake/Console/ShellDispatcher.php on line 49

dispatch

top

Dispatches a CLI request

Method defined in:
Cake/Console/ShellDispatcher.php on line 155
Return

boolean

Throws

MissingShellMethodException

_getShell

top

Get shell to use, either plugin shell or application shell

All paths in the loaded shell paths are searched.

Parameters:
  • string $shell required

    Optionally the name of a plugin

Method defined in:
Cake/Console/ShellDispatcher.php on line 206
Return

mixed An object

Throws

MissingShellException when errors are encountered.

help

top

Shows console help. Performs an internal dispatch to the CommandList Shell

Method defined in:
Cake/Console/ShellDispatcher.php on line 317
Return

void

_initConstants

top

Defines core configuration.

Method defined in:
Cake/Console/ShellDispatcher.php on line 77
Return

void

_initEnvironment

top

Defines current working environment.

Method defined in:
Cake/Console/ShellDispatcher.php on line 100
Return

void

Throws

CakeException

parseParams

top

Parses command line options and extracts the directory paths from $params

Parameters:
  • array $args required

    Parameters to parse

Method defined in:
Cake/Console/ShellDispatcher.php on line 232
Return

void

_parsePaths

top

Parses out the paths from from the argv

Parameters:
  • array $args required

Method defined in:
Cake/Console/ShellDispatcher.php on line 288
Return

void

run

top

Run the dispatcher

Parameters:
  • array $argv required

    The argv from PHP

Method defined in:
Cake/Console/ShellDispatcher.php on line 67
Return

void

shiftArgs

top

Removes first argument and shifts other arguments up

Method defined in:
Cake/Console/ShellDispatcher.php on line 308
Return

mixed Null if there are no arguments otherwise the shifted argument

_stop

top

Stop execution of the current script

Parameters:
Method defined in:
Cake/Console/ShellDispatcher.php on line 328
Return

void