networkteam/json-seq
Composer 安装命令:
composer require networkteam/json-seq
包简介
JSON Text Sequences (RFC7464) encoder and decoder
关键字:
README 文档
README
JSON Text Sequences (RFC7464) encoder and decoder for PHP
JSON Text Sequences define a streamable JSON encoding and parsing based on a delimiter for multiple JSON encoded texts.
See https://tools.ietf.org/html/rfc7464 for the JSON Text Sequences RFC.
Install
Via Composer
$ composer require networkteam/json-seq
Usage
Encoding data in JSON Text Sequences:
$stringWriter = new StringWriter(); $encoder = new Encoder($stringWriter); $encoder->emit(['id' => '1', ...]); $encoder->emit(['id' => '2', ...]); $result = $stringWriter->getString();
Decoding JSON Text Sequences from a string:
$jsonTexts = "\x1E{...}\x0A\x1E{...}\x0A"; $decoder = new StringDecoder(); foreach ($decoder->decode($jsonTexts) as $data) { // process $data }
Testing
$ composer test
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 28.67k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-07-03