Console_CommandLine
[ class tree: Console_CommandLine ] [ index: Console_CommandLine ] [ all elements ]

Class: Console_CommandLine_Action

Source Location: /Console_CommandLine-1.2.0/Console/CommandLine/Action.php

Class Overview


Class that represent an option action.


Author(s):

Version:

  • Release: 1.2.0

Copyright:

  • 2007 David JEAN LOUIS

Variables

Methods


Child classes:

Console_CommandLine_Action_Password
Class that represent the Password action, a special action that allow the user to specify the password on the commandline or to be prompted for entering it.
Console_CommandLine_Action_Counter
Class that represent the Version action.
Console_CommandLine_Action_StoreInt
Class that represent the StoreInt action.
Console_CommandLine_Action_Callback
Class that represent the Callback action.
Console_CommandLine_Action_Help
Class that represent the Help action, a special action that displays the help message, telling the user how to use the program.
Console_CommandLine_Action_StoreString
Class that represent the StoreString action.
Console_CommandLine_Action_List
Class that represent the List action, a special action that simply output an array as a list.
Console_CommandLine_Action_StoreFloat
Class that represent the StoreFloat action.
Console_CommandLine_Action_StoreTrue
Class that represent the StoreTrue action.
Console_CommandLine_Action_Version
Class that represent the Version action, a special action that displays the version string of the program.
Console_CommandLine_Action_StoreFalse
Class that represent the StoreFalse action.
Console_CommandLine_Action_StoreArray
Class that represent the StoreArray action.

Inherited Variables

Inherited Methods


Class Details

[line 37]
Class that represent an option action.


[ Top ]


Class Variables

$option =

[line 53]

A reference to the option instance.
  • Var: The action option
  • Access: protected



[ Top ]

$parser =

[line 60]

A reference to the parser instance.
  • Var: The parser
  • Access: protected



[ Top ]

$result =

[line 46]

A reference to the result instance.
  • Var: The result instance
  • Access: protected



[ Top ]



Method Detail

__construct (Constructor)   [line 74]

void __construct( Console_CommandLine_Result $result, Console_CommandLine_Option $option, Console_CommandLine $parser)

Constructor
  • Access: public

Parameters:

Console_CommandLine_Result   $result     The result instance
Console_CommandLine_Option   $option     The action option
Console_CommandLine   $parser     The current parser

[ Top ]

execute   [line 140]

string execute( [mixed $value = false], [array $params = array()])

Executes the action with the value entered by the user.

All children actions must implement this method.

  • Abstract:
  • Access: public

Overridden in child classes as:

Console_CommandLine_Action_Password::execute()
Executes the action with the value entered by the user.
Console_CommandLine_Action_Counter::execute()
Executes the action with the value entered by the user.
Console_CommandLine_Action_StoreInt::execute()
Executes the action with the value entered by the user.
Console_CommandLine_Action_Callback::execute()
Executes the action with the value entered by the user.
Console_CommandLine_Action_Help::execute()
Executes the action with the value entered by the user.
Console_CommandLine_Action_StoreString::execute()
Executes the action with the value entered by the user.
Console_CommandLine_Action_List::execute()
Executes the action with the value entered by the user.
Console_CommandLine_Action_StoreFloat::execute()
Executes the action with the value entered by the user.
Console_CommandLine_Action_StoreTrue::execute()
Executes the action with the value entered by the user.
Console_CommandLine_Action_Version::execute()
Executes the action with the value entered by the user.
Console_CommandLine_Action_StoreFalse::execute()
Executes the action with the value entered by the user.
Console_CommandLine_Action_StoreArray::execute()
Executes the action with the value entered by the user.

Parameters:

mixed   $value     The option value
array   $params     An optional array of parameters

[ Top ]

format   [line 108]

mixed format( mixed &$value)

Allow a value to be pre-formatted prior to being used in a choices test.

Setting $value to the new format will keep the formatting.

  • Return: The formatted value
  • Access: public

Parameters:

mixed   &$value     The value to format

[ Top ]

getResult   [line 89]

mixed getResult( )

Convenience method to retrieve the value of result->options[name].
  • Return: The result value or null
  • Access: public

[ Top ]

setResult   [line 123]

void setResult( mixed $result)

Convenience method to assign the result->options[name] value.
  • Access: public

Parameters:

mixed   $result     The result value

[ Top ]


Documentation generated on Thu, 25 Oct 2012 08:00:03 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.