Php command line-based extension Readline

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.