Interface AdapterInterface

Summary

Fully Qualified Name: Zend\Console\Adapter\AdapterInterface

Description

Methods

Name Description Defined By
clear() Clear console screen AdapterInterface
clearLine() Clear line at cursor position AdapterInterface
clearScreen() Clear console screen AdapterInterface
colorize() Prepare a string that will be rendered in color. AdapterInterface
getCharset() Get charset currently in use by this adapter. AdapterInterface
getDefaultCharset() AdapterInterface
getHeight() Determine and return current console height. AdapterInterface
getSize() Determine and return current console width and height. AdapterInterface
getTitle() Return current console window title. AdapterInterface
getWidth() Determine and return current console width. AdapterInterface
hideCursor() Hide console cursor AdapterInterface
isUtf8() Check if console is UTF-8 compatible AdapterInterface
readChar() Read a single character from the console input AdapterInterface
readLine() Read a single line from the console input AdapterInterface
resetColor() Reset color to console default. AdapterInterface
setBgColor() Change current drawing background color AdapterInterface
setCharset() Set Console charset to use. AdapterInterface
setColor() Change current drawing color. AdapterInterface
setPos() Set cursor position AdapterInterface
showCursor() Show console cursor AdapterInterface
write() Write a chunk of text to console. AdapterInterface
writeAt() Write a piece of text at the coordinates of $x and $y AdapterInterface
writeBox() Write a box at the specified coordinates. AdapterInterface
writeLine() Write a single line of text to console and advance cursor to the next line. AdapterInterface
writeText() Alias for write() AdapterInterface
writeTextBlock() Write a block of text at the given coordinates, matching the supplied width and height. AdapterInterface

Method Details

clear()

Clear console screen

Returns: void

clearLine()

Clear line at cursor position

Returns: void

clearScreen()

Clear console screen

Returns: void

colorize()

Prepare a string that will be rendered in color.

Parameter Name Type Description
$string string
$color null|int Foreground
$bgColor null|int Background

Returns: string

getCharset()

Get charset currently in use by this adapter.

Returns: \CharsetInterface $charset

getDefaultCharset()

Returns: \CharsetInterface

getHeight()

Determine and return current console height.

Returns: int

getSize()

Determine and return current console width and height.

Returns: array array($width, $height)

getTitle()

Return current console window title.

Returns: string

getWidth()

Determine and return current console width.

Returns: int

hideCursor()

Hide console cursor

Returns: void

isUtf8()

Check if console is UTF-8 compatible

Returns: bool

readChar()

Read a single character from the console input

Parameter Name Type Description
$mask string|null A

Returns: string

readLine()

Read a single line from the console input

Parameter Name Type Description
$maxLength int Maximum

Returns: string

resetColor()

Reset color to console default.

Returns: void

setBgColor()

Change current drawing background color

Parameter Name Type Description
$color int

Returns: void

setCharset()

Set Console charset to use.

Parameter Name Type Description
$charset \CharsetInterface

Returns: void

setColor()

Change current drawing color.

Parameter Name Type Description
$color int

Returns: void

setPos()

Set cursor position

Parameter Name Type Description
$x int
$y int

Returns: void

showCursor()

Show console cursor

Returns: void

write()

Write a chunk of text to console.

Parameter Name Type Description
$text string
$color null|int
$bgColor null|int

Returns: void

writeAt()

Write a piece of text at the coordinates of $x and $y

Parameter Name Type Description
$text string Text
$x int Console
$y int Console
$color null|int
$bgColor null|int

Returns: void

writeBox()

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).

Parameter Name Type Description
$x1 int Top-left
$y1 int Top-left
$x2 int Bottom-right
$y2 int Bottom-right
$lineStyle int (optional)
$fillStyle int (optional)
$color int (optional)
$bgColor int (optional)
$fillColor null|int (optional)
$fillBgColor null|int (optional)

Returns: void

writeLine()

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.

Parameter Name Type Description
$text string
$color null|int
$bgColor null|int

Returns: void

writeText()

Alias for write()

Parameter Name Type Description
$text string
$color null|int
$bgColor null|int

Returns: void

writeTextBlock()

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.

Parameter Name Type Description
$text string Text
$width int Maximum
$height int|null Maximum
$x int Block
$y int Block
$color null|int (optional)
$bgColor null|int (optional)

Returns: void

Top