Solutions Open Source

Référence de la classe t3lib_cli

Graphe d'héritage de t3lib_cli:

Inheritance graph
[légende]

Liste de tous les membres

Fonctions membres publiques

 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)

Attributs publics

 $cli_args = array()
 $cli_options
 $cli_help
 $stdin = NULL


Documentation des fonctions membres

t3lib_cli::t3lib_cli (  ) 

Constructor Make sure child classes also call this!

Renvoie:
void

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!

Paramètres:
string Option string, eg. "-s"
array Input argv array
Renvoie:
array Output argv array with all options AFTER the found option.

t3lib_cli::cli_isArg ( option  ) 

Return true if option is found

Paramètres:
string Option string, eg. "-s"
Renvoie:
boolean TRUE if option found

t3lib_cli::cli_argValue ( option,
idx = 0 
)

Return argument value

Paramètres:
string Option string, eg. "-s"
integer Value index, default is 0 (zero) = the first one...
Renvoie:
boolean TRUE if option found

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

Renvoie:
array

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.

t3lib_cli::cli_keyboardInput (  ) 

Asks stdin for keyboard input and returns the line (after enter is pressed)

Renvoie:
string

t3lib_cli::cli_keyboardInput_yes ( msg = ''  ) 

Asks for Yes/No from shell and returns true if "y" or "yes" is found as input.

Paramètres:
string String to ask before...
Renvoie:
boolean TRUE if "y" or "yes" is the input (case insensitive)

t3lib_cli::cli_echo ( string = '',
force = FALSE 
)

Echos strings to shell, but respective silent-modes

Paramètres:
string The string
boolean If string should be written even if -s is set (-ss will subdue it!)
Renvoie:
boolean Returns TRUE if string was outputted.

t3lib_cli::cli_help (  ) 

Prints help-output from ->cli_help array

Renvoie:
void

t3lib_cli::cli_indent ( str,
indent 
)

Indentation function for 75 char wide lines.

Paramètres:
string String to break and indent.
integer Number of space chars to indent.
Renvoie:
string Result


Documentation des données membres

t3lib_cli::$cli_args = array()

t3lib_cli::$cli_options

Valeur initiale :

 array(
                array('-s','Silent operation, will only output errors and important messages.'),
                array('--silent','Same as -s'),
                array('-ss','Super silent, will not even output errors or important messages.'),
        )

t3lib_cli::$cli_help

Valeur initiale :

 array(
                        'name' => 'CLI base class (overwrite this...)',
                        'synopsis' => '###OPTIONS###',
                        'description' => 'Class with basic functionality for CLI scripts (overwrite this...)',
                        'examples' => 'Give examples...',
                        'options' => '',
                        'license' => 'GNU GPL - free software!',
                        'author' => '[Author name]',
                )

t3lib_cli::$stdin = NULL


La documentation de cette classe a été générée à partir du fichier suivant :
Généré le Fri Aug 31 11:42:04 2007 pour OBLADY - Typo3 API v4.1.2 par  doxygen 1.5.3