Can I use fastcgi_finish_request() with Phalcon and how ?

I'd like to use fastcgi_finish_request() (link) to return content to a user but do some additional work befor the script finishes. Is there a way to do it in Phalcon and how?



85.1k

If you want to do extra jobs after sending the output the better place would be after echoing the response:

echo $application->handle()->getContent();
fastcgi_finish_request();

// process extra work here

Thanks for response.

Can you tell me what is actually happening in the framework afer I echo a string in my controller? Is it documented somewhere?



85.1k

The framework has finished its execution, with the output transfered to the CGI you can perform aditional tasks after that.