}
}
+// Error handler
+function __errorHandler ($errno, $errstr, $errfile, $errline, array $errcontext) {
+ // Construct the message
+ $message = sprintf("File: %s, Line: %s, Code: %s, Message: %s",
+ basename($errfile),
+ $errline,
+ $errno,
+ $errstr
+ );
+
+ // Throw an exception here
+ throw new FatalErrorException($message, BaseFrameworkSystem::EXCEPTION_FATAL_ERROR);
+} // END - function
+
+// Assertion handler
+function __assertHandler ($file, $line, $code) {
+ // Empty code?
+ if ($code === '') $code = '<em>Unknown</em>';
+
+ // Create message
+ $message = sprintf("File: %s, Line: %s, Code: %s",
+ basename($file),
+ $line,
+ $code
+ );
+
+ // Throw an exception here
+ throw new AssertionException($message, BaseFrameworkSystem::EXCEPTION_ASSERTION_FAILED);
+} // END - function
+
+// Set error handler
+//set_error_handler('__errorHandler');
+
// Set the new handler
set_exception_handler('hub_exception_handler');
+// Init assert handling
+assert_options(ASSERT_ACTIVE, 1);
+assert_options(ASSERT_WARNING, 0);
+assert_options(ASSERT_BAIL, 0);
+assert_options(ASSERT_QUIET_EVAL, 0);
+assert_options(ASSERT_CALLBACK, '__assertHandler');
+
// [EOF]
?>