medlinker/jsonrpc 问题修复 & 功能扩展

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

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

medlinker/jsonrpc

最新稳定版本:1.0

Composer 安装命令:

composer require medlinker/jsonrpc

包简介

Fork from http://github.com/johnstevenson/jsonrpc. JSON-RPC 2.0 client/server implementation

README 文档

README

Build Status

A PHP implementation for JSON-RPC (v2). Contains client and server libraries to handle requests including notification and batch.

Contents

About

JSON-RPC is a protocol that allows servers to talk to each other using json-encoded structures. It is described in its specification as:

A light weight remote procedure call protocol. It is designed to be simple!

Full details at jsonrpc.org. You may need to read this to get an overview of the json structures that are used, although the heavy lifting is abstracted away by this implementation. For example, calling a method on a remote server is as simple as:

<?php
$client = new JsonRpc\Client($url);
$client->call('method', array($param1, $param2));

// now do something with $client->result

And at the server end:

<?php
// MethodsClass contains the exposed methods
$methods = new MethodsClass();

$server = new JsonRpc\Server($methods);
$server->receive();

Installation

The easiest way is through composer. Just create a composer.json file and run php composer.phar install to install it:

{
    "minimum-stability": "dev",
    "require": {
        "jsonrpc/jsonrpc": "1.0.*"
    }
}

Alternatively, you can download and extract it, or clone this repo. If you just want to try it, see Example.

Usage

If you downloaded the library through composer then you must add the following somewhere in your bootstrap code:

<?php
 require 'vendor/autoload.php';

Otherwise you must point a PSR-0 autoloader to the src directory. Full usage documentation can be found in the Wiki:

Example

The quickest way to get the library up and running locally is to point your browser to example/client.php and everything will load automatically. You can then experiment with the code as you read the documentation.

License

Json-Rpc is licensed under the MIT License - see the LICENSE file for details

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-21