aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-01-15 17:15:50 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-01-15 17:15:50 +0000
commitacdf3bf5c067c02fa331892fdcafd53c1a50aa1c (patch)
tree3f231d55d6635e1b6cf91e1cfbcfa186714e6b49 /engine/lib
parentbba731d5b4085d7f5b929be41b2114b4dcc7595e (diff)
downloadelgg-acdf3bf5c067c02fa331892fdcafd53c1a50aa1c.tar.gz
elgg-acdf3bf5c067c02fa331892fdcafd53c1a50aa1c.tar.bz2
Added shutdown, system event. Refs #672
git-svn-id: https://code.elgg.org/elgg/trunk@2571 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/elgglib.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 22e6a22d5..0e333896d 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -2070,6 +2070,16 @@
}
+ /**
+ * This function is a shutdown hook registered on startup which does nothing more than trigger a
+ * shutdown event when the script is shutting down, but before database connections have been dropped etc.
+ *
+ */
+ function __elgg_shutdown_hook()
+ {
+ trigger_elgg_event('shutdown', 'system');
+ }
+
function elgg_init() {
// Important actions
register_action('comments/add');
@@ -2079,6 +2089,8 @@
add_menu(elgg_echo('content:latest'), $CONFIG->wwwroot . 'dashboard/latest.php');
// Page handler for JS
register_page_handler('js','js_page_handler');
+ // Register an event triggered at system shutdown
+ register_shutdown_function('__elgg_shutdown_hook');
}
register_elgg_event_handler('init','system','elgg_init');