v4.7.1 The version is mainly a bug fix version, without downward incompatible changes.
- Compatible with PHP 8.1 version
- As
SWOOLE_HOOK_CURL
supportCURLOPT_RESOLVE
options
Supports HOST:PORT:ADDRESS
, [+]HOST:PORT:ADDRESS
, [-]HOST:PORT:ADDRESS
and multiple addresses
use Swoole\Coroutine;
use Swoole\Runtime;
Runtime::enableCoroutine(SWOOLE_HOOK_CURL);
Coroutine\run(function () {
$host = 'httpbin.org';
$url = 'https://httpbin.org/get';
$ip = Coroutine::gethostbyname($host);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_RESOLVE, ["{$host}:443:127.0.0.1", "{$host}:443:{$ip}"]);
$data = curl_exec($ch);
$httpPrimaryIp = curl_getinfo($ch, CURLINFO_PRIMARY_IP);
$body = json_decode($data, true);
assert($body['headers']['Host'] === 'httpbin.org');
assert($body['url'] === $url);
assert($ip === $httpPrimaryIp);
});
Update log
The following is the complete update log:
Enhance
System::dnsLookup
Support query/etc/hosts
(#4341) (#4349) (@zmyWL) (@NathanFreeman)- Add boost context support for mips64 (#4358) (@dixyes)
SWOOLE_HOOK_CURL
supportsCURLOPT_RESOLVE
option (swoole/library#107) (@sy-records)SWOOLE_HOOK_CURL
supportsCURLOPT_NOPROGRESS
option (swoole/library#117) (@sy-records)- Add boost context support for riscv64 (#4375) (@dixyes)
repair
- Fix PHP-8.1 memory error when on shutdown (#4325) (@twose)
- Fix the non-serializable classes of 8.1.0beta1 (#4335) (@remicollet)
- Fix the problem that multiple coroutines fail to create directories recursively (#4337) (@NathanFreeman)
- Fix the occasional timeout problem of native curl sending large files on the external network, and the crash problem when using the coroutine file API in CURL WRITEFUNCTION (#4360) (@matyhtf)
- Fix the
PDOStatement::bindParam()
that 0611e2bb23b64a expects parameter 1 to be a string (swoole/library#116) (@sy-records)
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。