drsdre / yii2-oddsgg-api
Odds.gg 电子竞技赔率 API 的 Yii2 扩展
1.0.2
2017-01-25 13:55 UTC
Requires
- php: >=5.5.0
- yiisoft/yii2-httpclient: ~2.0.1
This package is auto-updated.
Last update: 2024-08-29 05:18:33 UTC
README
Odds.gg 电子竞技赔率 API 的 Yii2 客户端
需求
PHP5.5 和 Yii2 框架。
安装
安装此扩展的最佳方式是通过 Composer。
运行以下命令:
composer require --prefer-dist drsdre/yii2-oddsgg-api "*"
或者将以下内容添加到您的 composer.json
文件的 require
部分:
"drsdre/yii2-oddsgg-api": "*"
缓存设置
此扩展提供了在本地缓存中存储和更新数据的能力,以绕过 API 限制。需要使用以下迁移脚本创建几个数据库表:
./yii migrate --migrationPath=./vendor/drsdre/yii2-oddsgg-api/migrations
用法
您需要将客户端设置为一个应用程序组件
'components' => [ 'oddsGGApi' => [ 'class' => 'drsdre\OddsGG\Client', 'service_url' => 'zzz', 'api_key' => 'xxx', ] ... ]
或者在代码中直接定义客户端
$client = new \drsdre\OddsGG\Client([ 'service_url' => 'yyy', 'api_key' => 'xxx', ]);
API 文档
有关完整的 API 文档,请参阅 http://www.odds.gg/UserAccount/UserAccount。