Файл: upload/core/functions/error_handler.php
Строк: 39
<?php
register_shutdown_function(function() {
global $theme;
$error = error_get_last();
if ($error !== null) {
// Учитываем error_reporting()
if (!(error_reporting() & $error['type'])) {
return;
}
echo '<link rel="stylesheet" href="' . homeLink() . '/core/templates/' . $theme . '/css/style.css">
<style> body { justify-content: flex-start; } </style>
<div class="error-box">
<h3>Ошибка:</h3>
<p>' . $error['message'] . '</p>
<small>Файл: ' . $error['file'] . ' (строка ' . $error['line'] . ')</small>
</div>';
}
});
set_exception_handler(function($e) {
global $theme;
echo '<link rel="stylesheet" href="' . homeLink() . '/core/templates/' . $theme . '/css/style.css">
<style> body { justify-content: flex-start; } </style>
<div class="error-box">
<h3>Исключение:</h3>
<p>' . $e->getMessage() . '</p>
<small>Файл: ' . $e->getFile() . ' (строка ' . $e->getLine() . ')</small>
</div>';
});
set_error_handler(function($errno, $errstr, $errfile, $errline) {
global $theme;
// Учитываем error_reporting()
if (!(error_reporting() & $errno)) {
return false;
}
echo '<link rel="stylesheet" href="' . homeLink() . '/core/templates/' . $theme . '/css/style.css">
<style> body { justify-content: flex-start; } </style>
<div class="error-box">
<h3>Ошибка PHP:</h3>
<p>' . $errstr . '</p>
<small>Файл: ' . $errfile . ' (строка ' . $errline . ')</small>
</div>';
return true;
});