I am using Kohana 3 and I have a controller that extends Kohana_Controller. I call it from the command line using:
php /path/to//index.php --uri="url/path"
It works just fine, but this particular script takes a long time and during the execution I am echoing status messages (echo 'status message';) but none of the messages appear until after the script has completed executing.
I want to see the status messages as they are echoed, can anyone tell me how to do it?
Thanks
It looks like Kohana::init() (likely called in your bootsrap) calls an
ob_start()
. This means that everything output after that point is contained in the output buffer. To stop this, in your before method in your Controller addob_end_flush()
to output anything that may have already been output and turn off output buffering. Any echo's you make after that should be output immediately.So your code with look like: