From 278db6119f8bb95ab89139103e738ab6a6dd4384 Mon Sep 17 00:00:00 2001 From: walkor Date: Tue, 13 Dec 2022 17:10:47 +0800 Subject: [PATCH] check posix_isatty callable --- Worker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Worker.php b/Worker.php index 71e6dd190..1b5a113cc 100644 --- a/Worker.php +++ b/Worker.php @@ -1300,7 +1300,7 @@ public static function resetStd() $STDOUT = \fopen(static::$stdoutFile, "a"); $STDERR = \fopen(static::$stdoutFile, "a"); // Fix standard output cannot redirect of PHP 8.1.8's bug - if (\posix_isatty(2)) { + if (\function_exists('posix_isatty') && \posix_isatty(2)) { \ob_start(function ($string) { \file_put_contents(static::$stdoutFile, $string, FILE_APPEND); }, 1);