2017 © Pedro Peláez
 

library league

PHP Library to access to the official League of Legends API

image

sct/league

PHP Library to access to the official League of Legends API

  • Tuesday, February 4, 2014
  • by sct
  • Repository
  • 4 Watchers
  • 11 Stars
  • 68 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

"League" PHP API Library

A simple PHP library for the official League of Legends API, (*1)

Still heavily in development. Currently supports getting Summoner data and Champion data. Can also request specific summoner stats for champions or game types., (*2)

Requirements

  • PHP >=5.3
  • PHP Curl Extension

Installation

You can install this library using composer. Learn about composer @ getcomposer.org, (*3)

1) Require the package in your composer.json, (*4)

"sct/league": "dev-master"

2) Run Composer to install the new requirement, (*5)

php composer.phar install

or, (*6)

php composer.phar update

Now make sure you are using the composer autoload in your project:, (*7)

require 'vendor/autoload.php';

use sct\League\Summoner;

$summoner = new Summoner("summoner", "region", "APIKEY");

And thats it you are good to go., (*8)

Changes

In version 1.4 the Summoner constructor was changed. You should use the factory method in Summoner to create Summoner objects. The factory supports requesting mulitple Summoners with one request., (*9)

Example Usage for multiple summoners, (*10)

$summoners = Summoner::factory(array("Dyrus", "Xpecial"), "na", "api_key");

$summoners['Dyrus']->getSummonerLevel();

Usage

Getting Summoner Data, (*11)

$dyrus = Summoner::factory("Dyrus", "na", "api_key");

$dyrus->getSummonerLevel();
$dyrus->getStats();
$dyrus->getRankedStats();
$dyrus->getStatsForGameType(GameType::Unranked);
$dyrus->getStatsForChampionByName("Darius");
$dyrus->getMatchHistory();
$dyrus->getMasteries();
$dyrus->getRunes();

// New Methods
$dyrus->getLeague();
$dyrus->getTeams();

Getting Champion Data, (*12)

Champions::loadChampions("na", "api key");

$anivia = Champions::getChampion("Anivia");

$anivia->getActive();
$anivia->getRanks();
$anivia->getRankedPlayEnabled();
$anivia->getFreeToPlay();

License

This project is licensed under the MIT License. Feel free to do whatever you want with it., (*13)

If you do use this project, it would be great if you could add credit (although you don't have to!) Also I would love to see where and how you are using the project, so send me a message and let me know where I can check it out!, (*14)

This product is not endorsed, certified or otherwise approved in any way by Riot Games, Inc. or any of its affiliates., (*15)

The Versions

04/02 2014

dev-master

9999999-dev https://github.com/sct/League

PHP Library to access to the official League of Legends API

  Sources   Download

MIT

The Requires

 

04/02 2014

1.4.1

1.4.1.0 https://github.com/sct/League

PHP Library to access to the official League of Legends API

  Sources   Download

MIT

The Requires

 

26/01 2014

dev-dev

dev-dev https://github.com/sct/League

PHP Library to access to the official League of Legends API

  Sources   Download

MIT

The Requires

 

22/01 2014

1.4

1.4.0.0 https://github.com/sct/League

PHP Library to access to the official League of Legends API

  Sources   Download

MIT

The Requires

 

13/01 2014

v1.3

1.3.0.0 https://github.com/sct/League

PHP Library to access to the official League of Legends API

  Sources   Download

MIT

The Requires

 

20/12 2013

v1.2

1.2.0.0 https://github.com/sct/League

PHP Library to access to the official League of Legends API

  Sources   Download

MIT

The Requires

 

20/12 2013

v1.1

1.1.0.0 https://github.com/sct/League

PHP Library to access to the official League of Legends API

  Sources   Download

MIT

The Requires