Output buffer?

So, how to clean output from phalcon.

Tried all ob_* functions = nothing. Tried flush(); - nothing.


try ob_flush() , but after line where you are outputting content

edited Jun '14

Still nothing. Even if I'm doing like:

ob_start(); echo 123; ob_flush();

it still prints 123. Is phalcon using other output buffering?

yes, output buffering is enabled by default ... are you having problem to output something or to not output ? maybe i didnt understand you well


I`ve problems disabling output. Tried to disable it everywhere, starting from controllers till views, and index.php, but still phalcon generates output...

Output buffers can be nested so try:

while (ob_get_level()) ob_end_flush();

I just had the same problem. It looks like Phalcon flushes the current output buffer level and creates it's own when starting the dispatch loop. This looks strange, but it works for me:

<do you stuff>
$output = ob_get_clean();

Best Fabian

I'm working with the new server-sent message API and the current Phalcon situation is not ideal. Ideally I would like to see a single command that disabled the use of views and also tear down the current buffers and force the sending of the header and then to not try to tear down the normal buffering since it was already cleared out. This is similar to how a Response redirect will automatically call $view->disable when redirecting.