Zend\Console\Adapter\AbstractAdapter
Common console adapter codebase
Synopsis
class AbstractAdapter
implements
AdapterInterface
{
- // members
- protected null|bool $hasMBString;
- protected CharsetInterface $charset;
- protected int $posX;
- protected int $posY;
- // methods
- public void write()
- public void writeText()
- public void writeLine()
- public void writeAt()
- public void writeBox()
- public void writeTextBlock()
- public int getWidth()
- public int getHeight()
- public array getSize()
- public bool isUtf8()
- public void setPos()
- public void showCursor()
- public void hideCursor()
- public string getTitle()
- public string colorize()
- public void setColor()
- public void setBgColor()
- public void resetColor()
- public void setCharset()
- public CharsetInterface getCharset()
- public Utf8 getDefaultCharset()
- public void clear()
- public void clearLine()
- public void clearScreen()
- public string readLine()
- public string readChar()
- public string encodeText()
Hierarchy
Extended by
- Zend\Console\Adapter\Posix
- Zend\Console\Adapter\Windows
- Zend\Console\Adapter\WindowsAnsicon
- Zend\Console\Adapter\Virtual
Implements
Constants
Name | Value |
---|---|
LINE_NONE | 1 |
LINE_SINGLE | 2 |
LINE_DOUBLE | 3 |
LINE_BLOCK | 4 |
FILL_NONE | 0 |
FILL_SHADE_LIGHT | 1 |
FILL_SHADE_MEDIUM | 2 |
FILL_SHADE_DARK | 3 |
FILL_BLOCK | 10 |
Members
protected
- $charset — Zend\Console\Adapter\Charset\CharsetInterface
- $hasMBString
—
Zend\Console\Adapter\null|bool
Whether or not mbstring is enabled - $posX
—
int
Current cursor X position - $posY
—
int
Current cursor Y position
Methods
public
- clear() — Clear console screen
- clearLine() — Clear line at cursor position
- clearScreen() — Clear console screen
- colorize() — Prepare a string that will be rendered in color.
- encodeText() — Encode a text to match console encoding
- getCharset() — Get charset currently in use by this adapter.
- getDefaultCharset()
- getHeight() — Determine and return current console height.
- getSize() — Determine and return current console width and height.
- getTitle() — Return current console window title.
- getWidth() — Determine and return current console width.
- hideCursor() — Hide console cursor
- isUtf8() — Check if console is UTF-8 compatible
- readChar() — Read a single character from the console input
- readLine() — Read a single line from the console input
- resetColor() — Reset color to console default.
- setBgColor() — Change current drawing background color
- setCharset() — Set Console charset to use.
- setColor() — Change current drawing color.
- setPos() — Set cursor position
- showCursor() — Show console cursor
- write() — Write a chunk of text to console.
- writeAt() — Write a piece of text at the coordinates of $x and $y
- writeBox() — Write a box at the specified coordinates.
- writeLine() — Write a single line of text to console and advance cursor to the next line.
- writeText() — Alias for write()
- writeTextBlock() — Write a block of text at the given coordinates, matching the supplied width and height.