Zend Framework
3.0
|
Common console adapter codebase. More...
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. | |
showCursor () | |
Show console cursor. | |
hideCursor () | |
Hide 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 (Charset\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. | |
encodeText ($text) | |
Encode a text to match console encoding. | |
Public Member Functions inherited from AdapterInterface | |
setCharset (CharsetInterface $charset) | |
Set Console charset to use. | |
Protected Attributes | |
$charset | |
$posX | |
$posY | |
Static Protected Attributes | |
static | $hasMBString |
Additional Inherited Members | |
Public Attributes inherited from AdapterInterface | |
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 |
Common console adapter codebase.
clear | ( | ) |
Clear console screen.
Implements AdapterInterface.
clearLine | ( | ) |
Clear line at cursor position.
Implements AdapterInterface.
clearScreen | ( | ) |
Clear console screen.
Implements AdapterInterface.
colorize | ( | $string, | |
$color = null , |
|||
$bgColor = null |
|||
) |
Prepare a string that will be rendered in color.
string | $string | |
int | $color | |
null | int | $bgColor |
Implements AdapterInterface.
encodeText | ( | $text | ) |
Encode a text to match console encoding.
string | $text |
getCharset | ( | ) |
getDefaultCharset | ( | ) |
Implements AdapterInterface.
getHeight | ( | ) |
getSize | ( | ) |
Determine and return current console width and height.
Implements AdapterInterface.
getTitle | ( | ) |
getWidth | ( | ) |
hideCursor | ( | ) |
Hide console cursor.
Implements AdapterInterface.
isUtf8 | ( | ) |
readChar | ( | $mask = null | ) |
Read a single character from the console input.
string | null | $mask | A list of allowed chars |
Implements AdapterInterface.
readLine | ( | $maxLength = 2048 | ) |
Read a single line from the console input.
int | $maxLength | Maximum response length |
Implements AdapterInterface.
resetColor | ( | ) |
Reset color to console default.
Implements AdapterInterface.
setBgColor | ( | $color | ) |
setCharset | ( | Charset\CharsetInterface | $charset | ) |
Set Console charset to use.
Charset\CharsetInterface | $charset |
setColor | ( | $color | ) |
setPos | ( | $x, | |
$y | |||
) |
showCursor | ( | ) |
Show console cursor.
Implements AdapterInterface.
write | ( | $text, | |
$color = null , |
|||
$bgColor = null |
|||
) |
Write a chunk of text to console.
string | $text | |
null | int | $color | |
null | int | $bgColor |
Implements AdapterInterface.
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 |
Implements AdapterInterface.
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 |
Exception\BadMethodCallException | if coordinates are invalid |
Implements AdapterInterface.
writeLine | ( | $text = "" , |
|
$color = null , |
|||
$bgColor = null |
|||
) |
Write a single line of text to console and advance cursor to the next line.
string | $text | |
null | int | $color | |
null | int | $bgColor |
Implements AdapterInterface.
writeText | ( | $text, | |
$color = null , |
|||
$bgColor = null |
|||
) |
Alias for write()
string | $text | |
null | int | $color | |
null | int | $bgColor |
Implements AdapterInterface.
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 |
Exception\InvalidArgumentException |
Implements AdapterInterface.
|
protected |
|
staticprotected |
|
protected |
|
protected |