diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-05-02 12:40:38 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-05-02 12:40:38 +0000 |
commit | 4cf87cd1f558593fe7047440806bc6b7d32e83ee (patch) | |
tree | eff1ceef115a0977cfc8988f6ca88ae3afd455e7 /engine/lib/configuration.php | |
parent | db727a00f06d95da0b6d3a3356b1d60c01feabe3 (diff) | |
download | elgg-4cf87cd1f558593fe7047440806bc6b7d32e83ee.tar.gz elgg-4cf87cd1f558593fe7047440806bc6b7d32e83ee.tar.bz2 |
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
Diffstat (limited to 'engine/lib/configuration.php')
-rw-r--r-- | engine/lib/configuration.php | 39 |
1 files changed, 30 insertions, 9 deletions
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 |