aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-09 19:13:27 -0700
committerredmatrix <git@macgirvin.com>2016-05-09 19:13:27 -0700
commita674b05e96df547ee7429376a09887351d7e27d1 (patch)
treeafb6bcc0e86ab95112332945c7aec1a9428b2769
parentb7e7ef0bf3ad47729ef45282a92a78f0dc0e3ec4 (diff)
downloadvolse-hubzilla-a674b05e96df547ee7429376a09887351d7e27d1.tar.gz
volse-hubzilla-a674b05e96df547ee7429376a09887351d7e27d1.tar.bz2
volse-hubzilla-a674b05e96df547ee7429376a09887351d7e27d1.zip
register shutdown procedure
-rwxr-xr-xboot.php7
-rwxr-xr-xindex.php2
2 files changed, 8 insertions, 1 deletions
diff --git a/boot.php b/boot.php
index a93e09405..4e3412ac0 100755
--- a/boot.php
+++ b/boot.php
@@ -904,6 +904,7 @@ class App {
spl_autoload_register('ZotlabsAutoloader::loader');
self::$meta= new Zotlabs\Web\HttpMeta();
+
}
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.
*/
function killme() {
+ register_shutdown_function('shutdown');
exit;
}
@@ -1643,6 +1645,11 @@ function goaway($s) {
killme();
}
+function shutdown() {
+ global $db;
+ $db->close();
+}
+
/**
* @brief Returns the entity id of locally logged in account or false.
*
diff --git a/index.php b/index.php
index 278be154c..1178881ba 100755
--- a/index.php
+++ b/index.php
@@ -179,4 +179,4 @@ call_hooks('page_end', App::$page['content']);
construct_page($a);
-exit;
+killme();