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


Classes:
Console_CommandLine
Console_CommandLine_Action
Console_CommandLine_Action_Callback
Console_CommandLine_Action_Counter
Console_CommandLine_Action_Help
Console_CommandLine_Action_Password
Console_CommandLine_Action_StoreArray
Console_CommandLine_Action_StoreFalse
Console_CommandLine_Action_StoreFloat
Console_CommandLine_Action_StoreInt
Console_CommandLine_Action_StoreString
Console_CommandLine_Action_StoreTrue
Console_CommandLine_Action_Version
Console_CommandLine_Argument
Console_CommandLine_Command
Console_CommandLine_Element
Console_CommandLine_Exception
Console_CommandLine_MessageProvider_Default
Console_CommandLine_Option
Console_CommandLine_Outputter_Default
Console_CommandLine_Renderer_Default
Console_CommandLine_Result
Console_CommandLine_XmlParser
Files:
Action.php
Argument.php
Callback.php
Command.php
CommandLine.php
Counter.php
Default.php
Default.php
Default.php
Element.php
ex1.php
ex2.php
Exception.php
Help.php
MessageProvider.php
Option.php
Outputter.php
Password.php
Renderer.php
Result.php
StoreArray.php
StoreFalse.php
StoreFloat.php
StoreInt.php
StoreString.php
StoreTrue.php
Version.php
XmlParser.php

Class: Console_CommandLine_Action_Callback

Source Location: /Console_CommandLine-1.0.0/CommandLine/Action/Callback.php

Class Overview

Console_CommandLine_Action
 |
 --Console_CommandLine_Action_Callback

Class that represent the Callback action.


Author(s):

Version:

  • Release: 1.0.0

Copyright:

  • 2007 David JEAN LOUIS

Methods


Inherited Variables

Class: Console_CommandLine_Action

Console_CommandLine_Action::$option
Console_CommandLine_Action::$parser
Console_CommandLine_Action::$result

Inherited Methods

Class: Console_CommandLine_Action

Console_CommandLine_Action::__construct()
Constructor
Console_CommandLine_Action::execute()
Execute the action with the value entered by the user.
Console_CommandLine_Action::getResult()
Convenience method to retrieve the value of result->options[name].
Console_CommandLine_Action::setResult()
Convenience method to assign the result->options[name] value.

Class Details

[line 61]
Class that represent the Callback action.

The result option array entry value is set to the return value of the callback defined in the option.

There are two steps to defining a callback option:

  • define the option itself using the callback action
  • write the callback; this is a function (or method) that takes five arguments, as described below.
All callbacks are called as follows:
  1. callable_func(
  2. $value, // the value of the option
  3. $option_instance, // the option instance
  4. $result_instance, // the result instance
  5. $parser_instance, // the parser instance
  6. $params // an array of params as specified in the option
  7. );
and *must* return the option value.



[ Top ]


Method Detail

execute [line 74]

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

Execute the action with the value entered by the user.
  • Access: public

Overrides Console_CommandLine_Action::execute() (Execute the action with the value entered by the user.)

Parameters:

mixed $value — the value of the option
array $params — an optional array of parameters

[ Top ]


Documentation generated on 2019年3月11日 15:22:17 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.

AltStyle によって変換されたページ (->オリジナル) /