定制 team-reflex/challonge-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

team-reflex/challonge-php

最新稳定版本:5.0

Composer 安装命令:

composer require team-reflex/challonge-php

包简介

PSR-18 compatible library to interface with the bracket generator Challonge.

README 文档

README

Test Latest Version Downloads

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

统计信息

  • 总下载量: 27.66k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 23
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 22
  • Watchers: 7
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-15