We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Bypass response buffering, stream live output

Hi guys,

New to phalcon, just testing the waters here.

One thing I can't figure out is how to do is stream live output (traceroute in this case to an ajax call).

For normal PHP, you'd call ob_start(); echo / print out the results in a loop, and call ob_flush()/flush() after each print job.

I couldn't find anything relevant within Phalcon\Http\Response() that would allow me to do anything similar.

What am I missing?

Thanks for taking the time to read this!


dont think we have that feature. =d



Doing the same thing here works. It looks odd and is a little unconventional, but it works.

$i = 0;
while ($i <= 9001)
    echo $i;

gives you streamed data, same as normal PHP.