40 $excludedErrors = E_COMPILE_WARNING | E_COMPILE_ERROR | E_CORE_WARNING | E_CORE_ERROR | E_PARSE | E_ERROR;
42 $errorHandlerErrors = $errorHandlerErrors & ~$excludedErrors;
43 set_error_handler(array($this,
'handleError'), $errorHandlerErrors);
70 public function handleError($errorLevel, $errorMessage, $errorFile, $errorLine) {
72 if (error_reporting() === 0) {
76 E_WARNING =>
'Warning',
79 E_USER_WARNING =>
'User Warning',
80 E_USER_NOTICE =>
'User Notice',
81 E_STRICT =>
'Runtime Notice',
82 E_RECOVERABLE_ERROR =>
'Catchable Fatal Error',
83 E_DEPRECATED =>
'Runtime Deprecation Notice' 85 $message =
'PHP ' . $errorLevels[$errorLevel] .
': ' . $errorMessage .
' in ' . $errorFile .
' line ' . $errorLine;
86 if ($errorLevel & $this->exceptionalErrors) {
89 if (!class_exists(
'stdClass', FALSE)) {
90 $message =
'PHP ' . $errorLevels[$errorLevel] .
': ' . $errorMessage .
' in ' . basename($errorFile) .
97 if (!class_exists(
'TYPO3\\CMS\\Core\\Error\\Exception', FALSE)) {
98 require_once PATH_site .
'typo3/sysext/core/Classes/Exception.php';
99 require_once PATH_site .
'typo3/sysext/core/Classes/Error/Exception.php';
103 switch ($errorLevel) {
106 case E_RECOVERABLE_ERROR:
117 $logTitle =
'Core: Error handler (' .
TYPO3_MODE .
')';
120 if ($errorLevel &
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'syslogErrorReporting']) {
121 GeneralUtility::sysLog($message, $logTitle, $severity);
125 if (TYPO3_ERROR_DLOG) {
129 if (is_object($GLOBALS[
'TT'])) {
130 $GLOBALS[
'TT']->setTSlogMessage($logTitle .
': ' . $message, $severity + 1);
133 if ($errorLevel & $GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'belogErrorReporting']) {
137 $this->
writeLog($logTitle .
': ' . $message, $severity);
141 if ($severity === 2) {
146 if (defined(
'TYPO3_ERRORHANDLER_MODE') && TYPO3_ERRORHANDLER_MODE ==
'debug') {
149 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
151 'PHP ' . $errorLevels[$errorLevel],
157 $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
158 $defaultFlashMessageQueue->enqueue($flashMessage);
173 protected function writeLog($logMessage, $severity) {
174 if (is_object(
$GLOBALS[
'TYPO3_DB']) &&
$GLOBALS[
'TYPO3_DB']->isConnected()) {
177 if (is_object(
$GLOBALS[
'BE_USER'])) {
178 if (isset(
$GLOBALS[
'BE_USER']->user[
'uid'])) {
179 $userId =
$GLOBALS[
'BE_USER']->user[
'uid'];
181 if (isset(
$GLOBALS[
'BE_USER']->workspace)) {
182 $workspace =
$GLOBALS[
'BE_USER']->workspace;
185 $fields_values = array(
189 'error' => $severity,
191 'details' => $logMessage,
194 'workspace' => $workspace
196 $GLOBALS[
'TYPO3_DB']->exec_INSERTquery(
'sys_log', $fields_values);
handleError($errorLevel, $errorMessage, $errorFile, $errorLine)
writeLog($logMessage, $severity)
if(!defined('ADODB_ERROR_HANDLER_TYPE')) define('ADODB_ERROR_HANDLER_TYPE' E_USER_ERROR
static devLog($msg, $extKey, $severity=0, $dataVar=FALSE)
setExceptionalErrors($exceptionalErrors)
static getIndpEnv($getEnvName)
__construct($errorHandlerErrors)
static makeInstance($className)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]