Don't crash if /dev/tty is missing

This commit is contained in:
Shish 2023-02-17 11:31:34 +00:00
parent e551e74741
commit fa95ccea23

View file

@ -82,8 +82,10 @@ class LogConsole extends Extension
}
if (!defined("UNITTEST") && PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') {
$fp = fopen("/dev/tty", "w");
fwrite($fp, $str);
fclose($fp);
if($fp) {
fwrite($fp, $str);
fclose($fp);
}
}
}
}