定制 greplab/jsonrpcsmd 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

greplab/jsonrpcsmd

Composer 安装命令:

composer require greplab/jsonrpcsmd

包简介

Classes to build a map of the services available using the JSON-RPC SMD specification (http://www.simple-is-better.org/json-rpc/jsonrpc20-smd.html).

README 文档

README

This library make a reflection of the classes given and output a json using the v2 of the proposal specification published in simple-is-better.org.

Usage

To start use this library just create an instance of the Smb class. This class is the core of the library. You only need work this Smb. The Smb class only need to know the url of the endpoint witch is where the calls will be sended. You can pass the url in the constructor or set later using the setTarget() method. But remember, you cannot generate the json map if the target is not setted.

//You can start like this:
$smd = new \Greplab\Jsonrpcsmd\Smd('http://my-website/path/of/the/endpoint');

//Or like that:
$smd = new \Greplab\Jsonrpcsmd\Smd();
$smd->setTarget('http://my-website/path/of/the/endpoint');

Canonical URL

If the "canonical" option is enabled each method will have a diferent endpoint consisting in the default endpoint url plus the name of the service and method. This is useful when you use a tool like firebug to monitor the ajax calls. This way each call is easily recognizable but require the server recognize and identify this last seccion as the service and method path. This option is disabled by default.

To change this use: $smd->setUseCanonical(true);

Add classes

To index a class simple execute:

$smd->addClass('ClassNameToIndex');

You have to call this method for each class you want to index.

Build the json map

To get the json map just print the Smd instance to the browser. If you want the json before to send the browser use the toJson() method.

$json = $smd->toJson();
print($json);

License

This library is open-sourced software licensed under the MIT license

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-10-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固