Swoole 正在參與 2020 年度 OSC 中國開源項目評選,評選已經來到了最後一週,還有沒給 Swoole 投票的小夥伴請點擊下方連接投出您的一篇:
https://www.oschina.net/p/swoole-server
在上個版本中添加的 swoole_substr_json_decode 函數,因爲少部分用戶的擴展依賴順序問題,因此添加了一個編譯選項--enable-swoole-json
,用於啓用 swoole_substr_json_decode
支持php
在此版本若是須要使用此函數,須要在編譯時加上此選項。同時此版本還支持了負偏移量mysql
$val = json_encode(['hello' => 'swoole']);
$str = pack('N', strlen($val)) . $val . "\r\n";
$l = strlen($str) - 6;
var_dump(json_decode(substr($str, 4, $l), true));
var_dump(swoole_substr_json_decode($str, 4, $l, true));
var_dump(swoole_substr_json_decode($str, -(strlen($str)-4), $l, true));
更新內容以下:sql
新增 API
- Coroutine\Socket 客戶端新增 writeVector, writeVectorAll, readVector, readVectorAll 方法 (#3764) (@huanghantao)
加強
- 爲 server->stats 增長 task_worker_num 和 dispatch_count (#3771) (#3806) (@sy-records) (@matyhtf)
- 添加了擴展依賴項,包括 json, mysqlnd, sockets (#3789) (@remicollet)
- 限制 server->bind 的 uid 最小值爲 INT32_MIN (#3785) (@sy-records)
- 爲 swoole_substr_json_decode 添加了編譯選項,支持負偏移量(#3809) (@matyhtf)
- 支持 CURL 的 CURLOPT_TCP_NODELAY 選項 (swoole/library#65) (@sy-records) (@deminy)
修復
- 修復同步客戶端鏈接信息錯誤 (#3784) (@twose)
- 修復 hook scandir 函數的問題 (#3793) (@twose)
- 修復協程屏障 barrier 中的錯誤 (swoole/library#68) (@sy-records)
內核
- 使用 boost.stacktrace 優化 print-backtrace (#3788) (@matyhtf)
![Swoole官方公衆號 Swoole官方公衆號](http://static.javashuo.com/static/loading.gif)