aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/configuration.php3
-rw-r--r--engine/lib/database.php18
-rw-r--r--engine/schema/mysql.sql2
-rw-r--r--engine/settings.example.php1
-rw-r--r--engine/start.php13
5 files changed, 20 insertions, 17 deletions
diff --git a/engine/lib/configuration.php b/engine/lib/configuration.php
index 66b36bf63..d60b7b8f3 100644
--- a/engine/lib/configuration.php
+++ b/engine/lib/configuration.php
@@ -39,6 +39,9 @@
$CONFIG->wwwroot .= str_replace($_SERVER['DOCUMENT_ROOT'],"",$CONFIG->path);
}
+ if (empty($CONFIG->url))
+ $CONFIG->url = $CONFIG->wwwroot;
+
if (empty($CONFIG->sitename))
$CONFIG->sitename = "New Elgg site";
diff --git a/engine/lib/database.php b/engine/lib/database.php
index fab73025e..1d78ac310 100644
--- a/engine/lib/database.php
+++ b/engine/lib/database.php
@@ -264,11 +264,12 @@
$tables = array();
- if (is_array($result)) {
+ if (is_array($result) && !empty($result)) {
foreach($result as $row) {
- foreach($row as $element) {
- $tables[] = $element;
- }
+ if (is_array($row) && !empty($row))
+ foreach($row as $element) {
+ $tables[] = $element;
+ }
}
}
@@ -306,13 +307,6 @@
$statement = str_replace("prefix_",$CONFIG->dbprefix,$statement);
if (!empty($statement)) {
$result = update_data($statement);
- if ($result == false) {
- $error = mysql_error();
- $error = trim($error);
- if (!empty($error)) {
- $errors[] = $error;
- }
- }
}
}
if (!empty($errors)) {
@@ -340,6 +334,6 @@
// Stuff for initialisation
- register_event_handler('init','system','init_db',0);
+ register_event_handler('boot','system','init_db',0);
?> \ No newline at end of file
diff --git a/engine/schema/mysql.sql b/engine/schema/mysql.sql
index 787a44e15..062541e63 100644
--- a/engine/schema/mysql.sql
+++ b/engine/schema/mysql.sql
@@ -194,5 +194,5 @@ CREATE TABLE `prefix_sites` (
PRIMARY KEY (`id`)
) ENGINE=MyISAM ;
-INSERT INTO `prefix_elggnew`.`sites` (`id` ,`name` ,`domain`) VALUES
+INSERT INTO `prefix_sites` (`id` ,`name` ,`domain`) VALUES
(1 , 'New Elgg site', '');
diff --git a/engine/settings.example.php b/engine/settings.example.php
index e45284685..47f43d05a 100644
--- a/engine/settings.example.php
+++ b/engine/settings.example.php
@@ -10,6 +10,7 @@
*/
global $CONFIG;
+ $CONFIG = new stdClass;
/*
* Standard configuration
diff --git a/engine/start.php b/engine/start.php
index fd61dbd6a..1ed294a03 100644
--- a/engine/start.php
+++ b/engine/start.php
@@ -82,9 +82,6 @@
throw new InstallationException("Could not load {$file}");
}
- // Autodetect some default configuration settings
- set_default_config();
-
// Load plugins
load_plugins();
@@ -94,12 +91,20 @@
}
+ // Autodetect some default configuration settings
+ set_default_config();
+
// Trigger events
- trigger_event('init', 'system');
+ trigger_event('boot', 'system');
// Forward if we haven't been installed
if ((!is_installed() || !is_db_installed()) && !substr_count($_SERVER["PHP_SELF"],"install.php")) {
forward("install.php");
}
+
+ // Trigger events
+ if (!substr_count($_SERVER["PHP_SELF"],"install.php")) {
+ trigger_event('init', 'system');
+ }
?> \ No newline at end of file