added onShutdown event that fires after the connection has been closed (background processing)

This commit is contained in:
Andy Miller
2014-09-06 14:32:21 -06:00
parent cd5707f2d2
commit 2a43983ede

View File

@@ -215,8 +215,18 @@ class Grav extends Container
*/
public function shutdown()
{
set_time_limit(0);
ignore_user_abort(true);
header('Content-length: ' . ob_get_length());
header("Connection: close\r\n");
ob_end_flush();
ob_flush();
flush();
session_write_close();
$this->fireEvent('onShutdown');
}
}