duffleman/crpc
Composer 安装命令:
composer require duffleman/crpc
包简介
CRPC implementation around json-client.
README 文档
README
crpc for PHP, styled from billinghamj/crpc.
About
JSONClient is cool and all but this is opinionated to the crpc standard.
Basic Usage
<?php require_once 'vendor/autoload.php'; use Duffleman\crpc; // important trailing slash here $c = new crpc\crpc('https://api.avocado.cuv-nonprod.app/1/service-staff/', [ 'headers' => ['Authorization' => '... keys here'], ]); $res = $c->do('1/latest/list_staff', [ 'showPastEmployees' => true, // converted to snake case ]); foreach ($res as $staff) { $staff = (object) $staff; $staff->about = (object) $staff->about; // only because I prefer -> to array accessors if (!$staff->isActive) { // converted from snake case echo '!! '; } echo "{$staff->about->name} ({$staff->about->role})"; echo "\n"; }
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-07-08