phpPeanuts  2.2.0
phpPeanuts framework
 All Data Structures Namespaces Files Functions Variables
Public Member Functions | Data Fields
PntErrorHandler Class Reference

Inherited by ErrorHandler.

Public Member Functions

 __construct ($logFilePath=null, $emailAddress=null)
 
 initErrorLevelMap ()
 
 mapErrorLevel ($level)
 
 getDefaultReportingLevel ()
 
 getLoggingLevel ()
 
 getErrorExceptionLevel ()
 
 getDefaultErrorExceptionLevel ()
 
 getStringConverter ()
 
 startHandling ()
 
 handleError ($level, $message, $filePath, $lineNumber)
 
 handleException ($e)
 
 getTraces ($e)
 
 addFakeLineToTrace ($exception, &$trace)
 
 getTimeStamp ()
 
 dieIfFatal ($level, $message, $filePath, $lineNumber)
 
 getRequestData ($forLog=true)
 
 logError ($levelOrCode, $message, $filePath, $lineNumber, $timeStamp, $traces=array(), $type=null)
 
 informUser ($levelOrCode, $message, $filePath, $lineNumber, $timeStamp, $type=null)
 
 getErrorPageUrl ($errorText, $info, $cause)
 
 errorInErrorPage ()
 
 getUserErrorText ($levelOrCode, $message, $filePath, $lineNumber, $timeStampString)
 
 getUserErrorInfo ($levelOrCode, $message, $filePath, $lineNumber, $timeStampString)
 
 getUserErrorCause ($levelOrCode, $message, $filePath, $lineNumber, $timeStampString)
 
 getErrorCause ($levelOrCode, $message, $filePath, $lineNumber, $timeStampString)
 
 printDebugInfo ($levelOrCode, $message, $filePath, $lineNumber, $timeStamp, $traces, $type=null)
 
 truncateBackTrace ($traceArray)
 
 isDevelopment ()
 
 isPhp44RefNotice ($level, $message, $filePath)
 
 isPntFile ($filePath)
 
 shouldLogException ($e)
 
 shouldReportException ($e)
 

Data Fields

 $logFilePath
 
 $oldHandler = null
 
 $reportingLevel
 
 $errorLevelMap
 
 $hasHandledError = false
 
 $stringConverter
 
 $developmentHost = 'development'
 
 $emailAddress
 
 $logBacktrace = false
 

Constructor & Destructor Documentation

__construct (   $logFilePath = null,
  $emailAddress = null 
)
Parameters
String$logFilePathif null the error info is written to the php's system logger,
See Also
http://www.php.net/manual/en/function.error-log.php You may have to call ini_set('log_errors', '1'); if specified the error information is written to the specified file. Php must have write access to that file, wich is considered a security risk because malicious code that came in through an exploit may use this file to get non-php code running on the webservers user account. The preferred method is to pass null

Member Function Documentation

addFakeLineToTrace (   $exception,
$trace 
)
dieIfFatal (   $level,
  $message,
  $filePath,
  $lineNumber 
)
errorInErrorPage ( )
getDefaultErrorExceptionLevel ( )

The level of errors to be handled by throwing a PntErrorException Because exception handling set with set_exception_handler allways dies, the default is to include only errors are meant to die when handled.

Returns
int
getDefaultReportingLevel ( )
getErrorCause (   $levelOrCode,
  $message,
  $filePath,
  $lineNumber,
  $timeStampString 
)
getErrorExceptionLevel ( )
Returns
int The level of errors to be handled by throwing a PntErrorException
getErrorPageUrl (   $errorText,
  $info,
  $cause 
)

parameters must be url encoded

getLoggingLevel ( )
getRequestData (   $forLog = true)
getStringConverter ( )
getTimeStamp ( )
getTraces (   $e)
getUserErrorCause (   $levelOrCode,
  $message,
  $filePath,
  $lineNumber,
  $timeStampString 
)
getUserErrorInfo (   $levelOrCode,
  $message,
  $filePath,
  $lineNumber,
  $timeStampString 
)
getUserErrorText (   $levelOrCode,
  $message,
  $filePath,
  $lineNumber,
  $timeStampString 
)
handleError (   $level,
  $message,
  $filePath,
  $lineNumber 
)
handleException (   $e)
informUser (   $levelOrCode,
  $message,
  $filePath,
  $lineNumber,
  $timeStamp,
  $type = null 
)
initErrorLevelMap ( )
isDevelopment ( )
isPhp44RefNotice (   $level,
  $message,
  $filePath 
)
isPntFile (   $filePath)
logError (   $levelOrCode,
  $message,
  $filePath,
  $lineNumber,
  $timeStamp,
  $traces = array(),
  $type = null 
)
mapErrorLevel (   $level)
printDebugInfo (   $levelOrCode,
  $message,
  $filePath,
  $lineNumber,
  $timeStamp,
  $traces,
  $type = null 
)
shouldLogException (   $e)
shouldReportException (   $e)
startHandling ( )
truncateBackTrace (   $traceArray)

Field Documentation

$developmentHost = 'development'
$emailAddress
$errorLevelMap
$hasHandledError = false
$logBacktrace = false
$logFilePath
$oldHandler = null
$reportingLevel
$stringConverter

The documentation for this class was generated from the following file: