sergeyfast/eazy-jsonrpc 问题修复 & 功能扩展

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

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

sergeyfast/eazy-jsonrpc

最新稳定版本:v3.0.3

Composer 安装命令:

composer require sergeyfast/eazy-jsonrpc

包简介

PHP JSON-RPC 2.0 Server/Client Implementation with SMD & Swagger support

README 文档

README

Latest Version Total Downloads

PHP JSON-RPC 2.0 Server/Client Implementation with Automatic Client Class Generation via SMD

Server

SMD Schema available via /server.php?smd

Public Namespace

  • Inherits your exposed class from BaseJsonRpcServer or create new BaseJsonRpcServer( $instance );
  • $server->Execute();

Multiple Namespaces

  • Create new BaseJsonRpcServer();
  • Call $server->RegisterInstance( $instance, $namespace ) as many times as you need
  • $server->Execute();

Client

  • Generate Client from SMD Schema from generator/ php JsonRpcClientGenerator.php <smd-file> <class-name>
  • Use it:
$client = <class-name>::GetInstance(<url>);

try {  
  $result = $client->Method(); 
} catch (BaseJsonRpcException $e) {
  // work with exception
}

Client with typed returns by rpcgen

  • Generate Client from SMD Schema with rpcgen and save it to RpcClient.php
  • Use it:
$client = RpcClient::GetInstance(<url>);

try {  
  $result = $client->Method(); 
} catch (BaseJsonRpcException $e) {
  // work with exception
}

Doc

  • cd generator
  • php SmdToSwaggerConverter.php 'http://eazyjsonrpc/tests/example-server.php?smd' eazyjsonrpc ../doc/swagger.json
  • open http://eazyjsonrpc/doc/

统计信息

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

GitHub 信息

  • Stars: 62
  • Watchers: 7
  • Forks: 20
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-18