GNU Readline

简介

readline 扩展函数实现了访问 GNU Readline 库的接口。这些函数提供了可编辑的命令行。一个例子是在 Bash 中允许使用箭头按键来插入字符或者翻看历史命令。因为这个库的交互特性,对编写 Web 应用程序没多大用处,但当编写从命令行使用的脚本时非常有用.

从 PHP 7.1.0 开始,该扩展支持 Windows。

警告

readline 扩展并非线程安全!因此,强烈建议不要在任何真正线程安全的 SAPI(例如 Apache 的 mod_winnt)中使用这个扩展!

添加备注

用户贡献的备注 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