dolejska-daniel / challonge-api
ChallongeAPI wrapper for PHP7
v0.3
2017-06-29 07:18 UTC
Requires
- php: >=7.0.0
- curl/curl: 1.6.0
Requires (Dev)
- phpunit/phpunit: 5.7.6
This package is auto-updated.
Last update: 2024-12-20 01:46:06 UTC
README
Version pre-v0.4
Table of Contents
Introduction
This is Challonge API wrapper for PHP7!
With easy usage and clean code.
ChallongeAPI
Initializing the library
Initializing the library is easy, it just needs array
of settings. Mainly, your SET_API_KEY
. Take a look:
use ChallongeAPI\ChallongeAPI; $api = new ChallongeAPI([ // Your Challonge API key, you can get one at https://challonge.com/settings/developer ChallongeAPI::SET_API_KEY => 'YOUR_CHALLONGE_API_KEY' ]);
Available library settings:
Using the library
Working with Challonge API was never easier!
// Fetches all tournaments created on your account $api->tList(); // Fetches all tournaments created by organization 'csgo' (csgo.challonge.com) $api->tList('csgo');
Taking advantage of objects
// Fetches all tournaments created on your account $list = $api->tList(); // Outputs name of all tournaments on your account foreach ($list->getTournaments() as $tournament) echo $tournament->name . "<br>"; // Finds tournament by it's ID in the list $tournament = $list->getTournamentById(123456789); echo $tournament->name . "<br>"; // Finds tournament by it's URL name in the list $tournament = $list->getTournamentByUrl('best_tournament'); echo $tournament->name . "<br>";