|
eZ Publish
[trunk]
|
CLI handling. More...
Public Member Functions | |
| emptyStyles () | |
| endlineString () | |
| error ($string=false, $addEOL=true) | |
| eZCLI () | |
| getOptions ($config, $argumentConfig, $arguments=false) | |
| gotoColumn ($column) | |
| isLoud () | |
| isQuiet () | |
| isWebOutput () | |
| notice ($string=false, $addEOL=true) | |
| output ($string=false, $addEOL=true) | |
| setIsQuiet ($isQuiet) | |
| Sets whether the output() method should print out anything. | |
| setUseStyles ($useStyles) | |
| style ($name) | |
| stylize ($styleName, $text) | |
| terminalStyle ($name) | |
| terminalStyles () | |
| useStyles () | |
| warning ($string=false, $addEOL=true) | |
| webStyle ($name) | |
| webStyles () | |
Static Public Member Functions | |
| static | hasInstance () |
| static | instance () |
| Returns a shared instance of the eZCLI class. | |
| static | parseOptionString ($configString, &$optionConfig) |
| static | restorePosition () |
| static | storePosition () |
Public Attributes | |
| const | TERMINAL_ENDOFLINE_STRING = "\n" |
CLI handling.
Provides functionality to work with the CLI (Command Line Interface). The CLI can be run from either a terminal (shell) or a web interface.
A typical usage:
$cli = eZCLI::instance(); $cli->setUseStyles( true ); // enable colors $cli->output( "This is a text string" );
| eZCLI::error | ( | $ | string = false, |
| $ | addEOL = true |
||
| ) |
Outputs the string $string to the current interface as an error. If $addEOL is true then the end-of-line string is added.
Definition at line 383 of file ezcli.php.
Referenced by getOptions().
| eZCLI::eZCLI | ( | ) |
Initializes object and detects if the CLI is used.
Definition at line 37 of file ezcli.php.
Referenced by hasInstance(), and instance().
| eZCLI::getOptions | ( | $ | config, |
| $ | argumentConfig, | ||
| $ | arguments = false |
||
| ) |
Parses the arguments from array $arguments (or from command line if $arguments == false) according to the options specified by $config and $argumentConfig. Option arguments can be specified using the following formats: -o (option 'o' in short format) -ovalue (option 'o' in short format with value 'value' ) -o value (option 'o' in short format with value 'value' ) --option (option 'option' in long format) --option=value (option 'option' in long format with value 'value' ) Any argument that does not start with a '-' char or follows an option is considered an argument
| $config | definition of options as string or array in internal format. NB: 'quantifier' descriptor of options right now can only be used to specify 1/many values | |
| $argumentconfig | defition of options as string or array in internal format. NB: UNUSED for now | |
| array | $arguments |
| eZCLI::gotoColumn | ( | $ | column | ) |
| static eZCLI::hasInstance | ( | ) | [static] |
| static eZCLI::instance | ( | ) | [static] |
Returns a shared instance of the eZCLI class.
Definition at line 710 of file ezcli.php.
Referenced by ezpAsynchronousPublisherCliOutput\__construct(), changeSiteAccessSetting(), eZExecution\defaultExceptionHandler(), eZCodeMapper\error(), updateNodeAssignment\execute(), eZFatalError(), help(), helpAdd(), helpCreate(), helpDelete(), helpExport(), helpHelp(), helpImport(), helpInfo(), helpInstall(), helpList(), helpSet(), eZScriptClusterPurge\run(), setEZXMLAttribute(), and eZCodeMapper\warning().
| eZCLI::isLoud | ( | ) |
| eZCLI::isQuiet | ( | ) |
| eZCLI::notice | ( | $ | string = false, |
| $ | addEOL = true |
||
| ) |
| eZCLI::output | ( | $ | string = false, |
| $ | addEOL = true |
||
| ) |
| static eZCLI::parseOptionString | ( | $ | configString, |
| &$ | optionConfig | ||
| ) | [static] |
Parses the string describing command line options into an internal format that is used by getOptions. Format: [o] short-format option, accepts "-o" [o:] short-format option with a value, accepts "-o=value" [o;] short-format option with an optional value, accepts "-o" and "-o=value" [o?] option can be present zero or 1 times (max not enforced yet) [o*] option can be present n times [o+] option can be present 1 or more times (min not enforced yet) [opt] long-format option, accepts "--opt" [o|opt] the option can be given in long or short format [o:|opt:] and [o:+] and similar combinations are also valid weird api: $optionConfig is modified and returned as well
| $configString | string |
| $optionConfig | array - if it is not empty, parsed options are added to it |
Definition at line 439 of file ezcli.php.
Referenced by getOptions(), and eZScript\getOptions().
| static eZCLI::restorePosition | ( | ) | [static] |
| eZCLI::setIsQuiet | ( | $ | isQuiet | ) |
| eZCLI::setUseStyles | ( | $ | useStyles | ) |
| static eZCLI::storePosition | ( | ) | [static] |
| eZCLI::style | ( | $ | name | ) |
| eZCLI::stylize | ( | $ | styleName, |
| $ | text | ||
| ) |
| eZCLI::terminalStyle | ( | $ | name | ) |
| eZCLI::useStyles | ( | ) |
| eZCLI::warning | ( | $ | string = false, |
| $ | addEOL = true |
||
| ) |
| eZCLI::webStyle | ( | $ | name | ) |
| eZCLI::webStyles | ( | ) |
| const eZCLI::TERMINAL_ENDOFLINE_STRING = "\n" |