ShellDispatcher Class Reference

List of all members.

Public Member Functions

 __bootstrap ()
 __buildPaths ()
 __construct ($args=array())
 __initConstants ()
 __parseParams ($params)
 _initEnvironment ()
 _stop ($status=0)
 dispatch ()
 getInput ($prompt, $options=null, $default=null)
 help ()
 parseParams ($params)
 ShellDispatcher ($args=array())
 shiftArgs ()
 stderr ($string)
 stdout ($string, $newline=true)

Public Attributes

 $args = array()
 $params = array()
 $shell = null
 $shellClass = null
 $shellCommand = null
 $shellName = null
 $shellPath = null
 $shellPaths = array()
 $stderr
 $stdin
 $stdout

Detailed Description

Definition at line 34 of file cake.php.


Constructor & Destructor Documentation

ShellDispatcher::__construct ( args = array()  ) 

Constructor

Parameters:
array $args the argv.

Definition at line 125 of file cake.php.

References $args, __buildPaths(), __initConstants(), _initEnvironment(), _stop(), dispatch(), and parseParams().

Referenced by dispatch(), and ShellDispatcher().


Member Function Documentation

ShellDispatcher::__bootstrap (  ) 

Initializes the environment and loads the Cake core.

Returns:
boolean Success. private

Definition at line 233 of file cake.php.

References Configure::buildPaths(), cache(), config(), debug(), error(), Configure::getInstance(), params(), stderr(), and Configure::write().

Referenced by _initEnvironment(), and dispatch().

ShellDispatcher::__buildPaths (  ) 

Builds the shell paths.

private

Returns:
void

Definition at line 199 of file cake.php.

References $path, Folder(), Configure::read(), and underscore().

Referenced by __construct().

ShellDispatcher::__initConstants (  ) 

Defines core configuration.

private

Definition at line 138 of file cake.php.

Referenced by __construct().

ShellDispatcher::__parseParams ( params  ) 

Helper for recursively paraing params

Returns:
array params private

Definition at line 490 of file cake.php.

References params().

ShellDispatcher::_initEnvironment (  ) 

Defines current working environment.

protected

Definition at line 162 of file cake.php.

References __bootstrap(), _stop(), check(), exists(), getInput(), params(), shiftArgs(), stderr(), and stdout().

Referenced by __construct().

ShellDispatcher::_stop ( status = 0  ) 

Stop execution of the current script

Parameters:
$status see http://php.net/exit for values
Returns:
void protected

Definition at line 582 of file cake.php.

Referenced by __construct(), _initEnvironment(), and dispatch().

ShellDispatcher::dispatch (  ) 

Dispatches a CLI request

public

Definition at line 274 of file cake.php.

References $path, $shell, __bootstrap(), __construct(), _stop(), camelize(), help(), shiftArgs(), stderr(), stdout(), and variable().

Referenced by __construct().

ShellDispatcher::getInput ( prompt,
options = null,
default = null 
)

Prompts the user for input, and returns it.

Parameters:
string $prompt Prompt text.
mixed $options Array or string of options.
string $default Default input value.
Returns:
Either the default value, or the user-provided input. public

Definition at line 394 of file cake.php.

Referenced by _initEnvironment().

ShellDispatcher::help (  ) 

Shows console help

public

Definition at line 534 of file cake.php.

References $path, Configure::listObjects(), params(), and Configure::version().

Referenced by dispatch().

ShellDispatcher::parseParams ( params  ) 

Parses command line options

Parameters:
array $params Parameters to parse public

Definition at line 447 of file cake.php.

References a(), and params().

Referenced by __construct().

ShellDispatcher::ShellDispatcher ( args = array()  ) 

Constructs this ShellDispatcher instance.

Parameters:
array $args the argv.

Definition at line 117 of file cake.php.

References $args, and __construct().

ShellDispatcher::shiftArgs (  ) 

Removes first argument and shifts other arguments up

Returns:
boolean False if there are no arguments public

Definition at line 521 of file cake.php.

Referenced by _initEnvironment(), and dispatch().

ShellDispatcher::stderr ( string  ) 

Outputs to the stderr filehandle.

Parameters:
string $string Error text to output. public

Definition at line 438 of file cake.php.

Referenced by __bootstrap(), _initEnvironment(), and dispatch().

ShellDispatcher::stdout ( string,
newline = true 
)

Outputs to the stdout filehandle.

Parameters:
string $string String to output.
boolean $newline If true, the outputs gets an added newline. public

Definition at line 425 of file cake.php.

Referenced by _initEnvironment(), and dispatch().


Member Data Documentation

ShellDispatcher::$args = array()

Definition at line 69 of file cake.php.

Referenced by __construct(), and ShellDispatcher().

ShellDispatcher::$params = array()

Definition at line 62 of file cake.php.

ShellDispatcher::$shell = null

Definition at line 76 of file cake.php.

Referenced by dispatch().

ShellDispatcher::$shellClass = null

Definition at line 83 of file cake.php.

ShellDispatcher::$shellCommand = null

Definition at line 90 of file cake.php.

ShellDispatcher::$shellName = null

Definition at line 111 of file cake.php.

ShellDispatcher::$shellPath = null

Definition at line 104 of file cake.php.

ShellDispatcher::$shellPaths = array()

Definition at line 97 of file cake.php.

ShellDispatcher::$stderr

Definition at line 55 of file cake.php.

ShellDispatcher::$stdin

Definition at line 41 of file cake.php.

ShellDispatcher::$stdout

Definition at line 48 of file cake.php.


The documentation for this class was generated from the following file:
Generated on Sun Nov 22 00:30:57 2009 for CakePHP 1.2.x.x (v1.2.4.8284) by doxygen 1.4.7