From 04088956d1d6977c9e8e4589a3a696d9f21eb5a0 Mon Sep 17 00:00:00 2001 From: LordDeveloper Date: Tue, 16 Aug 2022 02:56:02 +0430 Subject: [PATCH 1/2] [bugfix] Fixed showing logs problem --- src/Utils/Logger/Logger.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Utils/Logger/Logger.php b/src/Utils/Logger/Logger.php index 630e549..0bff619 100644 --- a/src/Utils/Logger/Logger.php +++ b/src/Utils/Logger/Logger.php @@ -9,6 +9,7 @@ use Psr\Log\LoggerTrait; use Psr\Log\LogLevel; use Throwable; +use function Amp\ByteStream\getOutputBufferStream; use function Botify\array_some; use function Botify\base_path; use function Botify\config; @@ -93,7 +94,7 @@ public function log($level, $message, array $context = []): void } if ($this->type & static::ECHO_TYPE) { - \Botify\file_put_contents('php://output', Colorize::log($level, $log)); + getOutputBufferStream()->write(Colorize::log($level, $log)); } if ($this->type & static::FILE_TYPE) { From 3dd7d618fe221c5a218cc46b669b801fec831c9e Mon Sep 17 00:00:00 2001 From: LordDeveloper Date: Tue, 16 Aug 2022 02:56:37 +0430 Subject: [PATCH 2/2] [updated] renamed UPDATE_TYPE_SOCKET_SERVER to UPDATE_TYPE_HTTP_SERVER --- src/Events/Handler.php | 2 +- src/TelegramAPI.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Events/Handler.php b/src/Events/Handler.php index c9be4f8..501335c 100644 --- a/src/Events/Handler.php +++ b/src/Events/Handler.php @@ -20,7 +20,7 @@ class Handler { const UPDATE_TYPE_WEBHOOK = 1; const UPDATE_TYPE_POLLING = 2; - const UPDATE_TYPE_SOCKET_SERVER = 3; + const UPDATE_TYPE_HTTP_SERVER = 3; public static array $eventHandlers = []; diff --git a/src/TelegramAPI.php b/src/TelegramAPI.php index 5069f59..5b944a2 100644 --- a/src/TelegramAPI.php +++ b/src/TelegramAPI.php @@ -230,7 +230,7 @@ public function hear(int $updateType = Handler::UPDATE_TYPE_WEBHOOK, string $uri exit(); }); break; - case Handler::UPDATE_TYPE_SOCKET_SERVER: + case Handler::UPDATE_TYPE_HTTP_SERVER: $options = getopt('d::', [ 'drop_pending_updates::' ]);