PLoL
, (*1)
PLoL is a PHP API that tries to simplify with the League of Legends API
The main focus is to add versability and scalability.
It implements a cache system and a rate limiter handler, custom output modes,
custom error codes handler., (*2)
Libraries used
How to install
Using Composer, (*3)
composer require "kolter/plol" dev-master
composer.json, (*4)
"require":
{
"kolter/plol":"dev-master"
}
Configuration
First of all, get your League of Legends API KEY. You will need this api key to instance resources.
In the config/config.json folder there are some parameters you may want to change:, (*5)
There are some default options that you may consider change:, (*6)
-
cache: true means resources will be cached, false won't.
-
region: default region to the api. (check regions acronym)
Basic Api Usage
This library use the PSR-4 implementation of namespaces.
Basic implementation:
``` php
<?php
use Kolter\PLoL\Resources\Game;, (*7)
include('path/to/vendor/autoload.php');, (*8)
$game = new Game("{YOUR API KEY HERE}");
echo $game->get(1245678);, (*9)
This is basic usage, you will get the result in json (by default). you can set some option in one specified instance.
``` php
$game = (new Game("{YOUR API KEY HERE}"))->setCache(false)
->setOutputMode(ObjectOutput());
$game->get(1245678)->games->fellowPlayers[0]->teamId;
Take a look at the ResourceRequest class API for more information., (*10)
Structure
Resources are what you can get in the League of Legends API.
Bellow there are different resources and how to use them, with examples., (*11)
Every resource class extends from this. This is where the core is., (*12)
Get info of a specific champion, (*13)
Get info of the current game., (*14)
Get info of the current game., (*15)
Get info of the current game., (*16)