php api for Battle.net game APIs ( https://dev.battle.net/ )
- Cache built in.
Add "mrcorex/battlenet-api": "^1"
to your composer.json file and run "composer update".
Set key, server and locale.
\BattleNet\Config::setApiKey($key);
\BattleNet\Config::setServer(\BattleNet\Server::EU);
\BattleNet\Config::setLocale(\BattleNet\Locale::EN_GB);
To enable and use cache, specify path where to store cache-files (json).
\BattleNet\Config::setCachePath('/path/to/my/cache');
$data = new \BattleNet\Warcraft\Data();
$characterRaces = $data->getCharacterRaces();
$data = new \BattleNet\Diablo\Data();
$blacksmith = $data->getArtisanBlacksmith();
$data = new \BattleNet\StarCraft\Data();
$rewards = $data->getRewards();
\BattleNet\Config::clearCache('wow');
Notice that you need to specify "wow", "sc2" and "d3" to clear cache for specific game.
- Add media-links for various thumbnails, icons etc.
- Add support for Auth.
- 2016-04-02 1.0.0 Initial development.
- 2016-04-02 1.1.0 Added support for StarCraft.
- 2016-04-02 1.1.1 Added getMatches() for StarCraft.
- 2016-04-02 1.2.0 Added support for Diablo.
- 2016-04-02 1.3.0 Added support for changing cache-lifetime (short/long).
- 2016-04-02 1.4.0 Refactored cache handler for general usage.