tomcan/combell-api 问题修复 & 功能扩展

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

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

tomcan/combell-api

最新稳定版本:v5.0.3

Composer 安装命令:

composer require tomcan/combell-api

包简介

Client libraries for the Combell shared hosting public API.

关键字:

README 文档

README

This is a Combell shared-hosting API client implementation. The goal is to provide a client library that makes it easy for you to interact with the Combell shared hosting public API.

Run tests

Current status

Since the Combell API is still in development and new functionality is added regularly, this library might not implement every call yet. We do try to keep it up-to-date as much as possible. We keep an eye on the Combell API changelog but if there are calls missing, do let us know by opening an issue or even better a pull request ;)

Usage

You can install the library through composer:

composer install tomcan/combell-api

Next, you need to include the composer autoloader. Instantiate the API object with your API key and secret, create the command objects and fire away!

require __DIR__ . '/vendor/autoload.php';

$key = 'YOUR-API-KEY';  
$sec = 'YOUR-API-SECRET';

$api = new \TomCan\CombellApi\Common\Api(
    new \TomCan\CombellApi\Adapter\GuzzleAdapter(),
    new \TomCan\CombellApi\Common\HmacGenerator($key, $sec)
);
$cmd = new \TomCan\CombellApi\Command\Accounts\ListAccounts();
  
var_dump($api->executeCommand($cmd));  

The command will return the data of the call, in the example above that is an array with Account objects. See the test directory for extensive examples of all the calls.

If you need information about the HTTP call, you can ask the api object about it:

// return the HTTP status code. 200 -> 204 indicate success, other codes typically mean failure of some sort
$api->getStatusCode();

// rate limiting headers
$api->getRateLimitUsage();
$api->getRateLimitRemaining();
$api->getRateLimitReset();
$api->getRateLimitLimit();

If the command is pageable, you can get info about the paging from the command object:

$cmd->getPagingSkipped();
$cmd->getPagingTake();
$cmd->getPagingTotalResults();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-11-22