eZPublish  3.8
eZCLI Class Reference

CLI handling. More...

Public Member Functions

 emptyStyles ()
 
 endlineString ()
 
 error ($string=false, $addEOL=true)
 
 eZCLI ()
 
 getOptions ($config, $argumentConfig, $arguments=false)
 
 hasInstance ()
 
instance ()
 
 isLoud ()
 
 isQuiet ()
 
 isWebOutput ()
 
 notice ($string=false, $addEOL=true)
 
 output ($string=false, $addEOL=true)
 
 parseOptionString ($configString, &$optionConfig)
 
 setIsQuiet ($isQuiet)
 
 setUseStyles ($useStyles)
 
 style ($name)
 
 stylize ($styleName, $text)
 
 terminalStyle ($name)
 
 terminalStyles ()
 
 useStyles ()
 
 warning ($string=false, $addEOL=true)
 
 webStyle ($name)
 
 webStyles ()
 

Static Public Member Functions

 gotoColumn ($column)
 
 restorePosition ()
 
 storePosition ()
 

Detailed Description

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->setUseStyles( true ); // enable colors
$cli->output( "This is a text string" );

Member Function Documentation

eZCLI::emptyStyles ( )
Returns
a hash with empty styles.
eZCLI::endlineString ( )
Returns
the string used to end lines. This is either the
if CLI is used or
if the script is run in a webinterface.

Referenced by error(), notice(), output(), and warning().

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.

eZCLI::eZCLI ( )

Initializes object and detects if the CLI is used.

Referenced by instance().

eZCLI::getOptions (   $config,
  $argumentConfig,
  $arguments = false 
)
eZCLI::gotoColumn (   $column)
static
Returns
an ANSI sequence which will tell the console go to the specified column.
eZCLI::hasInstance ( )
Returns
true if instance of eZCLI already exists otherwise false.
eZCLI::isLoud ( )
Returns
true if output is allowed.
See Also
isQuiet
eZCLI::isQuiet ( )
Returns
true if output is not allowed.
See Also
isLoud

Referenced by error(), notice(), output(), and warning().

eZCLI::isWebOutput ( )
Returns
true if the current script is run in a webinterface.

Referenced by style().

eZCLI::notice (   $string = false,
  $addEOL = true 
)

Outputs the string $string to the current interface as a notice. If $addEOL is true then the end-of-line string is added.

eZCLI::output (   $string = false,
  $addEOL = true 
)

Outputs the string $string to the current interface. If $addEOL is true then the end-of-line string is added.

eZCLI::parseOptionString (   $configString,
$optionConfig 
)

Referenced by getOptions(), and eZScript\getOptions().

eZCLI::restorePosition ( )
static
Returns
an ANSI sequence which will restore the current position.
eZCLI::setIsQuiet (   $isQuiet)

Sets whether the output(), notice(), warning() and error() methods should print out anything.

See Also
isQuiet, isLoud
eZCLI::setUseStyles (   $useStyles)

Controls whether styles are to be used or not. If disabled empty strings are returned when asking for styles.

Note
This only controls the style() function.
eZCLI::storePosition ( )
static
Returns
an ANSI sequence which will store the current position.
eZCLI::style (   $name)
Returns
the style for the name $name. The style is taken from the current interface type.

Referenced by stylize().

eZCLI::stylize (   $styleName,
  $text 
)
Returns
the text $text wrapped in the style $styleName.

Referenced by error(), and warning().

eZCLI::terminalStyle (   $name)
Returns
the style for the name $name. The style is specific for terminals.

Referenced by style().

eZCLI::terminalStyles ( )
Returns
a hash with all terminal styles.
eZCLI::useStyles ( )
Returns
true if styles are enabled.
eZCLI::warning (   $string = false,
  $addEOL = true 
)

Outputs the string $string to the current interface as an warning. If $addEOL is true then the end-of-line string is added.

eZCLI::webStyle (   $name)
Returns
the style for the name $name. The style is specific for web.

Referenced by style().

eZCLI::webStyles ( )
Returns
a hash with all web styles.

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