Missing functions in libedit replacement for readline

Asked by Scott Bowers

I've found a problem with the libedit replacement of the readline extension in php in that it doesn't implement all of the readline functions. In particular readline_callback_handler_install, readline_callback_handler_remove, and readline_callback_read_char are not available. The lack of these functions make it impossible to use readline in a non-blocking way. Specifically, libedit prevents you from catching any signals to the process, sighup, sigint, etc.

I know I can re-compile PHP with readline support, but I'm in the process of developing a PHP framework and it would be nice to develop a solution that would work out of the box for most common Linux distributions.

Can you tell me how I can get support for these functions in PHP, or perhaps how I can use readline (libedit) in conjunction with pcntl_signal() to catch control-c and other signals?

Thanks so much,
Scott Bowers.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu libedit Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
mycae (mycae) said :
#1

This is a topic currently under discussion by Debian, due to licensing problems. I don't think libreadline is going away, its just not going to be linked by default

You might be able to override the libedit calls with libreadline instead using the LD_PRELOAD hack to redirect the shared object calls:

http://lwn.net/Articles/428111/

Can you help with this problem?

Provide an answer of your own, or ask Scott Bowers for more information if necessary.

To post a message you must log in.