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!



1.4k

dont think we have that feature. =d



417

Actually,

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

$i = 0;
while ($i <= 9001)
{
    echo $i;
    ob_flush();
    $i++;
}

gives you streamed data, same as normal PHP.