ANSI
in package
Pure-PHP ANSI Decoder
Tags
Table of Contents
- $ansi : string
- Current ANSI code
- $attr_cell : object
- The current attribute cell
- $attr_row : array<string|int, mixed>
- An empty attribute row
- $attrs : array<string|int, mixed>
- The current screen attributes
- $base_attr_cell : object
- An empty attribute cell
- $history : array<string|int, mixed>
- History
- $history_attrs : array<string|int, mixed>
- History Attributes
- $max_history : int
- Max History
- $max_x : int
- Max Width
- $max_y : int
- Max Height
- $old_x : int
- Old Column
- $old_y : int
- Old Row
- $screen : array<string|int, mixed>
- The current screen text
- $tokenization : array<string|int, mixed>
- Tokenization
- $x : int
- Current Column
- $y : int
- Current Row
- __construct() : ANSI
- Default Constructor.
- _getScreen() : string
- Returns the current screen without preformating
- _newLine() : mixed
- Add a new line
- _processCoordinate() : string
- Returns the current coordinate without preformating
- appendString() : mixed
- Appdend a string
- getHistory() : string
- Returns the current screen and the x previous lines
- getScreen() : string
- Returns the current screen
- loadString() : mixed
- Load a string
- setDimensions() : mixed
- Set terminal width and height
- setHistory() : mixed
- Set the number of lines that should be logged past the terminal height
Properties
$ansi
Current ANSI code
public
string
$ansi
Tags
$attr_cell
The current attribute cell
public
object
$attr_cell
Tags
$attr_row
An empty attribute row
public
array<string|int, mixed>
$attr_row
Tags
$attrs
The current screen attributes
public
array<string|int, mixed>
$attrs
Tags
$base_attr_cell
An empty attribute cell
public
object
$base_attr_cell
Tags
$history
History
public
array<string|int, mixed>
$history
Tags
$history_attrs
History Attributes
public
array<string|int, mixed>
$history_attrs
Tags
$max_history
Max History
public
int
$max_history
Tags
$max_x
Max Width
public
int
$max_x
Tags
$max_y
Max Height
public
int
$max_y
Tags
$old_x
Old Column
public
int
$old_x
Tags
$old_y
Old Row
public
int
$old_y
Tags
$screen
The current screen text
public
array<string|int, mixed>
$screen
Tags
$tokenization
Tokenization
public
array<string|int, mixed>
$tokenization
Tags
$x
Current Column
public
int
$x
Tags
$y
Current Row
public
int
$y
Tags
Methods
__construct()
Default Constructor.
public
__construct() : ANSI
Tags
Return values
ANSI —_getScreen()
Returns the current screen without preformating
public
_getScreen() : string
Tags
Return values
string —_newLine()
Add a new line
public
_newLine() : mixed
Also update the $this->screen and $this->history buffers
Tags
Return values
mixed —_processCoordinate()
Returns the current coordinate without preformating
public
_processCoordinate(mixed $last_attr, mixed $cur_attr, mixed $char) : string
Parameters
- $last_attr : mixed
- $cur_attr : mixed
- $char : mixed
Tags
Return values
string —appendString()
Appdend a string
public
appendString(string $source) : mixed
Parameters
- $source : string
Tags
Return values
mixed —getHistory()
Returns the current screen and the x previous lines
public
getHistory() : string
Tags
Return values
string —getScreen()
Returns the current screen
public
getScreen() : string
Tags
Return values
string —loadString()
Load a string
public
loadString(string $source) : mixed
Parameters
- $source : string
Tags
Return values
mixed —setDimensions()
Set terminal width and height
public
setDimensions(int $x, int $y) : mixed
Resets the screen as well
Parameters
- $x : int
- $y : int
Tags
Return values
mixed —setHistory()
Set the number of lines that should be logged past the terminal height
public
setHistory(mixed $history) : mixed
Parameters
- $history : mixed