aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/start.php117
1 files changed, 57 insertions, 60 deletions
diff --git a/engine/start.php b/engine/start.php
index 18daf2959..819c95ace 100644
--- a/engine/start.php
+++ b/engine/start.php
@@ -11,8 +11,8 @@
* @copyright Curverider Ltd 2008-2009
* @link http://elgg.org/
*/
-
-
+
+
/**
* Load important prerequisites
@@ -21,50 +21,50 @@
if (!@include_once(dirname(__FILE__) . "/lib/exceptions.php")) { // Exceptions
echo "Error in installation: could not load the Exceptions library.";
exit;
- }
+ }
if (!@include_once(dirname(__FILE__) . "/lib/elgglib.php")) { // Main Elgg library
- echo "Elgg could not load its main library.";
+ echo "Elgg could not load its main library.";
+ exit;
+ }
+
+ if (!@include_once(dirname(__FILE__) . "/lib/system_log.php")) { // Logging library
+ echo "Error in installation: could not load the System Log library.";
exit;
- }
-
- if (!@include_once(dirname(__FILE__) . "/lib/system_log.php")) { // Logging library
- echo "Error in installation: could not load the System Log library.";
- exit;
- }
+ }
if (!@include_once(dirname(__FILE__) . "/lib/export.php")) { // Export library
- echo "Error in installation: could not load the Export library.";
+ echo "Error in installation: could not load the Export library.";
exit;
}
if (!@include_once(dirname(__FILE__) . "/lib/languages.php")) { // Languages library
- echo "Error in installation: could not load the languages library.";
+ echo "Error in installation: could not load the languages library.";
+ exit;
+ }
+
+ if (!@include_once(dirname(__FILE__) . "/lib/input.php")) { // Input library
+ echo "Error in installation: could not load the input library.";
+ exit;
+ }
+
+ if (!@include_once(dirname(__FILE__) . "/lib/install.php")) { // Installation library
+ echo "Error in installation: could not load the installation library.";
exit;
- }
-
- if (!@include_once(dirname(__FILE__) . "/lib/input.php")) { // Input library
- echo "Error in installation: could not load the input library.";
- exit;
- }
-
- if (!@include_once(dirname(__FILE__) . "/lib/install.php")) { // Installation library
- echo "Error in installation: could not load the installation library.";
- exit;
}
if (!@include_once(dirname(__FILE__) . "/lib/cache.php")) { // Installation library
echo "Error in installation: could not load the cache library.";
exit;
- }
-
- if (!@include_once(dirname(__FILE__) . "/lib/sessions.php")) {
- echo ("Error in installation: Elgg could not load the Sessions library");
- exit;
- }
-
- // Use fallback view until sanitised
- $oldview = get_input('view');
+ }
+
+ if (!@include_once(dirname(__FILE__) . "/lib/sessions.php")) {
+ echo ("Error in installation: Elgg could not load the Sessions library");
+ exit;
+ }
+
+ // Use fallback view until sanitised
+ $oldview = get_input('view');
set_input('view', 'failsafe');
/**
@@ -115,8 +115,8 @@
// We don't want to load or reload these files
$file_exceptions = array(
- '.','..',
- '.DS_Store',
+ '.','..',
+ '.DS_Store',
'Thumbs.db',
'.svn',
'CVS','cvs',
@@ -129,48 +129,45 @@
asort($files);
// Include them
- foreach($files as $file) {
+ foreach($files as $file) {
if (isset($CONFIG->debug) && $CONFIG->debug) error_log("Loading $file...");
if (!@include_once($file))
throw new InstallationException("Could not load {$file}");
}
-
- // Set default config
- set_default_config();
} else { // End portion for sanitised installs only
-
+
throw new InstallationException(elgg_echo('installation:error:configuration'));
}
// Autodetect some default configuration settings
- set_default_config();
+ set_default_config();
// Trigger events
- trigger_elgg_event('boot', 'system');
-
- // Load plugins
-
- $installed = is_installed();
- $db_installed = is_db_installed();
-
- // Determine light mode
- $lm = strtolower(get_input('lightmode'));
- if ($lm == 'true') $lightmode = true;
-
- // Load plugins, if we're not in light mode
- if (($installed) && ($db_installed) && ($sanitised) && (!$lightmode)) {
- load_plugins();
-
- trigger_elgg_event('plugins_boot', 'system');
- }
+ trigger_elgg_event('boot', 'system');
+
+ // Load plugins
+
+ $installed = is_installed();
+ $db_installed = is_db_installed();
+
+ // Determine light mode
+ $lm = strtolower(get_input('lightmode'));
+ if ($lm == 'true') $lightmode = true;
+
+ // Load plugins, if we're not in light mode
+ if (($installed) && ($db_installed) && ($sanitised) && (!$lightmode)) {
+ load_plugins();
+
+ trigger_elgg_event('plugins_boot', 'system');
+ }
// Forward if we haven't been installed
if ((!$installed || !$db_installed) && !substr_count($_SERVER["PHP_SELF"],"install.php") && !substr_count($_SERVER["PHP_SELF"],"css.php") && !substr_count($_SERVER["PHP_SELF"],"action_handler.php")) {
header("Location: install.php");
exit;
- }
+ }
// Trigger events
if (!substr_count($_SERVER["PHP_SELF"],"install.php") &&
@@ -183,8 +180,8 @@
//forward("setup.php");
//}
}
-
-
- // System booted, return to normal view
+
+
+ // System booted, return to normal view
set_input('view', $oldview);
?> \ No newline at end of file