Documentation TYPO3 par Ameos

t3lib_cli Class Reference

Inheritance diagram for t3lib_cli:
[legend]
List of all members.

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

Detailed Description

Definition at line 60 of file class.t3lib_cli.php.


Member Function Documentation

t3lib_cli::t3lib_cli (  ) 

Constructor Make sure child classes also call this!

Returns:
void

Definition at line 86 of file class.t3lib_cli.php.

References cli_getArgIndex().

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!

Parameters:
string Option string, eg. "-s"
array Input argv array
Returns:
array Output argv array with all options AFTER the found option.

Definition at line 99 of file class.t3lib_cli.php.

t3lib_cli::cli_isArg ( option  ) 

Return true if option is found

Parameters:
string Option string, eg. "-s"
Returns:
boolean TRUE if option found

Definition at line 116 of file class.t3lib_cli.php.

Referenced by tx_lowlevel_cleaner_core::cli_main(), tx_lowlevel_cleaner_core::cli_noExecutionCheck(), tx_lowlevel_cleaner_core::cli_printInfo(), tx_lowlevel_versions::main(), tx_lowlevel_deleted::main(), tx_lowlevel_cleanflexform::main(), and tx_lowlevel_versions::main_autoFix().

t3lib_cli::cli_argValue ( option,
idx = 0 
)

Return argument value

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

Definition at line 127 of file class.t3lib_cli.php.

Referenced by tx_lowlevel_cleaner_core::cli_noExecutionCheck(), tx_lowlevel_cleaner_core::cli_printInfo(), tx_lowlevel_versions::main(), tx_lowlevel_orphan_records::main(), tx_lowlevel_lost_files::main(), tx_lowlevel_deleted::main(), and tx_lowlevel_cleanflexform::main().

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

Returns:
array

Definition at line 138 of file class.t3lib_cli.php.

References $cli_options.

Referenced by t3lib_cli().

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.

References t3lib_div::trimExplode().

Referenced by tx_lowlevel_cleaner_core::cli_main().

t3lib_cli::cli_keyboardInput (  ) 

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

Returns:
string

Definition at line 203 of file class.t3lib_cli.php.

Referenced by cli_keyboardInput_yes().

t3lib_cli::cli_keyboardInput_yes ( msg = ''  ) 

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

Parameters:
string String to ask before...
Returns:
boolean TRUE if "y" or "yes" is the input (case insensitive)

Definition at line 221 of file class.t3lib_cli.php.

References cli_keyboardInput(), and t3lib_div::inList().

Referenced by tx_lowlevel_cleaner_core::cli_main(), and tx_lowlevel_cleaner_core::cli_noExecutionCheck().

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

Echos strings to shell, but respective silent-modes

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

Definition at line 233 of file class.t3lib_cli.php.

Referenced by cli_help(), tx_lowlevel_cleaner_core::cli_main(), tx_lowlevel_cleaner_core::cli_printInfo(), and tx_lowlevel_cleaner_core::cli_referenceIndexCheck().

t3lib_cli::cli_help (  ) 

Prints help-output from ->cli_help array

Returns:
void

Definition at line 248 of file class.t3lib_cli.php.

References cli_echo(), and cli_indent().

Referenced by tx_lowlevel_cleaner_core::cli_main(), tx_lowlevel_versions::main(), tx_lowlevel_rte_images::main(), tx_lowlevel_orphan_records::main(), tx_lowlevel_missing_relations::main(), tx_lowlevel_missing_files::main(), tx_lowlevel_lost_files::main(), tx_lowlevel_double_files::main(), tx_lowlevel_deleted::main(), tx_lowlevel_cleanflexform::main(), tx_lowlevel_cleaner_core::tx_lowlevel_cleaner_core(), tx_lowlevel_cleanflexform::tx_lowlevel_cleanflexform(), tx_lowlevel_deleted::tx_lowlevel_deleted(), tx_lowlevel_double_files::tx_lowlevel_double_files(), tx_lowlevel_lost_files::tx_lowlevel_lost_files(), tx_lowlevel_missing_files::tx_lowlevel_missing_files(), tx_lowlevel_missing_relations::tx_lowlevel_missing_relations(), tx_lowlevel_orphan_records::tx_lowlevel_orphan_records(), tx_lowlevel_rte_images::tx_lowlevel_rte_images(), and tx_lowlevel_versions::tx_lowlevel_versions().

t3lib_cli::cli_indent ( str,
indent 
)

Indentation function for 75 char wide lines.

Parameters:
string String to break and indent.
integer Number of space chars to indent.
Returns:
string Result

Definition at line 286 of file class.t3lib_cli.php.

Referenced by cli_help().


Member Data Documentation

t3lib_cli::$cli_options

Initial value:

 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.'),
        )

Definition at line 63 of file class.t3lib_cli.php.

Referenced by cli_getArgIndex().

t3lib_cli::$cli_help

Initial value:

 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]',
                )

Definition at line 68 of file class.t3lib_cli.php.


The documentation for this class was generated from the following file:


Généré par Les experts TYPO3 avec  doxygen 1.4.6