[ Index ] |
|
Code source de Typo3 4.1.3 |
[Code source] [Imprimer] [Statistiques]
Contains base class for TYPO3 cli scripts
Author: | Kasper Skaarhoj <kasperYYYY@typo3.com> |
Poids: | 296 lignes (9 kb) |
Inclus ou requis: | 0 fois |
Référencé: | 0 fois |
Nécessite: | 0 fichiers |
t3lib_cli:: (11 méthodes):
t3lib_cli()
cli_getArgArray()
cli_isArg()
cli_argValue()
cli_getArgIndex()
cli_validateArgs()
cli_keyboardInput()
cli_keyboardInput_yes()
cli_echo()
cli_help()
cli_indent()
t3lib_cli() X-Ref |
Constructor Make sure child classes also call this! return: void |
cli_getArgArray($option,$argv) X-Ref |
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! param: string Option string, eg. "-s" param: array Input argv array return: array Output argv array with all options AFTER the found option. |
cli_isArg($option) X-Ref |
Return true if option is found param: string Option string, eg. "-s" return: boolean TRUE if option found |
cli_argValue($option,$idx=0) X-Ref |
Return argument value param: string Option string, eg. "-s" param: integer Value index, default is 0 (zero) = the first one... return: boolean TRUE if option found |
cli_getArgIndex() X-Ref |
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 return: array |
cli_validateArgs() X-Ref |
Validates if the input arguments in this->cli_args are all listed in this->cli_options and if not, will exit with an error. |
cli_keyboardInput() X-Ref |
Asks stdin for keyboard input and returns the line (after enter is pressed) return: string |
cli_keyboardInput_yes($msg='') X-Ref |
Asks for Yes/No from shell and returns true if "y" or "yes" is found as input. param: string String to ask before... return: boolean TRUE if "y" or "yes" is the input (case insensitive) |
cli_echo($string='',$force=FALSE) X-Ref |
Echos strings to shell, but respective silent-modes param: string The string param: boolean If string should be written even if -s is set (-ss will subdue it!) return: boolean Returns TRUE if string was outputted. |
cli_help() X-Ref |
Prints help-output from ->cli_help array return: void |
cli_indent($str,$indent) X-Ref |
Indentation function for 75 char wide lines. param: string String to break and indent. param: integer Number of space chars to indent. return: string Result |
Généré le : Sun Nov 25 17:13:16 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |