Swoole v4.5.7 版本发布,新增 --enable-swoole-json 编译选项

栏目: 软件资讯 · 发布时间: 5年前

内容简介:Swoole 正在参与 2020 年度 OSC 中国开源项目评选,评选已经来到了最后一周,还有没给 Swoole 投票的小伙伴请点击下方链接投出您的一篇:https://www.oschina.net/p/swoole-server 在上个版本中添加的 swoole_sub...
Swoole 正在参与 2020 年度 OSC 中国开源项目评选,评选已经来到了最后一周,还有没给 Swoole 投票的小伙伴请点击下方链接投出您的一篇:https://www.oschina.net/p/swoole-server

在上个版本中添加的 swoole_substr_json_decode 函数,由于少部分用户的扩展依赖顺序问题,所以添加了一个编译选项--enable-swoole-json,用于启用 swoole_substr_json_decode 支持

在此版本如果需要使用此函数,需要在编译时加上此选项。同时此版本还支持了负偏移量

$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));

更新内容如下:

新增 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)

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Coding the Matrix

Coding the Matrix

Philip N. Klein / Newtonian Press / 2013-7-26 / $35.00

An engaging introduction to vectors and matrices and the algorithms that operate on them, intended for the student who knows how to program. Mathematical concepts and computational problems are motiva......一起来看看 《Coding the Matrix》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

在线进制转换器
在线进制转换器

各进制数互转换器

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码