Abstract Class CriticalI_Command

Description

A CriticalI_Command implements a command that can be used with the command-line criticali utility. This is the base class which all implemented commands must extend.

  • abstract:

Located in /Core/lib/CriticalI/Command.php (line 11)


	
			
Direct descendents
Class Description
Abstract class CriticalI_Command_ProjectEnvironment A base class for writing commands that must run within a project's environment (as opposed to just within the repository environment).
Variable Summary
 mixed $args
 mixed $description
 mixed $name
 mixed $options
 mixed $optionSpec
 mixed $summary
Method Summary
 CriticalI_Command __construct (string $name, [string $summary = ''], [string $description = ''], [array $optionSpec = null])
 void execute (CriticalI_Options $globalOptions, array $args)
 string help_string ()
 string name ()
 string prompt (string $prompt, [string $default = false])
 boolean prompt_confirm (string $prompt, [boolean $default = null])
 void run_command ()
 string summary ()
Variables
mixed $args (line 20)
  • access: protected
mixed $description (line 15)
  • access: protected
mixed $globalOptions (line 18)
  • access: protected
mixed $name (line 13)
  • access: protected
mixed $options (line 19)
  • access: protected
mixed $optionSpec (line 16)
  • access: protected
mixed $summary (line 14)
  • access: protected
Methods
Constructor __construct (line 30)

Constructor

  • access: public
CriticalI_Command __construct (string $name, [string $summary = ''], [string $description = ''], [array $optionSpec = null])
  • string $name: The command literal
  • string $summary: A short description of the command (one sentence)
  • string $description: A usage statement followed by a command description.
  • array $optionSpec: An array of CriticalI_OptionSpec objects.
execute (line 76)

Execute the command

  • access: public
void execute (CriticalI_Options $globalOptions, array $args)
  • CriticalI_Options $globalOptions: Any top-level options passed to criticali
  • array $args: The arguments passed to the command
help_string (line 60)

Returns a usage/help statement for the command

  • access: public
string help_string ()
name (line 44)

Returns the name of the command

  • access: public
string name ()
prompt (line 104)

Prompt the user and return the user's response

  • access: public
string prompt (string $prompt, [string $default = false])
  • string $prompt: The prompt to display for the user
  • string $default: (optional) The default value to use if the enters no response
prompt_confirm (line 129)

Prompt the user with a yes/no question and return the user's response as a boolean

  • access: public
boolean prompt_confirm (string $prompt, [boolean $default = null])
  • string $prompt: The prompt to display for the user
  • boolean $default: (optional) The default value to use if the enters no response
run_command (line 95)

Internal implementation of the command. This must be implemented by all sub classes. The properties globalOptions, options, and args will have been populated when this method is called.

  • abstract:
  • access: protected
void run_command ()
summary (line 52)

Returns the summary of the command

  • access: public
string summary ()

Documentation generated on Wed, 25 Apr 2012 09:46:42 -0700 by phpDocumentor 1.4.3