How to execute and display the sequence of operations in PHP?

I need to call a sequence of operations and show the progress of the calls and the results of an already completed operation on one page in PHP. The operation may be a command line call or database update. Content should be updated after each command. What is the best way to do this in PHP. Is there any library I could use?

EDIT: Here I am not actually looking for a terminal emulator. I need to perform a sequence of operations. An operation can be anything (a function call that returns the result). I need to show the result. I was wondering if there is a framework for this. If not, what is the best way to do this?

+4
source share
3 answers

You can do this in one of two ways:

  • (recommended) Create the main page using PHP (quickly), and then follow the logic that takes time to finish using AJAX calls. If you use AJAX calls, you have many options for creating progress status, such as http://jqueryui.com/progressbar/ (JavaScript JavaScript execution bar for Google.

  • Clear the buffer to force messages (which may include progress messages, JavaScript Progress Widget, etc.) to refresh the browser before the PHP page fully loads. According to the API page here http://us2.php.net/flush , this may or may not work well, depending on your web browser.

Geremy

+2
0

Look at the websites. I implemented something similar using Ratchet (socketo.me) with WAMP (web application messaging protocol) and zmq. Any process can send a message via zmq to the websocket server, and then to the client.

0
source

Source: https://habr.com/ru/post/1535874/


All Articles