aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2012-01-24 20:49:06 -0500
committerCash Costello <cash.costello@gmail.com>2012-01-24 20:49:06 -0500
commit54bef9fc0b85acaf6950e618bd02aa50befd2acc (patch)
tree338179e8632d3b09de532a7aea4278ebc555ed81 /engine/lib/elgglib.php
parentbe523eb86e6578030e022da4ff2143087a82eb67 (diff)
parenta2cfbdeb100324090ffe19d58aeb71c2def83ac8 (diff)
downloadelgg-54bef9fc0b85acaf6950e618bd02aa50befd2acc.tar.gz
elgg-54bef9fc0b85acaf6950e618bd02aa50befd2acc.tar.bz2
Merge pull request #150 from cash/boot
Fixes #4317 cleans up the boot process
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r--engine/lib/elgglib.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 5a8c89a56..476408c61 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -2056,6 +2056,33 @@ function elgg_walled_garden() {
}
/**
+ * Boots the engine
+ *
+ * 1. sets error handlers
+ * 2. connects to database
+ * 3. verifies the installation suceeded
+ * 4. loads application configuration
+ * 5. loads site configuration
+ *
+ * @access private
+ */
+function _elgg_engine_boot() {
+ // Register the error handlers
+ set_error_handler('_elgg_php_error_handler');
+ set_exception_handler('_elgg_php_exception_handler');
+
+ register_translations(dirname(dirname(dirname(__FILE__))) . "/languages/");
+
+ setup_db_connections();
+
+ verify_installation();
+
+ _elgg_load_application_config();
+
+ _elgg_load_site_config();
+}
+
+/**
* Elgg's main init.
*
* Handles core actions for comments, the JS pagehandler, and the shutdown function.
@@ -2178,6 +2205,7 @@ define('REFERRER', -1);
define('REFERER', -1);
elgg_register_event_handler('init', 'system', 'elgg_init');
+elgg_register_event_handler('boot', 'system', '_elgg_engine_boot', 1);
elgg_register_plugin_hook_handler('unit_test', 'system', 'elgg_api_test');
elgg_register_event_handler('init', 'system', 'add_custom_menu_items', 1000);