diff options
author | Cash Costello <cash.costello@gmail.com> | 2012-01-21 10:44:47 -0500 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2012-01-21 10:44:47 -0500 |
commit | a2cfbdeb100324090ffe19d58aeb71c2def83ac8 (patch) | |
tree | ed6b95ea6f9e21101fc467ffe02caaea3eda5975 /engine/lib/sites.php | |
parent | b6284c6e781275e7d545778fb9ae41ba9107bdaa (diff) | |
download | elgg-a2cfbdeb100324090ffe19d58aeb71c2def83ac8.tar.gz elgg-a2cfbdeb100324090ffe19d58aeb71c2def83ac8.tar.bz2 |
cleans up the boot process
Diffstat (limited to 'engine/lib/sites.php')
-rw-r--r-- | engine/lib/sites.php | 40 |
1 files changed, 3 insertions, 37 deletions
diff --git a/engine/lib/sites.php b/engine/lib/sites.php index 337b2d180..850092cad 100644 --- a/engine/lib/sites.php +++ b/engine/lib/sites.php @@ -231,43 +231,6 @@ function get_site_domain($guid) { } /** - * Initialise site handling - * - * Called at the beginning of system running, to set the ID of the current site. - * This is 0 by default, but plugins may alter this behaviour by attaching functions - * to the sites init event and changing $CONFIG->site_id. - * - * @uses $CONFIG - * - * @param string $event Event API required parameter - * @param string $object_type Event API required parameter - * @param null $object Event API required parameter - * - * @return true - * @access private - */ -function sites_boot($event, $object_type, $object) { - global $CONFIG; - - $site = elgg_trigger_plugin_hook("siteid", "system"); - if ($site === null || $site === false) { - $CONFIG->site_id = (int) datalist_get('default_site'); - } else { - $CONFIG->site_id = $site; - } - $CONFIG->site_guid = $CONFIG->site_id; - $CONFIG->site = get_entity($CONFIG->site_guid); - - return true; -} - -// Register event handlers -elgg_register_event_handler('boot', 'system', 'sites_boot', 2); - -// Register with unit test -elgg_register_plugin_hook_handler('unit_test', 'system', 'sites_test'); - -/** * Unit tests for sites * * @param sting $hook unit_test @@ -283,3 +246,6 @@ function sites_test($hook, $type, $value, $params) { $value[] = "{$CONFIG->path}engine/tests/objects/sites.php"; return $value; } + +// Register with unit test +elgg_register_plugin_hook_handler('unit_test', 'system', 'sites_test'); |