Continued:
[shipsimu.git] / application / selector / exceptions.php
index e53e46f8256904f1b8792e906e21d6fd7345a438..510f7d598bdf44f20e63a2fb48ad808b3568159d 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * The exception handler for this application
  *
- * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
+ * @link               http://www.shipsimu.org
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 // Our own exception handler
 function __exceptionHandler (FrameworkException $e) {
-       // Call the app_die() method
-       ApplicationEntryPoint::app_die(sprintf("[Main:] The application <span class=\"app_name\">%s</span> (<span class=\"app_short_name\">%s</span>) has terminated due to an uncaught exception: <span class=\"exception_name\">%s</span> <span class=\"exception_number\">[%s]</span>: <span class=\"debug_exception\">%s</span> Backtrace: <div class=\"debug_backtrace\">%s</div>",
-               ApplicationHelper::getInstance()->getAppName(),
-               ApplicationHelper::getInstance()->getAppShortName(),
+       // Call the app_exit() method
+       ApplicationEntryPoint::app_exit(sprintf('[Main:] The application <span class="app_name">%s</span> (<span class="app_short_name">%s</span>) has terminated due to an uncaught exception: <span class="exception_name">%s</span> <span class="exception_number">[%s]</span>: <span class="debug_exception">%s</span> Backtrace: <div class="debug_backtrace">%s</div>',
+               ApplicationHelper::getSelfInstance()->getAppName(),
+               ApplicationHelper::getSelfInstance()->getAppShortName(),
                $e->__toString(),
                $e->getHexCode(),
                $e->getMessage(),
@@ -44,7 +44,7 @@ set_exception_handler('__exceptionHandler');
 // Error handler
 function __errorHandler ($errno, $errstr, $errfile, $errline, array $errcontext) {
        // Construct the message
-       $message = sprintf("File: <span class=\"debug_file\">%s</span>, Line: <span class=\"debug_line\">%s</span>, Code: <span class=\"debug_code\">%s</span>, Message: <span class=\"debug_message\">%s</span>",
+       $message = sprintf('File: <span class="debug_file">%s</span>, Line: <span class="debug_line">%s</span>, Code: <span class="debug_code">%s</span>, Message: <span class="debug_message">%s</span>',
                basename($errfile),
                $errline,
                $errno,
@@ -61,10 +61,12 @@ set_error_handler('__errorHandler');
 // Assertion handler
 function __assertHandler ($file, $line, $code) {
        // Empty code?
-       if ($code === "") $code = "<em>Unknown</em>";
+       if (empty($code)) {
+               $code = '<em>Unknown</em>';
+       }
 
        // Create message
-       $message = sprintf("File: <span class=\"debug_file\">%s</span>, Line: <span class=\"debug_line\">%s</span>, Code: <span class=\"debug_code\">%s</span>",
+       $message = sprintf('File: <span class="debug_file">%s</span>, Line: <span class="debug_line">%s</span>, Code: <span class="debug_code">%s</span>',
                basename($file),
                $line,
                $code
@@ -80,6 +82,3 @@ assert_options(ASSERT_WARNING,    0);
 assert_options(ASSERT_BAIL,       0);
 assert_options(ASSERT_QUIET_EVAL, 0);
 assert_options(ASSERT_CALLBACK,   '__assertHandler');
-
-// [EOF]
-?>