diff --git a/src/core/Curl/Handler.php b/src/core/Curl/Handler.php index 30ea4de2..d98964e5 100644 --- a/src/core/Curl/Handler.php +++ b/src/core/Curl/Handler.php @@ -13,9 +13,9 @@ namespace Swoole\Curl; -use Swoole; use Swoole\Constant; use Swoole\Coroutine\Http\Client; +use Swoole\Coroutine\System; use Swoole\Curl\Exception as CurlException; use Swoole\Http\Status; @@ -717,7 +717,7 @@ private function execute() } if (!filter_var($proxy, FILTER_VALIDATE_IP)) { - $ip = Swoole\Coroutine::gethostbyname($proxy, AF_INET, $this->clientOptions['connect_timeout'] ?? -1); + $ip = System::gethostbyname($proxy, AF_INET, $this->clientOptions['connect_timeout'] ?? -1); if (!$ip) { $this->setError(CURLE_COULDNT_RESOLVE_PROXY, 'Could not resolve proxy: ' . $proxy); return false; diff --git a/src/std/exec.php b/src/std/exec.php index 514eaf6a..e4eb212f 100644 --- a/src/std/exec.php +++ b/src/std/exec.php @@ -9,9 +9,11 @@ declare(strict_types=1); +use Swoole\Coroutine\System; + function swoole_exec(string $command, &$output = null, &$returnVar = null) { - $result = Swoole\Coroutine::exec($command); + $result = System::exec($command); if ($result) { $outputList = explode(PHP_EOL, $result['output']); foreach ($outputList as &$value) { @@ -34,7 +36,7 @@ function swoole_exec(string $command, &$output = null, &$returnVar = null) function swoole_shell_exec(string $cmd) { - $result = Swoole\Coroutine::exec($cmd); + $result = System::exec($cmd); if ($result && $result['output'] !== '') { return $result['output']; }