Timeline for Add proc_open $pipe inputs on the go dynamically
Current License: CC BY-SA 4.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 7, 2022 at 13:46 | comment | added | Patrick Janser | Perhaps you could dig with some asynchronous PHP libraries and tools and in Symfony's process component. But I don't think it will be easy :-/ | |
| Feb 7, 2022 at 13:27 | comment | added | Chris Haas | As Patrick is saying, HTTP in general, which is what PHP, the backing server and the web browser are all talking over, is request and response, both of which terminate as soon as possible. To "resume" or "continue" a conversation, you need to introduce state of some form, such as an ID cookie on the client side, and a cursor on the server side. And for you C code, you’d want to detach that process somehow, but what out for dangling processes. | |
| Feb 7, 2022 at 12:39 | comment | added | Arun | @PatrickJanser, Thanks for spending time on this. By blocking I mean to wait for an input. So I can create kind of a terminal like UI experience. But I am not getting how to wait for input. It should go to the second input prompt when I enter the first input. | |
| Feb 7, 2022 at 12:35 | comment | added | Patrick Janser | Interesting question! Effectively, you won't be able to stop the PHP so that the user can input the data like in a console. You'll very certainly have to deal with some JavaScript and web sockets might be a path towards the solution. I just don't know if you can have PHP processes that are running for a long time (without a timeout). Some console emulations such as phpbash just send a command via Ajax, execute it and return it to the browser, but it's not what you are trying to do as your command is "blocking" for input/output. | |
| Feb 7, 2022 at 12:19 | history | asked | Arun | CC BY-SA 4.0 |