PHP GNU Readline Functions

EditRocket provides the following information on GNU Readline functions in the PHP source code builder.

string readline ([ string $prompt ] ) - Reads a single line from the user.

bool readline_add_history ( string $line ) - This function adds a line to the command line history.

bool readline_callback_handler_install ( string $prompt , callback $callback ) - Sets up a readline callback interface then prints prompt and immediately returns. Calling this function twice without removing the previous callback interface will automatically and conveniently overwrite the old interface.

bool readline_callback_handler_remove ( void ) - Removes a previously installed callback handler and restores terminal settings.

void readline_callback_read_char ( void ) - Reads a character of user input.

bool readline_clear_history ( void ) - This function clears the entire command line history.

bool readline_completion_function ( callback $function ) - This function registers a completion function. This is the same kind of functionality you'd get if you hit your tab key while using Bash.

mixed readline_info ([ string $varname [, string $newvalue ]] ) - Gets or sets various internal readline variables.

array readline_list_history ( void ) - Gets the entire command line history.

void readline_on_new_line ( void ) - Tells readline that the cursor has moved to a new line.

bool readline_read_history ([ string $filename ] ) - This function reads a command history from a file.

void readline_redisplay ( void ) - Redraws readline to redraw the display.

bool readline_write_history ([ string $filename ] ) - This function writes the command history to a file.