qqq
This commit is contained in:
+11
-6
@@ -15,13 +15,18 @@ class Client
|
|||||||
private CoroutineClient|CurlClient $abstracts;
|
private CoroutineClient|CurlClient $abstracts;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $host
|
* @param string $host
|
||||||
* @param int $port
|
* @param int $port
|
||||||
* @param bool $isSsl
|
* @param bool $isSsl
|
||||||
*/
|
* @param bool $useCurl
|
||||||
public function __construct(string $host, int $port, bool $isSsl = false)
|
*/
|
||||||
|
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) {
|
if (class_exists(Coroutine::class) && Coroutine::getCid() > -1) {
|
||||||
$this->abstracts = new CoroutineClient($host, $port, $isSsl);
|
$this->abstracts = new CoroutineClient($host, $port, $isSsl);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user