PHP command-line-based extension readline

Source: Internet
Author: User

Brief introduction

The ReadLine extension function implements the interface for accessing the GNU ReadLine library. These functions provide a command line that can be edited. An example is a Bash that allows you to use the arrow keys to insert characters or to flip through historical commands. Because of the interactivity of this library, this feature is not very useful in the WEB program you write, but it is very helpful when you write a script that is used on the command line.

Installation configuration

If you want to use the ReadLine function, you must install Libreadline, and you can use a non-GPL Libedit library instead of 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 PHP configuration. If you want to use Libedit instead of ReadLine, configure PHP with the--with-libedit[=dir] option

Related functions

Readline_add_history-adding a line of command-line history

readline_callback_handler_install-Initializes a ReadLine callback interface, and the terminal outputs a prompt and returns immediately

readline_callback_handler_remove-Remove the callback function handle from the previous installation and restore the terminal settings

Readline_callback_read_char-reads a character when a row is received and notifies ReadLine to call the callback function

readline_clear_history-Clear History

readline_completion_function-Registering a completion function

Readline_info-get/Set individual variables inside the ReadLine

readline_list_history-Get 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 the display area

readline_write_history-Write History

readline-reading a line

  • Related Article

    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.