<?php
namespace CLI;
class Cursor {
/**
* Pointer to the stream where the data is sent
* @var resource
*/
public static $stream = STDERR;
}
function up([ $count = 1])
Move the cursor up by count
- int
$count
function down([ $count = 1])
Move the cursor down by count
- int
$count
function forward([ $count = 1])
Move the cursor right by count
- int
$count
function back([ $count = 1])
Move the cursor left by count
- int
$count
function rowcol([ $row = 1 [, $col = 1]])
Move the cursor to a specific row and column
- int
$row
- int
$col
function savepos()
Save the current cursor position
function save()
Save the current cursor position and attributes
function unsave()
Delete the currently saved cursor data
function restore()
Restore the previously saved cursor data
function hide()
Hides the cursor
function show()
Shows the cursor
function wrap([ $wrap = true])
Enable/Disable Auto-Wrap
- bool
$wrap
<?php
namespace CLI;
class Erase {
/**
* Pointer to the stream where the data is sent
* @var resource
*/
public static $stream = STDERR;
}
function eol()
Erase to the end of line
function sol()
Erase to the start of line
function line([ $row = null])
Erase entire line
- int | null
$row
- from a specific row
function down([ $row = null])
Erases everything below the cursor
- int | null
$row
- from a specific row
function up([ $row = null])
Erases everything above the cursor
- int | null
$row
- from a specific row
function screen()
Erases the entire screen
Undocumented Method: Graphics::box($x1, $y1, $x2, $y2 [, $frame = array("-", "|", "-", "|", "x", "x", "x", "x")])
<?php
namespace CLI;
class Misc {
/**
* Pointer to the stream where the data is sent
* @var resource
*/
public static $stream = STDERR;
}
function cols([ $cache = true])
The col size of the current terminal as returned by tput
- bool
$cache
- Whether to cache the response
- int
function rows([ $cache = true])
The row size of the current terminal as returned by tput
- bool
$cache
- Whether to cache the response
- int
function bell([ $count = 1])
Triggers a terminal bell
- int
$count
function savestate()
Save the current state of the terminal via tput
function restorestate()
Restore the current state of the terminal via tput
<?php
namespace CLI;
class Output {
/**
* Pointer to the stream where the data is sent
* @var resource
*/
public static $stream = STDOUT;
}
function string($str [, $row = null [, $col = null]])
Output a string
- string
$str
- String to output - false | int
$row
- The optional row to output to - false | int
$col
- The optional column to output to
function line($str [, $col = null [, $erase = true]])
Output a line, erasing the line first
- string
$str
- String to output - null | int
$col
- The column to draw the current line - bool
$erase
- Clear the line before drawing the passed string
<?php
namespace CLI;
class Screen {
/**
* Pointer to the stream where the data is sent
* @var resource
*/
public static $stream = STDERR;
}
function alternate([ $erase = true])
Switch to the alternate screen buffer, optionally clearing it
function main()
Switch to the main screen buffer
<?php
namespace CLI;
class StatusGUI {
/**
* Pointer to the stream where the data is sent
* @var resource
*/
public static $stream = STDERR;
public static $altstream = STDOUT;
}
function statusbar($str [, $height = null [, $last_line_to_opposing_stream = true]])
Render a statusbar stack
- string
$str
- The status to add - null | int
$height
- The height of the status menu to render - bool
$last_line_to_opposing_stream
- Send the last line of the status to the oposite stream (STDERR/STDOUT)
function progressbar($title, $numerator, $denominator, $line [, $time_id = null [, $color = 'cyan']])
Draw a Progress Bar
- string
$title
- int
$numerator
- int
$denominator
- int
$line
- Which row of the terminal to render - int | null
$time_id
- string
$color
function histogram($title, $numerator, $denominator, $line, $hist_id [, $color = 'normal' [, $full_color = 'red']])
Draw a Histogram
- string
$title
- int
$numerator
- int
$denominator
- int
$line
- int
$hist_id
- string
$color
- string
$full_color
Class Style
function bold($text, $args) : string
function black($text, $args) : string
function blue($text, $args) : string
function green($text, $args) : string
function cyan($text, $args) : string
function red($text, $args) : string
function purple($text, $args) : string
function brown($text, $args) : string
function light_gray($text, $args) : string
function normal($text, $args) : string
function dim($text, $args) : string
function dark_gray($text, $args) : string
function light_blue($text, $args) : string
function light_green($text, $args) : string
function light_cyan($text, $args) : string
function light_red($text, $args) : string
function light_purple($text, $args) : string
function yellow($text, $args) : string
function white($text, $args) : string