aboutsummaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2009-12-20 15:34:08 -0500
committerjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2009-12-20 15:34:08 -0500
commit3af9846d4ecc1e0274833740fd21012afe9ef51f (patch)
tree2266233bfca1233f2860f3b8a75d453a9513f8c7 /index.php
parentc0048a6c5a910588be35e30ea96d2b9b335c0503 (diff)
downloadbayonetcms-3af9846d4ecc1e0274833740fd21012afe9ef51f.tar.gz
Error handling functions added, and applied
git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@380 c5b2fb0a-d05d-0410-98c8-828840a80ff6
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)
{