sct/league 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

sct/league

Composer 安装命令:

composer require sct/league

包简介

PHP Library to access to the official League of Legends API

README 文档

README

A simple PHP library for the official League of Legends API

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

Requirements

  • PHP >=5.3
  • PHP Curl Extension

Installation

You can install this library using composer. Learn about composer @ getcomposer.org

  1. Require the package in your composer.json

    "sct/league": "dev-master"

  2. Run Composer to install the new requirement

    php composer.phar install or

    php composer.phar update

Now make sure you are using the composer autoload in your project:

require 'vendor/autoload.php';

use sct\League\Summoner;

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

And thats it you are good to go.

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.

Example Usage for multiple summoners

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

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

Usage

Getting Summoner Data

$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

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.

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!

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

统计信息

  • 总下载量: 73
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 10
  • Watchers: 4
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-12-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固