Zend Framework
3.0
|
Public Member Functions | |
write ($text, $color=null, $bgColor=null) | |
Write a chunk of text to console. | |
writeText ($text, $color=null, $bgColor=null) | |
Alias for write() | |
writeLine ($text="", $color=null, $bgColor=null) | |
Write a single line of text to console and advance cursor to the next line. | |
writeAt ($text, $x, $y, $color=null, $bgColor=null) | |
Write a piece of text at the coordinates of $x and $y. | |
writeBox ($x1, $y1, $x2, $y2, $lineStyle=self::LINE_SINGLE, $fillStyle=self::FILL_NONE, $color=null, $bgColor=null, $fillColor=null, $fillBgColor=null) | |
Write a box at the specified coordinates. | |
writeTextBlock ($text, $width, $height=null, $x=0, $y=0, $color=null, $bgColor=null) | |
Write a block of text at the given coordinates, matching the supplied width and height. | |
getWidth () | |
Determine and return current console width. | |
getHeight () | |
Determine and return current console height. | |
getSize () | |
Determine and return current console width and height. | |
isUtf8 () | |
Check if console is UTF-8 compatible. | |
setPos ($x, $y) | |
Set cursor position. | |
hideCursor () | |
Hide console cursor. | |
showCursor () | |
Show console cursor. | |
getTitle () | |
Return current console window title. | |
colorize ($string, $color=null, $bgColor=null) | |
Prepare a string that will be rendered in color. | |
setColor ($color) | |
Change current drawing color. | |
setBgColor ($color) | |
Change current drawing background color. | |
resetColor () | |
Reset color to console default. | |
setCharset (CharsetInterface $charset) | |
Set Console charset to use. | |
getCharset () | |
Get charset currently in use by this adapter. | |
getDefaultCharset () | |
clear () | |
Clear console screen. | |
clearLine () | |
Clear line at cursor position. | |
clearScreen () | |
Clear console screen. | |
readLine ($maxLength=2048) | |
Read a single line from the console input. | |
readChar ($mask=null) | |
Read a single character from the console input. | |
Public Attributes | |
const | LINE_NONE = 1 |
const | LINE_SINGLE = 2 |
const | LINE_DOUBLE = 3 |
const | LINE_BLOCK = 4 |
const | FILL_NONE = 0 |
const | FILL_SHADE_LIGHT = 1 |
const | FILL_SHADE_MEDIUM = 2 |
const | FILL_SHADE_DARK = 3 |
const | FILL_BLOCK = 10 |
clear | ( | ) |
Clear console screen.
Implemented in AbstractAdapter, Posix, Windows, and WindowsAnsicon.
clearLine | ( | ) |
Clear line at cursor position.
Implemented in AbstractAdapter, Windows, and WindowsAnsicon.
clearScreen | ( | ) |
colorize | ( | $string, | |
$color = null , |
|||
$bgColor = null |
|||
) |
Prepare a string that will be rendered in color.
string | $string | |
null | int | $color | Foreground color |
null | int | $bgColor | Background color |
Implemented in AbstractAdapter, and Posix.
getCharset | ( | ) |
Get charset currently in use by this adapter.
Implemented in AbstractAdapter, Posix, Windows, WindowsAnsicon, and Virtual.
getDefaultCharset | ( | ) |
Implemented in AbstractAdapter, Posix, Windows, WindowsAnsicon, and Virtual.
getHeight | ( | ) |
Determine and return current console height.
Implemented in AbstractAdapter, Posix, WindowsAnsicon, Windows, and Virtual.
getSize | ( | ) |
Determine and return current console width and height.
Implemented in AbstractAdapter.
getTitle | ( | ) |
Return current console window title.
Implemented in AbstractAdapter, Windows, WindowsAnsicon, and Virtual.
getWidth | ( | ) |
Determine and return current console width.
Implemented in AbstractAdapter, Posix, WindowsAnsicon, Windows, and Virtual.
hideCursor | ( | ) |
isUtf8 | ( | ) |
Check if console is UTF-8 compatible.
Implemented in AbstractAdapter, Posix, Windows, WindowsAnsicon, and Virtual.
readChar | ( | $mask = null | ) |
Read a single character from the console input.
string | null | $mask | A list of allowed chars |
Implemented in AbstractAdapter, Posix, Windows, and WindowsAnsicon.
readLine | ( | $maxLength = 2048 | ) |
Read a single line from the console input.
int | $maxLength | Maximum response length |
Implemented in AbstractAdapter, and Windows.
resetColor | ( | ) |
setBgColor | ( | $color | ) |
Change current drawing background color.
int | $color |
Implemented in AbstractAdapter, and Posix.
setCharset | ( | CharsetInterface | $charset | ) |
Set Console charset to use.
CharsetInterface | $charset |
Implemented in WindowsAnsicon.
setColor | ( | $color | ) |
Change current drawing color.
int | $color |
Implemented in AbstractAdapter, and Posix.
setPos | ( | $x, | |
$y | |||
) |
showCursor | ( | ) |
write | ( | $text, | |
$color = null , |
|||
$bgColor = null |
|||
) |
Write a chunk of text to console.
string | $text | |
null | int | $color | |
null | int | $bgColor |
Implemented in AbstractAdapter.
writeAt | ( | $text, | |
$x, | |||
$y, | |||
$color = null , |
|||
$bgColor = null |
|||
) |
Write a piece of text at the coordinates of $x and $y.
string | $text | Text to write |
int | $x | Console X coordinate (column) |
int | $y | Console Y coordinate (row) |
null | int | $color | |
null | int | $bgColor |
Implemented in AbstractAdapter.
writeBox | ( | $x1, | |
$y1, | |||
$x2, | |||
$y2, | |||
$lineStyle = self::LINE_SINGLE , |
|||
$fillStyle = self::FILL_NONE , |
|||
$color = null , |
|||
$bgColor = null , |
|||
$fillColor = null , |
|||
$fillBgColor = null |
|||
) |
Write a box at the specified coordinates.
If X or Y coordinate value is negative, it will be calculated as the distance from far right or bottom edge of the console (respectively).
int | $x1 | Top-left corner X coordinate (column) |
int | $y1 | Top-left corner Y coordinate (row) |
int | $x2 | Bottom-right corner X coordinate (column) |
int | $y2 | Bottom-right corner Y coordinate (row) |
int | $lineStyle | (optional) Box border style. |
int | $fillStyle | (optional) Box fill style or a single character to fill it with. |
int | $color | (optional) Foreground color |
int | $bgColor | (optional) Background color |
null | int | $fillColor | (optional) Foreground color of box fill |
null | int | $fillBgColor | (optional) Background color of box fill |
Implemented in AbstractAdapter.
writeLine | ( | $text = "" , |
|
$color = null , |
|||
$bgColor = null |
|||
) |
Write a single line of text to console and advance cursor to the next line.
If the text is longer than console width it will be truncated.
string | $text | |
null | int | $color | |
null | int | $bgColor |
Implemented in Posix, and AbstractAdapter.
writeText | ( | $text, | |
$color = null , |
|||
$bgColor = null |
|||
) |
Alias for write()
string | $text | |
null | int | $color | |
null | int | $bgColor |
Implemented in AbstractAdapter.
writeTextBlock | ( | $text, | |
$width, | |||
$height = null , |
|||
$x = 0 , |
|||
$y = 0 , |
|||
$color = null , |
|||
$bgColor = null |
|||
) |
Write a block of text at the given coordinates, matching the supplied width and height.
In case a line of text does not fit desired width, it will be wrapped to the next line. In case the whole text does not fit in desired height, it will be truncated.
string | $text | Text to write |
int | $width | Maximum block width. Negative value means distance from right edge. |
int | null | $height | Maximum block height. Negative value means distance from bottom edge. |
int | $x | Block X coordinate (column) |
int | $y | Block Y coordinate (row) |
null | int | $color | (optional) Text color |
null | int | $bgColor | (optional) Text background color |
Implemented in AbstractAdapter.
const FILL_BLOCK = 10 |
const FILL_NONE = 0 |
const FILL_SHADE_DARK = 3 |
const FILL_SHADE_LIGHT = 1 |
const FILL_SHADE_MEDIUM = 2 |
const LINE_BLOCK = 4 |
const LINE_DOUBLE = 3 |
const LINE_NONE = 1 |
const LINE_SINGLE = 2 |