+// 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>';
+ } // END - if
+
+ // Create message
+ $message = sprintf('File: %s, Line: %s, Code: %s',
+ basename($file),
+ $line,
+ $code
+ );
+
+ // Log assert
+ die($message . PHP_EOL);
+ syslog(LOG_WARNING, $message);
+
+ // Throw an exception here
+ throw new AssertionException($message, BaseFrameworkSystem::EXCEPTION_ASSERTION_FAILED);
+} // END - function
+
+// Set error handler
+//set_error_handler('__errorHandler');
+
+// Set the exception handler