承接 datto/json-rpc-simple 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

datto/json-rpc-simple

最新稳定版本:4.0.1

Composer 安装命令:

composer require datto/json-rpc-simple

包简介

Request-to-class mapping extension for JSON-RPC library

README 文档

README

This is a request-to-class mapping extension for the php-json-rpc library. Its purpose is to eliminate the need to write manual mapping functions for API endpoints by providing an automatic mapping of the JSON-RPC method and params arguments to a matching PHP class, method and parameters.

Examples

First write an API end point:

<?php

namespace Datto\API;

class Math
{
    public function subtract($a, $b)
    {
        return $a - $b;
    }
}

Then use the API (with the default namespace Datto\API):

// This will instantiate an object of the type `Datto\API\Math`,
// call the `subtract` method, and return a corresponding JSON-RPC response.

$server = new Server(new Simple\Evaluator());
echo $server->reply('{"jsonrpc": "2.0", "method": "math/subtract", "params": {"a": 3, "b": 2}, "id": 1}');

Or to use a custom root namespace (here: Datto\NodeAPI):

$server = new Server(new Simple\Evaluator(new Simple\Mapper('Datto\\NodeAPI')));
echo $server->reply('...');

Requirements

  • PHP >= 5.3

Installation

"require": {
  "datto/json-rpc-simple": "~4.0"
}

License

This package is released under an open-source license: LGPL-3.0.

Author

Written by Philipp C. Heckel.

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 3
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2015-12-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固