drsdre / yii2-oddsgg-api
Yii2 Extension for Odds.gg eSports odds API
Installs: 19
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.5.0
- yiisoft/yii2-httpclient: ~2.0.1
This package is auto-updated.
Last update: 2024-10-29 06:05:32 UTC
README
Yii2 client for Odds.gg eSports Odds API
Requirements:
PHP5.5 and Yii2 Framework.
Installation
The preferred way to install this extension is through composer.
Either run
composer require --prefer-dist drsdre/yii2-oddsgg-api "*"
or add
"drsdre/yii2-oddsgg-api": "*"
to the require
section of your composer.json
file.
Cache Setup
This extension offers the ability to store and updates data in a local cache to circumvent API restrictions. Several database tables have to be created using the following migration script:
./yii migrate --migrationPath=./vendor/drsdre/yii2-oddsgg-api/migrations
Usage
You need to setup the client as application component:
'components' => [ 'oddsGGApi' => [ 'class' => 'drsdre\OddsGG\Client', 'service_url' => 'zzz', 'api_key' => 'xxx', ] ... ]
or define the client directly in the code:
$client = new \drsdre\OddsGG\Client([ 'service_url' => 'yyy', 'api_key' => 'xxx', ]);
API documentation
See http://www.odds.gg/UserAccount/UserAccount for full API documentation.