joehoel/combell-php-sdk
Composer 安装命令:
composer require joehoel/combell-php-sdk
包简介
Combell API SDK for PHP
关键字:
README 文档
README
Unofficial PHP SDK for the Combell v2 API, built on Saloon v3. It handles HMAC authentication and exposes typed resources and DTOs for a clean developer experience.
Installation
You can install the package via composer:
composer require joehoel/combell-php-sdk
Usage
Basic setup:
use Joehoel\Combell\Combell; $sdk = new Combell($_ENV['COMBELL_API_KEY'], $_ENV['COMBELL_API_SECRET']);
List accounts (returns DTOs):
use Joehoel\Combell\Dto\Account; $response = $sdk->accounts()->getAccounts(); /** @var Account[] $accounts */ $accounts = $response->dto(); foreach ($accounts as $account) { echo $account->identifier.PHP_EOL; }
Get a single account:
use Joehoel\Combell\Dto\AccountDetail; $response = $sdk->accounts()->getAccount(123); /** @var AccountDetail $account */ $account = $response->dto();
List DNS records for a domain:
use Joehoel\Combell\Dto\DnsRecord; $response = $sdk->dnsRecords()->getRecords('example.com'); /** @var DnsRecord[] $records */ $records = $response->dto();
Create a DNS record (send a request with JSON body):
use Joehoel\Combell\Requests\DnsRecords\CreateRecord; // For JSON bodies, instantiate the request and merge the payload $request = new CreateRecord('example.com'); $request->body()->merge([ 'type' => 'A', 'name' => '@', 'content' => '1.2.3.4', 'ttl' => 3600, ]); $response = $sdk->send($request); // $response->status() === 201 on success
Notes:
- Responses map to DTOs when available via
$response->dto(). - Non-2xx responses throw exceptions by default (Saloon’s
AlwaysThrowOnErrors). - Authentication is automatic via HMAC — provide your API key and secret to
Combell.
Testing
composer test
With coverage:
composer test-coverage
Format code:
composer format
Mocking in tests
You can use a local MockClient to test your integration without hitting the network.
use Joehoel\Combell\Combell; use Joehoel\Combell\Requests\Accounts\GetAccounts; use Saloon\Http\Faking\MockClient; use Saloon\Http\Faking\MockResponse; $mock = new MockClient([ GetAccounts::class => MockResponse::make('[]', 200), ]); $sdk = Combell::fake($mock, 'key', 'secret'); $response = $sdk->accounts()->getAccounts();
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Pull requests are welcome. Please include tests for new or changed behavior and run:
composer format && composer test
Acknowledgements
This SDK is inspired by and informed by the resources in https://github.com/combell/combell-api. Thank you to the Combell team for building and maintaining such a solid platform and for sharing their work publicly.
Security
If you discover a security vulnerability, please email the maintainer at joel@kuijper.fyi rather than opening a public issue.
Credits
License
The MIT License (MIT). Please see License File for more information.
joehoel/combell-php-sdk 适用场景与选型建议
joehoel/combell-php-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 38 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 10 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Joehoel」 「combell-php-sdk」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 joehoel/combell-php-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 joehoel/combell-php-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 38
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-20