
Public Member Functions | |
| t3lib_cli () | |
| cli_getArgArray ($option, $argv) | |
| cli_isArg ($option) | |
| cli_argValue ($option, $idx=0) | |
| cli_getArgIndex () | |
| cli_validateArgs () | |
| cli_keyboardInput () | |
| cli_keyboardInput_yes ($msg='') | |
| cli_echo ($string='', $force=FALSE) | |
| cli_help () | |
| cli_indent ($str, $indent) | |
Public Attributes | |
| $cli_args = array() | |
| $cli_options | |
| $cli_help | |
| $stdin = NULL | |
Definition at line 60 of file class.t3lib_cli.php.
| t3lib_cli::t3lib_cli | ( | ) |
Constructor Make sure child classes also call this!
Definition at line 86 of file class.t3lib_cli.php.
| t3lib_cli::cli_getArgArray | ( | $ | option, | |
| $ | argv | |||
| ) |
Finds the arg token (like "-s") in argv and returns the rest of argv from that point on. This should only be used in special cases since this->cli_args should already be prepared with an index of values!
| string | Option string, eg. "-s" | |
| array | Input argv array |
Definition at line 99 of file class.t3lib_cli.php.
| t3lib_cli::cli_isArg | ( | $ | option | ) |
Return true if option is found
| string | Option string, eg. "-s" |
Definition at line 116 of file class.t3lib_cli.php.
| t3lib_cli::cli_argValue | ( | $ | option, | |
| $ | idx = 0 | |||
| ) |
Return argument value
| string | Option string, eg. "-s" | |
| integer | Value index, default is 0 (zero) = the first one... |
Definition at line 127 of file class.t3lib_cli.php.
| t3lib_cli::cli_getArgIndex | ( | ) |
Will parse "_SERVER[argv]" into an index of options and values Argument names (eg. "-s") will be keys and values after (eg. "-s value1 value2 ..." or "-s=value1") will be in the array. Array is empty if no values
Definition at line 138 of file class.t3lib_cli.php.
| t3lib_cli::cli_validateArgs | ( | ) |
Validates if the input arguments in this->cli_args are all listed in this->cli_options and if not, will exit with an error.
Definition at line 162 of file class.t3lib_cli.php.
| t3lib_cli::cli_keyboardInput | ( | ) |
Asks stdin for keyboard input and returns the line (after enter is pressed)
Definition at line 203 of file class.t3lib_cli.php.
| t3lib_cli::cli_keyboardInput_yes | ( | $ | msg = '' |
) |
Asks for Yes/No from shell and returns true if "y" or "yes" is found as input.
| string | String to ask before... |
Definition at line 221 of file class.t3lib_cli.php.
| t3lib_cli::cli_echo | ( | $ | string = '', |
|
| $ | force = FALSE | |||
| ) |
Echos strings to shell, but respective silent-modes
| string | The string | |
| boolean | If string should be written even if -s is set (-ss will subdue it!) |
Definition at line 233 of file class.t3lib_cli.php.
| t3lib_cli::cli_help | ( | ) |
Prints help-output from ->cli_help array
Definition at line 248 of file class.t3lib_cli.php.
| t3lib_cli::cli_indent | ( | $ | str, | |
| $ | indent | |||
| ) |
Indentation function for 75 char wide lines.
| string | String to break and indent. | |
| integer | Number of space chars to indent. |
Definition at line 286 of file class.t3lib_cli.php.