PHP extension-Readline extension based on command line
Introduction
The readline extension function provides interfaces for accessing the GNU Readline library. these functions provide editable command lines. in Bash, you can use arrow buttons to insert characters or read history commands. because of the interaction feature of this library, this function is of little use in the Web programs you write, but it is very useful when the scripts you write are used in command lines.
Install configurations
To use the readline function, you must install libreadline. you can also use a non-GPL libedit library to replace the readline library.
To use these functions, you must enable readline support when compiling the CGI or CLI version of PHP. you need to use the -- with-readline [= DIR] option when compiling and configuring PHP. if you want to use libedit instead of readline, use the -- with-libedit [= DIR] option when configuring PHP.
Related functions
Readline_add_history-add a command line history
Readline_callback_handler_install-initialize a readline callback interface, and then the terminal outputs the prompt information and returns immediately
Readline_callback_handler_remove-remove the callback function handle of the previous installation and restore terminal settings
Readline_callback_read_char-when a row is received, read one character and notify readline to call the callback function.
Readline_clear_history-Clear History
Readline_completion_function-register a completion function
Readline_info-get/set various variables in readline
Readline_list_history-get the command history list
Readline_on_new_line-notifies readline to move the cursor to a new line
Readline_read_history-read command history
Readline_redisplay-redraw display area
Readline_write_history-write history
Readline-read a row