aboutsummaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/index.php b/index.php
index e1ded92..3687f0d 100644
--- a/index.php
+++ b/index.php
@@ -1,4 +1,3 @@
-<?php try { ?>
<?php
/**
* Bayonet Conent Management System
@@ -8,12 +7,19 @@
* with ease and without needing to have any coding knowledge in order
* to maintain it. Visit www.eodesign.com/cms for any updates or feedback.
*/
-
+
+/* Begin try/catch block */
+try {
+
include './includes/debug.php';
include './includes/config.php';
include './includes/sql.class.php';
include './includes/functions.php';
+/* Setup error handing callbacks */
+ob_start("fatal_error_handler");
+set_error_handler("handle_error");
+
$db = new Bayonet_SQL();
$db->Connect(
$config['sql']['hostname'],
@@ -22,7 +28,6 @@ $db->Connect(
);
$db->Select_db($config['sql']['database']);
-
include 'header.php';
//session_start();
?>
@@ -54,7 +59,10 @@ include 'header.php';
</div>
<?php include 'footer.php'; ?>
-<?php
+<?php
+/* Flushing is needed by the error handler */
+ob_end_flush();
+
} //try ^^
catch(Exception $e)
{