aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-10 01:30:22 -0700
committerredmatrix <git@macgirvin.com>2016-05-10 01:30:22 -0700
commit0c5434d5e35f13340df5bf5edd22c6d9e9e8379c (patch)
treee5f415574ecce32e370b916ccbe142caf6e83b6a /boot.php
parentbaa7020036f4b6112a58a99d04af2f5287a8c815 (diff)
downloadvolse-hubzilla-0c5434d5e35f13340df5bf5edd22c6d9e9e8379c.tar.gz
volse-hubzilla-0c5434d5e35f13340df5bf5edd22c6d9e9e8379c.tar.bz2
volse-hubzilla-0c5434d5e35f13340df5bf5edd22c6d9e9e8379c.zip
try again with shutdown handler, fix issue #373 (live-pubstream div wasn't present
Diffstat (limited to 'boot.php')
-rwxr-xr-xboot.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/boot.php b/boot.php
index ebf743274..36fd1f68a 100755
--- a/boot.php
+++ b/boot.php
@@ -1633,7 +1633,16 @@ 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');
+
+ // Ensure that closing the database is the last function on the shutdown stack.
+ // If it is closed prematurely sessions might not get saved correctly.
+ // Note the second arg to PHP's session_set_save_handler() seems to order that shutdown
+ // procedure last despite our best efforts, so we don't use that and implictly
+ // call register_shutdown_function('session_write_close'); within Zotlabs\Web\Session::init()
+ // and then register the database close function here where nothing else can register
+ // after it.
+
+ register_shutdown_function('shutdown');
exit;
}