aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-02-13 13:53:57 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-02-13 13:53:57 +0000
commitdf3deed9b49426cce4490c4e1cf5befbd565958f (patch)
tree4c650d42e534a0c8e63a6a52fada6d77d1ee2aca
parent7a269947c2c7dc3735313f077e5de055b6a20e30 (diff)
downloadelgg-df3deed9b49426cce4490c4e1cf5befbd565958f.tar.gz
elgg-df3deed9b49426cce4490c4e1cf5befbd565958f.tar.bz2
Start now reporting errors using exceptions...
git-svn-id: https://code.elgg.org/elgg/trunk@21 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/start.php21
1 files changed, 12 insertions, 9 deletions
diff --git a/engine/start.php b/engine/start.php
index 3ba3525c5..421cda5fa 100644
--- a/engine/start.php
+++ b/engine/start.php
@@ -22,15 +22,16 @@
}
if (!@include_once(dirname(__FILE__) . "/lib/elgglib.php")) { // Main Elgg library
- echo "Error in installation: could not load the main Elgg library.";
- exit;
+ throw new InstallationException("Could not load the main Elgg library.");
}
/**
* Load the system settings
*/
- @include_once(dirname(__FILE__) . "/settings.php"); // Global settings
+ if (!@include_once(dirname(__FILE__) . "/settings.php")) { // Global settings
+ throw new InstallationException("Settings file is missing");
+ }
/**
* If there are basic issues with the way the installation is formed, don't bother trying
@@ -44,7 +45,7 @@
*/
if (!@include_once(dirname(__FILE__) . "/lib/database.php")) // Database connection
- register_error("Could not load the main Elgg database library.");
+ throw new DatabaseException("Could not load the main Elgg database library.");
/**
@@ -70,25 +71,27 @@
foreach($files as $file) {
if (!@include_once($file))
- register_error("Could not load {$file}");
+ throw new InstallationException("Could not load {$file}");
}
} else { // End portion for sanitised installs only
- register_error("Once you've corrected any configuration issues, press reload to try again.");
+ throw new InstallationException("Once you've corrected any configuration issues, press reload to try again.");
}
// Trigger events
trigger_event('init', 'system');
-
+
+
+// TODO: Have the View catch and render any exceptions
// If we have load errors, display them
- if ($count = count_messages("errors")) {
+/* if ($count = count_messages("errors")) {
echo elgg_view('pageshell', array(
'title' => "Elgg isn't ready to run just yet.",
'body' => elgg_view('messages/errors/list',array('object' => system_messages(null, "errors")))
));
exit;
}
-
+*/
?> \ No newline at end of file