2 Commits

Author SHA1 Message Date
174b29efff FIX: str_starts_with 2025-06-27 17:17:21 -04:00
1c0f4a5ae9 Try to register fatal errors in file 2025-06-27 17:17:06 -04:00
2 changed files with 10 additions and 1 deletions

View File

@ -11,3 +11,12 @@ try {
} catch (Exception $exception) { } catch (Exception $exception) {
$app->getContainer()->get(Psr\Log\LoggerInterface::class)->notice($exception); $app->getContainer()->get(Psr\Log\LoggerInterface::class)->notice($exception);
} }
register_shutdown_function(function() {
$error = error_get_last();
$fatal_errors = [E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR];
if ($error !== null and in_array($error['type'], $fatal_errors, true)) {
error_log(json_encode($error).PHP_EOL,3, '/logs/fatal.log');
}
error_clear_last();
});

View File

@ -20,7 +20,7 @@ class Schedule
$commands = []; $commands = [];
foreach ($schedule as $line) { foreach ($schedule as $line) {
$line = trim($line); $line = trim($line);
if (trim($line) === '' or str_starts_with('#', $line)) { if (trim($line) === '' or str_starts_with($line, '#')) {
continue; continue;
} }
try { try {