Skip to content

Commit

Permalink
Update Worker.php
Browse files Browse the repository at this point in the history
  • Loading branch information
walkor authored Mar 22, 2024
1 parent 142426f commit aa1ee66
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -2260,8 +2260,12 @@ public static function safeEcho($msg, $decorated = false)
} elseif (!static::$_outputDecorated) {
return false;
}
\fwrite($stream, $msg);
\fflush($stream);
set_error_handler(function(){});
if (!feof(self::$outputStream)) {
fwrite(self::$outputStream, $msg);
fflush(self::$outputStream);
}
restore_error_handler();
return true;
}

Expand Down

1 comment on commit aa1ee66

@axguowen
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个提交的代码有问题,启动会报[Error]Access to undeclared static property: Workerman\Worker::$outputStream
静态属性$outputStream没有定义
代码里面的self::$outputStream是不是要改成$stream或者static::$_outputStream
???

Please sign in to comment.