gman98ish/ukfast-simple-php-sdk
最新稳定版本:v0.2.1
Composer 安装命令:
composer require gman98ish/ukfast-simple-php-sdk
包简介
A simpler version of the UKFast PHP SDK.
关键字:
README 文档
README
composer require gman98ish/ukfast-simple-php-sdk
This is not intended to replace the UKFast SDK, but is simply a proof of concept of another way we could approach it.
Instead of the SDK being an abstraction over our API's, this offers a thin wrapper.
The client provides methods for hitting the 5 different kinds of endpoints we have
- Getting a page of items
- Getting a single item
- Creating an item
- Updating an item
- Deleting an item
You pass the API paths directly to this SDK, using developers.ukfast.io as a reference e.g.
<?php $ukfast = new \UKFast\SimpleSDK\Client; $ukfast->auth('my-ukfast-key'); $page = $ukfast->get('/pss/v1/requests'); // returns a Page class echo $page->getItems()[0]->author->id . "\n"; // can also do concurrent requests [$requests, $replies] = $ukfast->concurrently(fn ($ukfast) => [ $ukfast->get('/pss/v1/requests'), $ukfast->get('/pss/v1/replies'), ]); echo $requests->getItems()[0]->author->id . "\n"; echo $replies->getItems()[0]->author->id . "\n";
The advantage of this is that this is all the code we need to interface with our entire API's
统计信息
- 总下载量: 4.84k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-20