Using Ncurses with PHP, anyone?

Written by Niels on

Hey there,

Lately I started with a big PHP project that's designed around a server/client concept (nothing is written yet, still in designing phase). Briefly said, it's going to be a server that looks for "tasks" in a database and calls backend plugins to perform a called task, well, that's a very simple explanation.

For the client I'm considering two possible implementations, the first is going to be written for a webserver, so php/html. It's meant for submitting "tasks" to the server and offering a few wizards to the user that files tasks to the "jobserver".

Well, the second I'm thinking about should be interactive, and instead of using html's meta-refresh and ajax (which is too limited and sparse for me) I'm thinking about using php's ncurses library. This client can be used for interactive monitoring and the fancy stuff like statistics and graphs (tough the last two are planned for the _very_ far future).

Now my problem. I've studied PHP's ncurses functions extensively today and unfortunately found out that it is very low-level, so that would require me to do a lot of difficult calculations to get everything positioned correctly. It doesn't have any fancy and easy usable layout management functions, or out-of-the-box usable widgets (dialogs, buttons, lineedit's) like in Qt. It would be a dream for me to just create a layout, add a few windows and dialogs and catch events and user input from dialogs, instead of dealing with catching key-events and mouse clicks.

So my question to anybody out there having experience with ncurses in PHP. Is there a good and flexible PHP library/class that I can call easily without having too much ncurses commands and preferably no calculations and positioning issues within my own codebase? I've not really been able to find something that's going to work for me.

I'm happily looking forward to responses :)

Thank you very much in advance! Niels

Fun