Class CLI
Class CLI
Your commandline script should inherit from this class and implement the abstract methods.
Abstract
Namespace: splitbrain\phpcli
License: MIT
Author: Andreas Gohr andi@splitbrain.org
Located at src/CLI.php
Namespace: splitbrain\phpcli
License: MIT
Author: Andreas Gohr andi@splitbrain.org
Located at src/CLI.php
public
|
|
abstract protected
|
#
setup(
Register options and arguments on the given $options object |
abstract protected
|
|
public
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
string
|
#
interpolate( $message, array $context = array() )
Interpolates context values into the message placeholders. |
protected
string
|
$bin
the executed script itself |
|
protected
|
$options
the option parser |
|
public
|
$colors
|
|
protected
array
|
$loglevel
PSR-3 compatible loglevels and their prefix, color, output channel |
#
array(
'debug' => array('', Colors::C_RESET, STDOUT),
'info' => array('ℹ ', Colors::C_CYAN, STDOUT),
'notice' => array('☛ ', Colors::C_CYAN, STDOUT),
'success' => array('✓ ', Colors::C_GREEN, STDOUT),
'warning' => array('⚠ ', Colors::C_BROWN, STDERR),
'error' => array('✗ ', Colors::C_RED, STDERR),
'critical' => array('☠ ', Colors::C_LIGHTRED, STDERR),
'alert' => array('✖ ', Colors::C_LIGHTRED, STDERR),
'emergency' => array('✘ ', Colors::C_LIGHTRED, STDERR),
)
|
protected
string
|
$logdefault
|
#
'info'
|