GNU Readline

はじめに

readline 関数群は、GNU Readline ライブラリへの インターフェイスを実装したものです。これらの関数は、コマンドラインの 編集機能を提供します。一例をあげると、Bash において文字を挿入したり コマンド履歴を走査したりする際に、矢印キーを使用することを 可能にしているものです。 このライブラリは対話的なものであるため、Web アプリケーションで 使用されることはほとんどないでしょう。しかし、 コマンドライン から PHP を使用するスクリプトを書く際には有用です。

PHP 7.1.0 以降、この拡張モジュールは Windows でサポートされます。

警告

readline 拡張モジュールはスレッドセーフではありません! (Apache の mod_winnt のような) 本物のスレッドセーフな SAPI と使わないことを強くお勧めします。

add a note

User Contributed Notes 1 note

up
0
list2011 at lunch dot za dot net
14 years ago
When readline is enabled, php switches the terminal mode to accept line-buffered input.  This means that the proper way to use the cli when you pipe to an interactive command is to explicitly specify that php is not using the terminal for input:

php somescript.php < /dev/null | less
To Top