TYPO3
7.6
|
Public Member Functions | |
__construct () | |
getMaximumLineLength () | |
output ($text, array $arguments=array()) | |
outputLine ($text= '', array $arguments=array()) | |
outputFormatted ($text= '', array $arguments=array(), $leftPadding=0) | |
outputTable ($rows, $headers=null) | |
select ($question, $choices, $default=null, $multiSelect=false, $attempts=false) | |
ask ($question, $default=null, array $autocomplete=null) | |
askConfirmation ($question, $default=true) | |
askHiddenResponse ($question, $fallback=true) | |
askAndValidate ($question, $validator, $attempts=false, $default=null, array $autocomplete=null) | |
askHiddenResponseAndValidate ($question, $validator, $attempts=false, $fallback=true) | |
progressStart ($max=null) | |
progressAdvance ($step=1, $redraw=false) | |
progressSet ($current, $redraw=false) | |
progressFinish () | |
Protected Member Functions | |
getDialogHelper () | |
getProgressHelper () | |
getTableHelper () | |
Protected Attributes | |
$output | |
$dialogHelper | |
$progressHelper | |
$tableHelper | |
A wrapper for Symfony ConsoleOutput and related helpers
Definition at line 28 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
__construct | ( | ) |
Creates and initializes the SymfonyConsoleOutput instance
Definition at line 55 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
References ConsoleOutput\output().
ask | ( | $question, | |
$default = null , |
|||
array | $autocomplete = null |
||
) |
Asks a question to the user
string | array | $question | The question to ask. If an array each array item is turned into one line of a multi-line question |
string | $default | The default answer if none is given by the user |
array | $autocomplete | List of values to autocomplete. This only works if "stty" is installed |
\RuntimeException | If there is no data to read in the input stream |
Definition at line 166 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
References ConsoleOutput\getDialogHelper(), and ConsoleOutput\output().
askAndValidate | ( | $question, | |
$validator, | |||
$attempts = false , |
|||
$default = null , |
|||
array | $autocomplete = null |
||
) |
Asks for a value and validates the response
The validator receives the data to validate. It must return the validated data when the data is valid and throw an exception otherwise.
string | array | $question | The question to ask. If an array each array item is turned into one line of a multi-line question |
callable | $validator | A PHP callback that gets a value and is expected to return the (transformed) value or throw an exception if it wasn't valid |
int | bool | $attempts | Max number of times to ask before giving up (false by default, which means infinite) |
string | $default | The default answer if none is given by the user |
array | $autocomplete | List of values to autocomplete. This only works if "stty" is installed |
\Exception | When any of the validators return an error |
Definition at line 213 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
References ConsoleOutput\getDialogHelper(), and ConsoleOutput\output().
askConfirmation | ( | $question, | |
$default = true |
|||
) |
Asks a confirmation to the user.
The question will be asked until the user answers by nothing, yes, or no.
string | array | $question | The question to ask. If an array each array item is turned into one line of a multi-line question |
bool | $default | The default answer if the user enters nothing |
Definition at line 180 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
References ConsoleOutput\getDialogHelper(), and ConsoleOutput\output().
askHiddenResponse | ( | $question, | |
$fallback = true |
|||
) |
Asks a question to the user, the response is hidden
string | array | $question | The question. If an array each array item is turned into one line of a multi-line question |
bool | $fallback | In case the response can not be hidden, whether to fallback on non-hidden question or not |
\RuntimeException | In case the fallback is deactivated and the response can not be hidden |
Definition at line 193 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
References ConsoleOutput\getDialogHelper(), and ConsoleOutput\output().
askHiddenResponseAndValidate | ( | $question, | |
$validator, | |||
$attempts = false , |
|||
$fallback = true |
|||
) |
Asks for a value, hide and validates the response
The validator receives the data to validate. It must return the validated data when the data is valid and throw an exception otherwise.
string | array | $question | The question to ask. If an array each array item is turned into one line of a multi-line question |
callable | $validator | A PHP callback that gets a value and is expected to return the (transformed) value or throw an exception if it wasn't valid |
int | bool | $attempts | Max number of times to ask before giving up (false by default, which means infinite) |
bool | $fallback | In case the response can not be hidden, whether to fallback on non-hidden question or not |
\Exception | When any of the validators return an error |
\RuntimeException | In case the fallback is deactivated and the response can not be hidden |
Definition at line 233 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
References ConsoleOutput\getDialogHelper(), and ConsoleOutput\output().
|
protected |
Returns or initializes the symfony/console DialogHelper
Definition at line 290 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
References ConsoleOutput\$dialogHelper.
Referenced by ConsoleOutput\ask(), ConsoleOutput\askAndValidate(), ConsoleOutput\askConfirmation(), ConsoleOutput\askHiddenResponse(), ConsoleOutput\askHiddenResponseAndValidate(), and ConsoleOutput\select().
getMaximumLineLength | ( | ) |
Returns the desired maximum line length for console output.
Definition at line 70 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
Referenced by ConsoleOutput\outputFormatted().
|
protected |
Returns or initializes the symfony/console ProgressHelper
Definition at line 305 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
References ConsoleOutput\$progressHelper.
Referenced by ConsoleOutput\progressAdvance(), ConsoleOutput\progressFinish(), ConsoleOutput\progressSet(), and ConsoleOutput\progressStart().
|
protected |
Returns or initializes the symfony/console TableHelper
Definition at line 318 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
References ConsoleOutput\$tableHelper.
Referenced by ConsoleOutput\outputTable().
output | ( | $text, | |
array | $arguments = array() |
||
) |
Outputs specified text to the console window You can specify arguments that will be passed to the text via sprintf
string | $text | Text to output |
array | $arguments | Optional arguments to use for sprintf |
Definition at line 84 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
Referenced by ConsoleOutput\__construct(), ConsoleOutput\ask(), ConsoleOutput\askAndValidate(), ConsoleOutput\askConfirmation(), ConsoleOutput\askHiddenResponse(), ConsoleOutput\askHiddenResponseAndValidate(), ConsoleOutput\outputLine(), ConsoleOutput\outputTable(), ConsoleOutput\progressStart(), and ConsoleOutput\select().
outputFormatted | ( | $text = '' , |
|
array | $arguments = array() , |
||
$leftPadding = 0 |
|||
) |
Formats the given text to fit into the maximum line length and outputs it to the console window
string | $text | Text to output |
array | $arguments | Optional arguments to use for sprintf |
int | $leftPadding | The number of spaces to use for indentation |
Definition at line 116 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
References ConsoleOutput\getMaximumLineLength(), and ConsoleOutput\outputLine().
outputLine | ( | $text = '' , |
|
array | $arguments = array() |
||
) |
Outputs specified text to the console window and appends a line break
string | $text | Text to output |
array | $arguments | Optional arguments to use for sprintf |
Definition at line 101 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
References ConsoleOutput\output().
Referenced by ConsoleOutput\outputFormatted().
outputTable | ( | $rows, | |
$headers = null |
|||
) |
Renders a table like output of the given $rows
array | $rows | |
array | $headers |
Definition at line 131 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
References ConsoleOutput\$tableHelper, ConsoleOutput\getTableHelper(), and ConsoleOutput\output().
progressAdvance | ( | $step = 1 , |
|
$redraw = false |
|||
) |
Advances the progress output X steps
int | $step | Number of steps to advance |
bool | $redraw | Whether to redraw or not |
\LogicException |
Definition at line 257 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
References ConsoleOutput\getProgressHelper().
progressFinish | ( | ) |
Finishes the progress output
Definition at line 280 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
References ConsoleOutput\getProgressHelper().
progressSet | ( | $current, | |
$redraw = false |
|||
) |
Sets the current progress
int | $current | The current progress |
bool | $redraw | Whether to redraw or not |
\LogicException |
Definition at line 270 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
References ConsoleOutput\getProgressHelper().
progressStart | ( | $max = null | ) |
Starts the progress output
int | $max | Maximum steps. If NULL an indeterminate progress bar is rendered |
Definition at line 244 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
References ConsoleOutput\getProgressHelper(), and ConsoleOutput\output().
select | ( | $question, | |
$choices, | |||
$default = null , |
|||
$multiSelect = false , |
|||
$attempts = false |
|||
) |
Asks the user to select a value
string | array | $question | The question to ask. If an array each array item is turned into one line of a multi-line question |
array | $choices | List of choices to pick from |
bool | $default | The default answer if the user enters nothing |
bool | $multiSelect | If TRUE the result will be an array with the selected options. Multiple options can be given separated by commas |
bool | int | $attempts | Max number of times to ask before giving up (false by default, which means infinite) |
\InvalidArgumentException |
Definition at line 152 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
References ConsoleOutput\getDialogHelper(), and ConsoleOutput\output().
|
protected |
Definition at line 38 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
Referenced by ConsoleOutput\getDialogHelper().
|
protected |
Definition at line 33 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
|
protected |
Definition at line 43 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
Referenced by ConsoleOutput\getProgressHelper().
|
protected |
Definition at line 48 of file typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php.
Referenced by ConsoleOutput\getTableHelper(), and ConsoleOutput\outputTable().