TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Core\Error\AbstractExceptionHandler Class Reference
Inheritance diagram for TYPO3\CMS\Core\Error\AbstractExceptionHandler:
TYPO3\CMS\Core\Error\ExceptionHandlerInterface TYPO3\CMS\Core\SingletonInterface TYPO3\CMS\Core\Error\DebugExceptionHandler TYPO3\CMS\Core\Error\ProductionExceptionHandler

Public Member Functions

 handleException ($exception)
 
- Public Member Functions inherited from TYPO3\CMS\Core\Error\ExceptionHandlerInterface
 __construct ()
 
 echoExceptionWeb ($exception)
 
 echoExceptionCLI ($exception)
 

Public Attributes

const CONTEXT_WEB = 'WEB'
 
const CONTEXT_CLI = 'CLI'
 

Protected Member Functions

 writeLogEntries ($exception, $context)
 
 writeLog ($logMessage)
 
 sendStatusHeaders ($exception)
 
 anonymizeToken ($requestedUrl)
 
 getBackendUser ()
 
 getDatabaseConnection ()
 

Detailed Description

An abstract exception handler

This file is a backport from TYPO3 Flow

Definition at line 25 of file AbstractExceptionHandler.php.

Member Function Documentation

◆ anonymizeToken()

TYPO3\CMS\Core\Error\AbstractExceptionHandler::anonymizeToken (   $requestedUrl)
protected

◆ getBackendUser()

TYPO3\CMS\Core\Error\AbstractExceptionHandler::getBackendUser ( )
protected
Returns

Definition at line 176 of file AbstractExceptionHandler.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\Error\AbstractExceptionHandler\writeLog().

◆ getDatabaseConnection()

TYPO3\CMS\Core\Error\AbstractExceptionHandler::getDatabaseConnection ( )
protected

Gets the Database Object

Returns

Definition at line 185 of file AbstractExceptionHandler.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\Error\AbstractExceptionHandler\writeLog().

◆ handleException()

TYPO3\CMS\Core\Error\AbstractExceptionHandler::handleException (   $exception)

Displays the given exception

Parameters
\Exception | \Throwable$exceptionThe exception(PHP 5.x) or throwable(PHP >= 7.0) object. #72293 This will change to only if we are >= PHP7.0 only
Exceptions

Implements TYPO3\CMS\Core\Error\ExceptionHandlerInterface.

Definition at line 38 of file AbstractExceptionHandler.php.

References TYPO3\CMS\Core\Error\ExceptionHandlerInterface\echoExceptionCLI(), and TYPO3\CMS\Core\Error\ExceptionHandlerInterface\echoExceptionWeb().

◆ sendStatusHeaders()

TYPO3\CMS\Core\Error\AbstractExceptionHandler::sendStatusHeaders (   $exception)
protected

Sends the HTTP Status 500 code, if $exception is not a TYPO3 and headers are not sent, yet.

Parameters
\Exception | \Throwable$exceptionThe exception(PHP 5.x) or throwable(PHP >= 7.0) object.
Returns
void #72293 This will change to only if we are >= PHP7.0 only

Definition at line 147 of file AbstractExceptionHandler.php.

References TYPO3\CMS\Core\Utility\HttpUtility\HTTP_STATUS_500.

Referenced by TYPO3\CMS\Core\Error\DebugExceptionHandler\echoExceptionWeb(), and TYPO3\CMS\Core\Error\ProductionExceptionHandler\echoExceptionWeb().

◆ writeLog()

TYPO3\CMS\Core\Error\AbstractExceptionHandler::writeLog (   $logMessage)
protected

Writes an exception in the sys_log table

Parameters
string$logMessageDefault text that follows the message.
Returns
void

Definition at line 103 of file AbstractExceptionHandler.php.

References $GLOBALS, TYPO3\CMS\Core\Error\AbstractExceptionHandler\getBackendUser(), TYPO3\CMS\Core\Error\AbstractExceptionHandler\getDatabaseConnection(), and TYPO3\CMS\Core\Utility\GeneralUtility\getIndpEnv().

Referenced by TYPO3\CMS\Core\Error\AbstractExceptionHandler\writeLogEntries().

◆ writeLogEntries()

TYPO3\CMS\Core\Error\AbstractExceptionHandler::writeLogEntries (   $exception,
  $context 
)
protected

Writes exception to different logs

Parameters
\Exception | \Throwable$exceptionThe exception(PHP 5.x) or throwable(PHP >= 7.0) object.
string$contextThe context where the exception was thrown, WEB or CLI
Returns
void
See also
::sysLog(), ::devLog() #72293 This will change to only if we are >= PHP7.0 only

Definition at line 62 of file AbstractExceptionHandler.php.

References TYPO3\CMS\Core\Error\AbstractExceptionHandler\anonymizeToken(), TYPO3\CMS\Core\Utility\GeneralUtility\devLog(), TYPO3\CMS\Core\Utility\GeneralUtility\getIndpEnv(), TYPO3\CMS\Core\Utility\GeneralUtility\SYSLOG_SEVERITY_FATAL, and TYPO3\CMS\Core\Error\AbstractExceptionHandler\writeLog().

Referenced by TYPO3\CMS\Core\Error\ProductionExceptionHandler\echoExceptionCLI(), TYPO3\CMS\Core\Error\DebugExceptionHandler\echoExceptionCLI(), TYPO3\CMS\Core\Error\DebugExceptionHandler\echoExceptionWeb(), and TYPO3\CMS\Core\Error\ProductionExceptionHandler\echoExceptionWeb().

Member Data Documentation

◆ CONTEXT_CLI

const TYPO3\CMS\Core\Error\AbstractExceptionHandler::CONTEXT_CLI = 'CLI'

Definition at line 28 of file AbstractExceptionHandler.php.

◆ CONTEXT_WEB

const TYPO3\CMS\Core\Error\AbstractExceptionHandler::CONTEXT_WEB = 'WEB'

Definition at line 27 of file AbstractExceptionHandler.php.