return $ret;
}
-// Handles fatal errors
-function handleFatalErrors () {
- // Do we have errors to handle and right output mode?
- if ((getTotalFatalErrors() == 0) || (getOutputMode() != 0)) {
- // Abort executing here
- return false;
- } // END - if
-
- // Set content type
- setContentType('text/html');
-
- // Load config here
- loadIncludeOnce('inc/load_config.php');
-
- // Set unset variable
- if (empty($check)) $check = '';
-
- // Default is none
- $content = '';
-
- // Installation phase or regular mode?
- if ((isInstallationPhase())) {
- // While we are installing ouput other header than while it is installed... :-)
- $OUT = '';
- foreach (getFatalArray() as $key => $value) {
- // Prepare content for the template
- $content = array(
- 'key' => ($key + 1),
- 'value' => $value
- );
-
- // Load row template
- $OUT .= loadTemplate('install_fatal_row', true, $content);
- }
-
- // Load main template
- $content = loadTemplate('install_fatal_table', true, $OUT);
- } elseif (isInstalled()) {
- // Display all runtime fatal errors
- $OUT = '';
- foreach (getFatalArray() as $key => $value) {
- // Prepare content for the template
- $content = array(
- 'key' => ($key + 1),
- 'value' => $value
- );
-
- // Load row template
- $OUT .= loadTemplate('runtime_fatal_row', true, $content);
- }
-
- // Load main template
- $content = loadTemplate('runtime_fatal_table', true, $OUT);
- }
-
- // Message to regular users (non-admin)
- $CORR = getMessage('FATAL_REPORT_ERRORS');
-
- // PHP warnings fixed
- if ($check == 'done') {
- if (isAdmin()) $CORR = getMessage('FATAL_CORRECT_ERRORS');
- } // END - if
-
- // Remember all in array
- $content = array(
- 'rows' => $content,
- 'corr' => $CORR
- );
-
- // Load footer
- loadIncludeOnce('inc/header.php');
-
- // Load main template
- loadTemplate('fatal_errors', false, $content);
-
- // Delete all to prevent double-display
- initFatalMessages();
-
- // Load footer
- loadIncludeOnce('inc/footer.php');
-
- // Abort here
- shutdown();
-}
-
// Print code with line numbers
function linenumberCode ($code) {
if (!is_array($code)) $codeE = explode("\n", $code); else $codeE = $code;