From 092daa022a877090fff52ea054db149b11ff49df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 18 Aug 2023 17:33:06 +0800 Subject: [PATCH] qqq --- Client.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Client.php b/Client.php index 1be4bba..31dd77e 100644 --- a/Client.php +++ b/Client.php @@ -15,13 +15,18 @@ class Client private CoroutineClient|CurlClient $abstracts; - /** - * @param string $host - * @param int $port - * @param bool $isSsl - */ - public function __construct(string $host, int $port, bool $isSsl = false) + /** + * @param string $host + * @param int $port + * @param bool $isSsl + * @param bool $useCurl + */ + public function __construct(string $host, int $port, bool $isSsl = false, bool $useCurl = false) { + if ($useCurl) { + $this->abstracts = new CurlClient($host, $port, $isSsl); + return; + } if (class_exists(Coroutine::class) && Coroutine::getCid() > -1) { $this->abstracts = new CoroutineClient($host, $port, $isSsl); } else {