mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-04-22 16:09:58 +00:00
first commit
This commit is contained in:
37
lib/Debug/ErrorHook/my/MyDebug_ErrorHook_TextNotifier.php
Executable file
37
lib/Debug/ErrorHook/my/MyDebug_ErrorHook_TextNotifier.php
Executable file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Вывод ошибки на экран и лог или только в лог в зависимоти от DEBUG_MODE
|
||||
*
|
||||
* @author Zmi
|
||||
*/
|
||||
class MyDebug_ErrorHook_TextNotifier extends Debug_ErrorHook_TextNotifier
|
||||
{
|
||||
protected function _notifyText($subject, $body)
|
||||
{
|
||||
global $g_config;
|
||||
|
||||
// Подготовка сообщения ошибки
|
||||
$msg = PHP_EOL .
|
||||
"Text notification:" . PHP_EOL .
|
||||
"\tsubject: {$subject}" . PHP_EOL .
|
||||
"\t{$body}" .
|
||||
PHP_EOL;
|
||||
|
||||
// Запись ошибки в лог-файл
|
||||
$path = $g_config['logErrors']['logFile'];
|
||||
$fileLogger = FileLogger::Create($path);
|
||||
$fileLogger->Error($msg);
|
||||
|
||||
// Вывод ошибки на экран
|
||||
if ($g_config['phpIni']['display_errors'])
|
||||
{
|
||||
echo "<pre>$msg</pre>";
|
||||
}
|
||||
else
|
||||
{
|
||||
IncludeCom('500');
|
||||
}
|
||||
}
|
||||
};
|
||||
?>
|
||||
Reference in New Issue
Block a user