edgetelemetrics/php-json-rpc 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

edgetelemetrics/php-json-rpc

最新稳定版本:v1.2.2

Composer 安装命令:

composer require edgetelemetrics/php-json-rpc

包简介

JSON-RPC helper classes for PHP

README 文档

README

This library contains classes to construct JSON RPC notification, request, response and error objects.

Additionally there is a ReactPHP stream decoder included which will process JSON RPC request and responses encoded via NDJSON.

https://www.jsonrpc.org/specification

Quickstart

Create a Request on the client

<?php
use EdgeTelemetrics\JSON_RPC\Request;
$request = new Request('ping', [], 'requestId');

$packet = json_encode($request);

// Send $packet to Server

Server side

<?php
//Process request

// Create the response from the request to pre-fill ID
$response = new Response::createFromRequest($request);
$response->setResult('pong');

$packet = json_encode($response);

// Send $packet back to Client

统计信息

  • 总下载量: 3.85k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-02-20