public static function handleShutdown($self)
	{
		$error		= error_get_last();

		if ($error !== NULL) {
			$errno   	= $error["type"];
			$errfile 	= $error["file"];
			$errline 	= $error["line"];
			$errstr  	= $error["message"];
			
			$logstr = " ($errno):  $errstr in $errfile on line $errline";
			
			switch ($errno) {
				//Full explaination here: http://php.net/manual/en/errorfunc.constants.php
				case E_CORE_ERROR 		: $self->logEmerg( 	"Core fatal error" 		. $logstr); break;
				case E_COMPILE_ERROR 	: $self->logAlert( 	"Compile fatal error" 		. $logstr); break;
				case E_ERROR  			: $self->logCrit( 	"Fatal error" 				. $logstr); break;
				case E_PARSE  			: $self->logCrit( 	"Parse error" 				. $logstr); break;
				case E_USER_ERROR 		: $self->logCrit( 	"User fatal error" 		. $logstr); break;
				case E_RECOVERABLE_ERROR: $self->logCrit( 	"Recoverable fatal error"	. $logstr); break;
				case E_ALL				: $self->logError( 	"Error" 					. $logstr); break;
				case E_WARNING  		: $self->logWarn( 	"Warning" 					. $logstr); break;
				case E_CORE_WARNING 	: $self->logWarn( 	"Core warning" 			. $logstr); break;
				case E_COMPILE_WARNING 	: $self->logWarn(	"Compile warning" 			. $logstr); break;
				case E_USER_WARNING 	: $self->logWarn( 	"User warning" 			. $logstr); break;
				case E_DEPRECATED 		: $self->logWarn( 	"Deprecated" 				. $logstr); break;
				case E_USER_DEPRECATED 	: $self->logWarn( 	"User deprecated" 			. $logstr); break;
				case E_NOTICE 			: $self->logNotice( "Notice" 					. $logstr); break;
				case E_USER_NOTICE		: $self->logNotice( "User notice" 				. $logstr); break;
				case E_STRICT  			: $self->logNotice( "Strict notice" 			. $logstr); break;
				default 				: $self->logError( 	"Unknown error"			. $logstr);
			}
		}
	}
public static function handleShutdown($self)
	{
		$error		= error_get_last();

		if ($error !== NULL) {
			$errno   	= $error["type"];
			$errfile 	= $error["file"];
			$errline 	= $error["line"];
			$errstr  	= $error["message"];
			
			$logstr = " ($errno):  $errstr in $errfile on line $errline";
			
			switch ($errno) {
				//Full explaination here: http://php.net/manual/en/errorfunc.constants.php
				case E_CORE_ERROR 		: $self->logEmerg( 	"Core fatal error" 		. $logstr); break;
				case E_COMPILE_ERROR 	: $self->logAlert( 	"Compile fatal error" 		. $logstr); break;
				case E_ERROR  			: $self->logCrit( 	"Fatal error" 				. $logstr); break;
				case E_PARSE  			: $self->logCrit( 	"Parse error" 				. $logstr); break;
				case E_USER_ERROR 		: $self->logCrit( 	"User fatal error" 		. $logstr); break;
				case E_RECOVERABLE_ERROR: $self->logCrit( 	"Recoverable fatal error"	. $logstr); break;
				case E_ALL				: $self->logError( 	"Error" 					. $logstr); break;
				case E_WARNING  		: $self->logWarn( 	"Warning" 					. $logstr); break;
				case E_CORE_WARNING 	: $self->logWarn( 	"Core warning" 			. $logstr); break;
				case E_COMPILE_WARNING 	: $self->logWarn(	"Compile warning" 			. $logstr); break;
				case E_USER_WARNING 	: $self->logWarn( 	"User warning" 			. $logstr); break;
				case E_DEPRECATED 		: $self->logWarn( 	"Deprecated" 				. $logstr); break;
				case E_USER_DEPRECATED 	: $self->logWarn( 	"User deprecated" 			. $logstr); break;
				case E_NOTICE 			: $self->logNotice( "Notice" 					. $logstr); break;
				case E_USER_NOTICE		: $self->logNotice( "User notice" 				. $logstr); break;
				case E_STRICT  			: $self->logNotice( "Strict notice" 			. $logstr); break;
				default 				: $self->logError( 	"Unknown error"			. $logstr);
			}
		}
	}
public static function handleShutdown ( $ self ) { $ error = error_get_last ( ) ; if ( $ error !== NULL ) { $ errno = $ error [ "type" ] ; $ errfile = $ error [ "file" ] ; $ errline = $ error [ "line" ] ; $ errstr = $ error [ "message" ] ; $ logstr = " ($errno):  $errstr in $errfile on line $errline" ; switch ( $ errno ) { //Full explaination here: http://php.net/manual/en/errorfunc.constants.php case E_CORE_ERROR : $ self -> logEmerg ( "Core fatal error" . $ logstr ) ; break ; case E_COMPILE_ERROR : $ self -> logAlert ( "Compile fatal error" . $ logstr ) ; break ; case E_ERROR : $ self -> logCrit ( "Fatal error" . $ logstr ) ; break ; case E_PARSE : $ self -> logCrit ( "Parse error" . $ logstr ) ; break ; case E_USER_ERROR : $ self -> logCrit ( "User fatal error" . $ logstr ) ; break ; case E_RECOVERABLE_ERROR : $ self -> logCrit ( "Recoverable fatal error" . $ logstr ) ; break ; case E_ALL : $ self -> logError ( "Error" . $ logstr ) ; break ; case E_WARNING : $ self -> logWarn ( "Warning" . $ logstr ) ; break ; case E_CORE_WARNING : $ self -> logWarn ( "Core warning" . $ logstr ) ; break ; case E_COMPILE_WARNING : $ self -> logWarn ( "Compile warning" . $ logstr ) ; break ; case E_USER_WARNING : $ self -> logWarn ( "User warning" . $ logstr ) ; break ; case E_DEPRECATED : $ self -> logWarn ( "Deprecated" . $ logstr ) ; break ; case E_USER_DEPRECATED : $ self -> logWarn ( "User deprecated" . $ logstr ) ; break ; case E_NOTICE : $ self -> logNotice ( "Notice" . $ logstr ) ; break ; case E_USER_NOTICE : $ self -> logNotice ( "User notice" . $ logstr ) ; break ; case E_STRICT : $ self -> logNotice ( "Strict notice" . $ logstr ) ; break ; default : $ self -> logError ( "Unknown error" . $ logstr ) ; } } }
When the webserver finishes the request or the script crashes on an error,
this function will fetch the last error and log it.
@param KLogger $self
@return void
When the webserver finishes the request or the script crashes on an error this function will fetch the last error and log it .