PHP Класс PHPDaemon\Utils\Terminal

Автор: Vasily Zorin ([email protected])
Наследование: use trait PHPDaemon\Traits\ClassWatchdog, use trait PHPDaemon\Traits\StaticObjectWatchdog
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$columns Maximum terminal width
$enableColor Is color allowed in terminal?

Открытые методы

Метод Описание
__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

Защищенные методы

Метод Описание
getMaxColumns ( ) : integer Counting terminal char width

Описание методов

__construct() публичный Метод

Constructor
public __construct ( )

clearScreen() публичный Метод

Clear the terminal with CLR
public clearScreen ( ) : void
Результат void

drawParam() публичный Метод

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
Результат void

drawTable() публичный Метод

Draw a table
public drawTable ( $rows ) : void
Результат void

enableColor() публичный Метод

Enables/disable color
public enableColor ( boolean $bool = true ) : void
$bool boolean Enable?
Результат void

getMaxColumns() защищенный Метод

Counting terminal char width
protected getMaxColumns ( ) : integer
Результат integer

readln() публичный Метод

Read a line from STDIN
public readln ( ) : string
Результат string Line

resetStyle() публичный Метод

Reset style to default
public resetStyle ( ) : void
Результат void

setStyle() публичный Метод

Set text style
public setStyle ( string $c ) : void
$c string Style
Результат void

Описание свойств

$columns защищенное свойство

Maximum terminal width
protected $columns

$enableColor защищенное свойство

Is color allowed in terminal?
protected $enableColor