register shutdown procedure

This commit is contained in:
redmatrix 2016-05-09 19:13:27 -07:00
parent b7e7ef0bf3
commit a674b05e96
2 changed files with 8 additions and 1 deletions

View File

@ -904,6 +904,7 @@ class App {
spl_autoload_register('ZotlabsAutoloader::loader'); spl_autoload_register('ZotlabsAutoloader::loader');
self::$meta= new Zotlabs\Web\HttpMeta(); self::$meta= new Zotlabs\Web\HttpMeta();
} }
public static function get_baseurl($ssl = false) { public static function get_baseurl($ssl = false) {
@ -1632,6 +1633,7 @@ function login($register = false, $form_id = 'main-login', $hiddens=false) {
* @brief Used to end the current process, after saving session state. * @brief Used to end the current process, after saving session state.
*/ */
function killme() { function killme() {
register_shutdown_function('shutdown');
exit; exit;
} }
@ -1643,6 +1645,11 @@ function goaway($s) {
killme(); killme();
} }
function shutdown() {
global $db;
$db->close();
}
/** /**
* @brief Returns the entity id of locally logged in account or false. * @brief Returns the entity id of locally logged in account or false.
* *

View File

@ -179,4 +179,4 @@ call_hooks('page_end', App::$page['content']);
construct_page($a); construct_page($a);
exit; killme();