]> granicus.if.org Git - php/commit
- Improved CLI Interactive readline shell (Johannes)
authorJohannes Schlüter <johannes@php.net>
Thu, 20 May 2010 20:55:33 +0000 (20:55 +0000)
committerJohannes Schlüter <johannes@php.net>
Thu, 20 May 2010 20:55:33 +0000 (20:55 +0000)
commit61db5cf98a91916c23ae4adf3754b2ef94a4fbb2
tree1e0527691b9773d5edf32340d653810dd1d276a4
parent31f62dbc72f5d2c2670a1e3646a4bf2e62f0321d
- Improved CLI Interactive readline shell (Johannes)
  . Added cli.pager ini setting to set a pager for output.
  . Added cli.prompt ini settingto configure the shell prompt.
  . Added shortcut #inisetting=value to change ini settings at run-time.
  . Don't terminate shell on fatal errors.

A pager can be a an shell command which will receive the command output on its
STDIN channel

php > #cli.pager=less
php > phpinfo();
(output will appear in the pager)
php > #cli.pager=grep -i readline
php > phpcredits();
Readline => Thies C. Arntzen
php > #cli.pager=
(output appears again direct on the terminal)

A prompt can contain a few escape sequences like

php > #cli.prompt=\e[032m\v \e[031m\b \e[34m\> \e[0m
5.3.99-dev php > //Colorful prompt with version number

A prompt can also contaian PHP code in backticks

php > #cli.prompt=`echo gethostname();` \b \>
guybrush php >
NEWS
sapi/cli/php_cli.c
sapi/cli/php_cli_readline.c
sapi/cli/php_cli_readline.h