From 4cf87cd1f558593fe7047440806bc6b7d32e83ee Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 2 May 2008 12:40:38 +0000 Subject: The system now uses the site GUID to get and set entity data. Also, installation is a great deal more visual. git-svn-id: https://code.elgg.org/elgg/trunk@621 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/configuration.php | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'engine/lib/configuration.php') diff --git a/engine/lib/configuration.php b/engine/lib/configuration.php index 5144f0b89..9b608f7c4 100644 --- a/engine/lib/configuration.php +++ b/engine/lib/configuration.php @@ -70,10 +70,9 @@ function set_default_config() { global $CONFIG; - if (empty($CONFIG->path)) $CONFIG->path = str_replace("\\","/",dirname(dirname(dirname(__FILE__)))) . "/"; - + if (empty($CONFIG->viewpath)) $CONFIG->viewpath = $CONFIG->path . "views/"; @@ -81,10 +80,8 @@ $CONFIG->pluginspath = $CONFIG->path . "mod/"; if (empty($CONFIG->wwwroot)) { - $CONFIG->wwwroot = "http://" . $_SERVER['SERVER_NAME']; - /*if (strripos($_SERVER['DOCUMENT_ROOT'],"/") < (strlen($_SERVER['DOCUMENT_ROOT']) - 1)) { - $CONFIG->wwwroot .= "/"; - }*/ + /* + $CONFIG->wwwroot = "http://" . $_SERVER['SERVER_NAME']; $request = $_SERVER['REQUEST_URI']; @@ -94,8 +91,8 @@ } $CONFIG->wwwroot .= $request; - - //$CONFIG->wwwroot .= str_replace($_SERVER['DOCUMENT_ROOT'],"",$CONFIG->path); + */ + $CONFIG->wwwroot = "http://" . $_SERVER['HTTP_HOST'] . str_replace("//","/",str_replace($_SERVER['DOCUMENT_ROOT'],"",$CONFIG->path)); } @@ -107,7 +104,31 @@ if (empty($CONFIG->debug)) $CONFIG->debug = false; - + } + + /** + * Function that provides some config initialisation on system init + * + */ + + function configuration_init() { + + global $CONFIG; + + $CONFIG->path = datalist_get('path'); + $CONFIG->dataroot = datalist_get('dataroot'); + $CONFIG->wwwroot = $CONFIG->site->url; + $CONFIG->sitename = $CONFIG->site->name; + + return true; + + } + + /** + * Register config_init + */ + register_event_handler('init','system','configuration_init',10); + ?> \ No newline at end of file -- cgit v1.2.3