Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jakoch committed Oct 5, 2012
1 parent df8f377 commit d647231
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
15 changes: 6 additions & 9 deletions framework/Koch/Exception/Errorhandler.php
Expand Up @@ -63,20 +63,17 @@ class Errorhandler
*/
public static function errorhandler( $errno, $errstr, $errfile, $errline, $errcontext = null )
{
/**
* do just return, if the error is suppressed,
* due to (@)silencing-operator
*/
// do just return, if the error is suppressed. maybe due to silencing-operator (@).
if (error_reporting() === 0) {
return;
}

/**
* Assemble the error informations
* Let's start assembling the error informations
*/

/**
* Definition of PHP Errortypes Array - with names for all the php error codes
* Definition of PHP Errortypes Array. So we can lookup an error name by its php error code.
* @link http://php.net/manual/de/errorfunc.constants.php
*/
$errorTypes = array (
Expand All @@ -102,10 +99,10 @@ public static function errorhandler( $errno, $errstr, $errfile, $errline, $errco
32767 => 'E_ALL 32767 PHP6' // all errors and warnings - E_ALL of PHP Version 6
);

// get the errorname from the array via $errornumber
// lookup error name by php error code
$errorname = isset($errorTypes[$errno]) ? $errorTypes[$errno] : '';

// Handling the ErrorType via Switch
// enhance the errorname a bit
switch ($errorname) {
// This one is handled by register_shutdown_function + catchFatalErrorsShutdownHandler
case 'E_ERROR':
Expand All @@ -132,7 +129,7 @@ public static function errorhandler( $errno, $errstr, $errfile, $errline, $errco
$errorname .= ' [PHP Strict]';
break;
case 'E_RECOVERABLE_ERROR':
$errorname .= ' [php not-unstable]';
$errorname .= ' [PHP NOT-UNSTABLE]';
break;
// when it's not in there, its an unknown errorcode
default:
Expand Down
2 changes: 1 addition & 1 deletion framework/Koch/Exception/Renderer/SmartyTemplateError.php
Expand Up @@ -58,7 +58,7 @@ public static function render($errno, $errorname, $errstr, $errfile, $errline, $
$html = '';
$html .= '<span>';
$html .= '<h4><font color="#ff0000">&raquo; Smarty Template Error &laquo;</font></h4>';
#$html .= '<u>' . $errorname . ' (' . $errno . '): </u><br/>';
$html .= '<u>' . $errorname . ' (' . $errno . '): </u><br/>';
$html .= '<b>' . wordwrap($errstr, 50, "\n") . '</b><br/>';
$html .= 'File: ' . $errfile . '<br/>Line: ' . $errline;
$html .= Errorhandler::getTemplateEditorLink($errfile, $errline, $errcontext);
Expand Down
4 changes: 2 additions & 2 deletions framework/Koch/Exception/Renderer/YellowScreenOfDeath.php
Expand Up @@ -224,8 +224,8 @@ public static function renderError($errno, $errorname, $errstr, $errfile, $errli

// Panel 1 - Errormessage
$html .= '<div id="panel1" class="panel">';
$html .= '<h3>Error - '.$errorname.'</h3> ';
$html .= '<p style="font-weight: bold;">' . $errstr . ' (' . $errno . ')</p>';
$html .= '<h3>Error - '.$errorname.' (' . $errno . ')</h3> ';
$html .= '<p style="font-weight: bold;">' . $errstr . '</p>';
$html .= '<p>in file "<span style="font-weight: bold;">' . $errfile_short . '</span>"';
$html .= ' on line #<span style="font-weight: bold;">' . $errline.'.</span></p>';
$html .= '</div>';
Expand Down

0 comments on commit d647231

Please sign in to comment.