PHP Class PHPDaemon\Utils\Terminal

Author: Vasily Zorin ([email protected])
Inheritance: use trait PHPDaemon\Traits\ClassWatchdog, use trait PHPDaemon\Traits\StaticObjectWatchdog
Afficher le fichier Open project: kakserpom/phpdaemon Class Usage Examples

Protected Properties

Свойство Type Description
$columns Maximum terminal width
$enableColor Is color allowed in terminal?

Méthodes publiques

Méthode Description
__construct ( ) Constructor
clearScreen ( ) : void Clear the terminal with CLR
drawParam ( string $name, string $description, array $values = '' ) : void Draw param (like in man)
drawTable ( $rows ) : void Draw a table
enableColor ( boolean $bool = true ) : void Enables/disable color
readln ( ) : string Read a line from STDIN
resetStyle ( ) : void Reset style to default
setStyle ( string $c ) : void Set text style

Méthodes protégées

Méthode Description
getMaxColumns ( ) : integer Counting terminal char width

Method Details

__construct() public méthode

Constructor
public __construct ( )

clearScreen() public méthode

Clear the terminal with CLR
public clearScreen ( ) : void
Résultat void

drawParam() public méthode

Draw param (like in man)
public drawParam ( string $name, string $description, array $values = '' ) : void
$name string Param name
$description string Param description
$values array Param allowed values
Résultat void

drawTable() public méthode

Draw a table
public drawTable ( $rows ) : void
Résultat void

enableColor() public méthode

Enables/disable color
public enableColor ( boolean $bool = true ) : void
$bool boolean Enable?
Résultat void

getMaxColumns() protected méthode

Counting terminal char width
protected getMaxColumns ( ) : integer
Résultat integer

readln() public méthode

Read a line from STDIN
public readln ( ) : string
Résultat string Line

resetStyle() public méthode

Reset style to default
public resetStyle ( ) : void
Résultat void

setStyle() public méthode

Set text style
public setStyle ( string $c ) : void
$c string Style
Résultat void

Property Details

$columns protected_oe property

Maximum terminal width
protected $columns

$enableColor protected_oe property

Is color allowed in terminal?
protected $enableColor