losingbattle/opendota

opendotaSDK

1.0.3 2018-10-08 08:28 UTC

This package is auto-updated.

Last update: 2024-03-23 18:46:01 UTC


README

opendota api接口 借鉴easywechat的设计模式

EasyWeChat

📦 It is the SDK for opendota API

Requirement

  1. PHP >= 7.0.0
  2. composer
  3. openssl 拓展

SDK 对所使用的框架并无特别要求

Installation

composer require "losingbattle/opendota" -vvv

Usage

基本使用(以服务端为例):

<?php

use OpenDota\Application;

$options = [
    'api_key'     => 'xxx', (选填 在官网申请后使用 取消每天调用次数限制),
    'log' => [
        'file' => __DIR__.'/opendota.log',
    ],
    'http' => [
        'retry'=>2
    ],
];

$app = new Application($options);

$heros = $app->heroes;
$teams = $app->teams;
(其他接口参考文档和phpstrom ctrl跳进去看 - -)
$heros->data();
$heros->recent_matches($hero_id);

Documentation

License

MIT