定制 dancannon/php-wowapi 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dancannon/php-wowapi

Composer 安装命令:

composer require dancannon/php-wowapi

包简介

Library to connect to the WoW API

关键字:

README 文档

README

PHP-WowApi is a PHP (>= 5.3) API client for Blizzard's Community Platform API

Note: This library is no longer in development.

Main features

  • Support for Blizzards new JSON API
  • Works with the following resources:
    • Achievements
    • Arena and Rated Battleground Leaderboard
    • Auction House
    • Challenge Mode Leaderboard
    • Character
    • Character Classes
    • Character Races
    • Guild
    • Guild Perks
    • Guild Rewards
    • Items
    • Quests
    • Realm
  • Supports application authentication
  • Includes a cache to take advantage of LastModified headers Note: Not all APIs are currently active, check the API forums for more info

Requirements

  • Curl Extension
  • JSON encode/decode Extension

Installing

PHP-WowApi uses the autoloading features of PHP and works with most of the major frameworks. To load the library manually you can use the following code, you will need to change the base path depending on where you store the library:

<?php
//Path relative to this file
spl_autoload_register(function($class) {
    //Path relative to this file
    $dir = __DIR__ .'/lib/';
    $file = $dir . strtr($class, '\\', '/') . '.php';
    if (file_exists($file)) {
        require $file;
        return true;
    }
});

How To Use

To use the library you must first create an instance of the the Client class. Because this library supports multiple request adaptors you will need to pass the client class an instance of a request adaptor. Currently the only adaptor available is the Curl adaptor.

When using in a loop or long running program, be sure to unset both $api and $request after you are done with them and before using them for another character, or memory usage will continue to increase.

<?php
use WowApi\Client;
use WowApi\Request\Curl;

$request = new Curl();
$api = new Client();
$api->setRequest($request);

Contributing

Before submitting a PR please ensure that all the tests still pass.

Special Thanks

A special thanks goes out to the following contributing developers:

Bitdeli Badge

统计信息

  • 总下载量: 239
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 32
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 32
  • Watchers: 4
  • Forks: 13
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2012-03-09