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') { if (!defined("UNITTEST") && PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') {
$fp = fopen("/dev/tty", "w"); $fp = fopen("/dev/tty", "w");
fwrite($fp, $str); if($fp) {
fclose($fp); fwrite($fp, $str);
fclose($fp);
}
} }
} }
} }