C
C
Cyril2018-02-24 10:49:29
PHP
Cyril, 2018-02-24 10:49:29

Updating data on the front during php script execution, perhaps?

Good afternoon.
Let's say I wrote a script that parses data from the site.
I will launch it from the front, with an ajax request, at the same time I will send the settings.

So I wondered if it was possible to make the script give me data during parsing, for example, return to the front that the product was parsed, and so after each product, etc. (ala chat on websocket)

Thank you for your attention!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mix-9, 2018-02-24
@mix-9

In the literal sense, no. But you can
1) through the same websocket (php script as a daemon)
2) using 2 scripts: a parser and a status poll, the parser writes the number of processed elements to the file, the second Ajax script returns this
3) parse in parts, request / parse.php? from_id=1000 after response new request

S
Semyon Beloglazov, 2018-02-24
@Batlab

It is forbidden. PHP gives the answer in an instant when the execution of the entire script is over.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question