+ $backtrace = '';
+ foreach ($backtraceArray as $key => $trace) {
+ // Set missing array elements
+ if (!isset($trace['file'])) {
+ $trace['file'] = __FILE__;
+ } // END - if
+ if (!isset($trace['line'])) {
+ $trace['line'] = __LINE__;
+ } // END - if
+ if (!isset($trace['args'])) {
+ $trace['args'] = array();
+ } // END - if
+
+ // Add the traceback path to the final output
+ $backtrace .= sprintf("<span class=\"backtrace_file\">%s</span>:%d, <span class=\"backtrace_function\">%s(%d)</span><br />\n",
+ basename($trace['file']),
+ $trace['line'],
+ $trace['function'],
+ count($trace['args'])
+ );
+ } // END - foreach
+
+ // Init application instance
+ $applicationInstance = NULL;
+
+ // Is the class there?
+ if (class_exists('ApplicationHelper')) {
+ // Get application instance
+ $applicationInstance = ApplicationHelper::getSelfInstance();
+
+ // Assign application data
+ $templateInstance->assignApplicationData($applicationInstance);
+ } // END - if
+
+ // We only try this
+ try {
+ // Assign variables
+ $templateInstance->assignVariable('message', $message);
+ $templateInstance->assignVariable('code', $code);
+ $templateInstance->assignVariable('extra', $extraData);
+ $templateInstance->assignVariable('backtrace', $backtrace);
+ $templateInstance->assignVariable('total_includes', ClassLoader::getSelfInstance()->getTotal());
+ $templateInstance->assignVariable('total_objects', ObjectFactory::getTotal());
+ $templateInstance->assignVariable('title', $languageInstance->getMessage('emergency_exit_title'));
+
+ // Load the template
+ $templateInstance->loadCodeTemplate('emergency_exit');
+
+ // Compile the template
+ $templateInstance->compileTemplate();
+
+ // Compile all variables
+ $templateInstance->compileVariables();
+
+ // Transfer data to response
+ $templateInstance->transferToResponse($responseInstance);
+
+ // Flush the response
+ $responseInstance->flushBuffer();
+ } catch (FileIoException $e) {
+ // Even the template 'emergency_exit' wasn't found so output both message
+ exit($message . ', exception: ' . $e->getMessage());