elenotrindade/php-riot-api
Composer 安装命令:
composer require elenotrindade/php-riot-api
包简介
A PHP wrapper for the Riot Games API
README 文档
README
PHP Wrapper for Riot Games API allows you to quickly make calls to the RIOT API with a proper API Key. Key features include caching (if enabled) and rate limiting. Simply replace API_KEY_HERE with your API key from Riot Games.
Testing.php is a simple testing class that shows how to call all the functions.
Getting Started
- Replace INSERT_API_KEY_HERE
- Create folder called 'cache' wherever the script is (make sure it's writeable by php-riot-api)
- Create an instance of riotapi - $instance = new riotapi($platform);
- $platform can be na1, euw1, eun1, br1, ru, kr, oc1, la1, la2, jp1, pbe1, tr1 (br/tr only can call getLeague() and getTeam() functions)
- Make Calls to the functions listed below and receive JSON data
- Caching is done locally, instantiate php-riot-api with "new riotapi('na1', new FileSystemCache('cache/'));" to create a cache in the subfolder 'cache'
- DECODE_ENABLED is true by default. If you want your returns to be pure JSON and not an associative array, set it to false
- Take a look at testing.php for example code, including error handling, caching
Functions
//Returns all champion information.
getChampion();
//Change platform
setRegion($region);
// Returns all free champions.
getChampion(true);
getFreeChampions();
//performs a static call. Not counted in rate limit.
getStatic($call, $id = null, $params = null);
//Returns match details including timeline (if exists) given a match id.
//Use with care, rate limiting is not ready for this function
getMatch($matchId);
//Returns match details given a match id, without timeline.
getMatch($matchId, false);
//Returns timeline of a match
getTimeline($matchId)
//Returns a user's matchList given their account id.
public function getMatchList($accountId,$params=null)
//Returns the league of a given summoner.
getLeague($summoner_id);
getLeaguePosition($summoner_id);
//Returns the challenger ladder.
getChallenger($queue = "RANKED_SOLO_5x5");
//Returns the master ladder.
getMaster($queue = "RANKED_SOLO_5x5");
//returns a summoner's id
getSummonerId($summoner_name);
//returns an account's id
getSummonerAccountId($summoner_name);
//Returns summoner info given summoner id.
getSummoner($summoner_id);
//Returns summoner masteries given summoner id.
getMasteries($summoner_id);
//Returns summoner runes given summoner id.
getRunes($summoner_id);
//Returns summoner info given account id.
getSummoner($accountId);
//Gets a summoner's info given their name, instead of id.
getSummonerByName($summoner_name);
//Return details of an array of matches
//Use with care, rate limiting is not ready for this function
getMatches($ids, $includeTimeline = true)
Not Complete
Region Checking - Some functions are only available in certain regions and not in others.
elenotrindade/php-riot-api 适用场景与选型建议
elenotrindade/php-riot-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 02 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 elenotrindade/php-riot-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 elenotrindade/php-riot-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-12