Output buffer caching
dan1elhughes opened this issue · 1 comments
dan1elhughes commented
In my application I call ob_start()
before using Klein and output that after calling $klein->dispatch()
. This seems to not work - does Klein call die()
after completion? I've tested with $k->dispatch(); echo "hello world"
and I do not see the text.
eimajenthat commented
I think Klein uses output buffering in its own dispatch process. So you are effectively calling:
ob_start;
ob_start;
ob_flush;
ob_flush;
I have never done that, but I think there is only one buffer. So when Klein flushes, it flushes everything.
I'm not sure why the echo would fail though. Klein doesn't die after dispatch; my so runs a bunch of shut down code after the dispatch.