helpers\BaseConsole saveCursorPosition()

saveCursorPosition() public static method Saves the current cursor position by sending ANSI control code SCP to the terminal. Position can then be restored with restoreCursorPosition(). public static void saveCursorPosition ( )

helpers\BaseConsole restoreCursorPosition()

restoreCursorPosition() public static method Restores the cursor position saved with saveCursorPosition() by sending ANSI control code RCP to the terminal. public static void restoreCursorPosition ( )

helpers\BaseConsole renderColoredString()

renderColoredString() public static method Converts a string to ansi formatted by replacing patterns like %y (for yellow) with ansi control codes Uses almost the same syntax as https://github.com/pear/Console_Color2/blob/master/Console/Color2.php The conversion table is: ('bold' meaning 'light' on some terminals). It's almost the same conversion table irssi uses. text text background ------------------------------------------------ %k %K %0 black dark

helpers\BaseConsole prompt()

prompt() public static method Prompts the user for input and validates it public static string prompt ( $text, $options = [] )$text string Prompt string $options array The options to validate the input: required: whether it is required or not default: default value if no input is inserted by the user pattern: regular expression pattern to validate user input validator: a callable function to validate input. The function must accept two parameters: input: the user input to validate

helpers\BaseConsole output()

output() public static method Prints text to STDOUT appended with a carriage return (PHP_EOL). public static integer|boolean output ( $string = null )$string string The text to print return integer|boolean Number of bytes printed or false on error.

helpers\BaseConsole moveCursorUp()

moveCursorUp() public static method Moves the terminal cursor up by sending ANSI control code CUU to the terminal. If the cursor is already at the edge of the screen, this has no effect. public static void moveCursorUp ( $rows = 1 )$rows integer Number of rows the cursor should be moved up

helpers\BaseConsole moveCursorTo()

moveCursorTo() public static method Moves the cursor to an absolute position given as column and row by sending ANSI control code CUP or CHA to the terminal. public static void moveCursorTo ( $column, $row = null )$column integer 1-based column number, 1 is the left edge of the screen. $row integer|null 1-based row number, 1 is the top edge of the screen. if not set, will move cursor only in current line.

helpers\BaseConsole moveCursorPrevLine()

moveCursorPrevLine() public static method Moves the terminal cursor to the beginning of the previous line by sending ANSI control code CPL to the terminal. public static void moveCursorPrevLine ( $lines = 1 )$lines integer Number of lines the cursor should be moved up

helpers\BaseConsole moveCursorNextLine()

moveCursorNextLine() public static method Moves the terminal cursor to the beginning of the next line by sending ANSI control code CNL to the terminal. public static void moveCursorNextLine ( $lines = 1 )$lines integer Number of lines the cursor should be moved down

helpers\BaseConsole moveCursorForward()

moveCursorForward() public static method Moves the terminal cursor forward by sending ANSI control code CUF to the terminal. If the cursor is already at the edge of the screen, this has no effect. public static void moveCursorForward ( $steps = 1 )$steps integer Number of steps the cursor should be moved forward