An open API service indexing awesome lists of open source software.

https://github.com/petersil1998/thresh-example

This is a example Usage for the Thresh library
https://github.com/petersil1998/thresh-example

data-dragon league-api league-of-legends-api php7 riot-api riot-games-api twig-templates

Last synced: 2 months ago
JSON representation

This is a example Usage for the Thresh library

Awesome Lists containing this project

README

        

Thresh Example

This is an example project for the [Thresh](https://github.com/Petersil1998/Thresh) library.

Main file: public/index.php (uses **Twig** as templating engine)

public/summoner.php and public/game.php are pure **PHP** and **HTML** examples

In order to use the **Thresh** library you must have this code in your main PHP file:

Use `EncryptionUtils::encrypt('')` to encrypt your RIOT API KEY which you can get [here](https://developer.riotgames.com)

Use `Config::setApiKey($encrypted_api_key)` to set your api key for the application (this key will be used for the Riot API calls)

Use `Config::setRegion()` to set and update the region that the library uses for API calls (full list of Regions can be found [here](https://github.com/Petersil1998/Thresh/blob/master/src/Constants/Regions.php) )

Use `Config::setPlatform()` to set and update the platform that the library uses for API calls (full list of Platforms can be found [here](https://github.com/Petersil1998/Thresh/blob/master/src/Constants/Platforms.php) )

Use `Loader::init()` to initialize the Application (It automatically updates Champions, Runes, Maps, QueueTypes, etc... when there is a new version available)