From a2cfbdeb100324090ffe19d58aeb71c2def83ac8 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 21 Jan 2012 10:44:47 -0500 Subject: cleans up the boot process --- engine/lib/database.php | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'engine/lib/database.php') diff --git a/engine/lib/database.php b/engine/lib/database.php index 444bb7cc4..cc2b99f6a 100644 --- a/engine/lib/database.php +++ b/engine/lib/database.php @@ -188,22 +188,6 @@ function db_delayedexecution_shutdown_hook() { } } -/** - * Registers shutdown functions for database profiling and delayed queries. - * - * @note Database connections are established upon first call to database. - * - * @return true - * @elgg_event_handler boot system - * @access private - */ -function init_db() { - register_shutdown_function('db_delayedexecution_shutdown_hook'); - register_shutdown_function('db_profiling_shutdown_hook'); - - return true; -} - /** * Returns (if required, also creates) a database link resource. * @@ -757,6 +741,13 @@ function sanitize_int($int, $signed = true) { } /** - * @elgg_register_event boot system init_db + * Registers shutdown functions for database profiling and delayed queries. + * + * @access private */ -elgg_register_event_handler('boot', 'system', 'init_db', 0); +function init_db() { + register_shutdown_function('db_delayedexecution_shutdown_hook'); + register_shutdown_function('db_profiling_shutdown_hook'); +} + +elgg_register_event_handler('init', 'system', 'init_db'); -- cgit v1.2.3