Output buffer?

So, how to clean output from phalcon.

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

Suggestions?

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



5.6k
edited Jun '14

Still nothing. Even if I'm doing like:

obstart(); echo 123; obflush();

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



5.6k

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:

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

Best Fabian



44.6k

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.