team-reflex/challonge-php
Composer 安装命令:
composer require team-reflex/challonge-php
包简介
PSR-18 compatible library to interface with the bracket generator Challonge.
README 文档
README
PSR-18 compliant package for interfacing with the Challonge API.
Installation
Refer to the table for PHP version compatibility:
| ChallongePHP Ver. | Compatible PHP |
|---|---|
| ^5.0 | 8.1 - 8.2 |
| ^4.0 | 8.0 - 8.1 |
| ^3.0 | 7.4 - 8.0 |
| ^2.1 | 7.4 |
| ^2.0 | 7.4 |
| ^1.0 | 7.0 - 7.4 |
Install via composer:
composer require team-reflex/challonge-php:version
Usage
As the package is PSR-18 compliant, it does not come with an HTTP client by default.
You can use a client such as Guzzle, and pass an instance of it when instantiating:
$http = new GuzzleHttp\Client(); $challonge = new Challonge($http, 'api_key_here', true);
By default, the package maps the keys of any input, as Challonge requires its input to be in a format such as:
$tournament = $challonge->createTournament([ 'tournament[name]' => 'test' ]);
Which means you are able to use the package without prefixing your keys:
$tournament = $challonge->createTournament([ 'name' => 'test' ]);
You can change the third argument to false to disable this mapping if you would prefer to do it yourself.
Now you're ready to make requests:
$tournament = $challonge->fetchTournament('challongephptest');
API Updates
Challonge does not lock their API and has been consistently adding new fields to objects, thus breaking strongly typed DTOs.
As of 3.0.4, all three DTOs have been marked to ignore missing fields. If Challonge adds a new field, it will no longer throw a DataTransferObjectError, but the DTO will also however not contain that new field.
Documentation
As the package is fully type-hinted, everything should be self documenting, however there is documentation in the wiki.
Contact
team-reflex/challonge-php 适用场景与选型建议
team-reflex/challonge-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 27.69k 次下载、GitHub Stars 达 22, 最近一次更新时间为 2015 年 12 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 team-reflex/challonge-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 team-reflex/challonge-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 27.69k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 23
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-12-15