定制 xivapi/xivapi-php 二次开发

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

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

xivapi/xivapi-php

Composer 安装命令:

composer require xivapi/xivapi-php

包简介

A PHP SDK for xivapi.com

README 文档

README

This provides a very simple client to interact with the XIVAPI and obtain dynamic objects in return.

Getting Started

This library requires PHP 7.4+

Install vis composer: https://packagist.org/packages/xivapi/xivapi-php

  • composer require xivapi/xivapi-php

Usage

The xivapi-php library is a very simple wrapper around Guzzle.

Initialize

$api = new \XIVAPI\XIVAPI();

Setting your key if you have one

You can set the environment variable: XIVAPI_KEY Or via:

$api->environment->key('my_api_key');

Using Queries (excludes Search)

The API has a whole host of queries to allow you to customise the response, these are all passed to the API before you request data. Search has some extra queries that are hard coded as these interact with Elastic Search.

Content

Content is dynamically driven based on what content is available in the game files using magic methods for invoking the different types, eg:

  • item()
  • instanceContent()
  • tripleTriadCard()
$api->content->[contentName]()->list();
$api->content->[contentName]()->one($id);

// examples
$item = $api->content->item()->one(1675);
$action = $api->content->action()->one(127);
$instances = $api->content->instanceContent()->list();

// non dynamic methods:
$api->content->list();
$api->content->servers();
$api->content->serversByDataCenter();

Search

$api->search->find($string)->results();

Search modification methods are:

// The column to search on
$api->search->findColumn($column);

// the algorithm to use
$api->search->findAlgorithm($searchStringAlgorithm);

// the page to start on
$api->search->page($number);

// sorting order
$api->search->sort($field, $order);

// limit results
$api->search->limit($limit);

// columns in the results
$api->search->columns($columns);

// change elastics filter bool condition (eg: should, must, must_not)
$api->search->bool($bool);

Filters are additive, multiple can be added, eg:

$api->search
    ->filter('LevelItem', 30, SearchFilters::GREATER_THAN)
    ->filter('ItemSearchCategory', 10, SearchFilters::GREATER_THAN_OR_EQUAL_TO);

Character

$api->character->search($name, $server, $page);
$api->character->get($id, $data = [], $extended = false);
$api->character->verify($id);
$api->character->update($id);
$api->character->delete($id);

Free Company

$api->freecompany->search($name, $server, $page);
$api->freecompany->get($id, $data = []);
$api->freecompany->update($id);
$api->freecompany->delete($id);

Linkshell

$api->linkshell->search($name, $server, $page);
$api->linkshell->get($id, $data = []);
$api->linkshell->update($id);
$api->linkshell->delete($id);

PvPTeam

$api->pvpteam->search($name, $server, $page);
$api->pvpteam->get($id, $data = []);
$api->pvpteam->update($id);
$api->pvpteam->delete($id);

Note: The _private API is for internal use within XIVAPI and MogBoard. It cannot be used publicly and is locked behind an access key.

统计信息

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

GitHub 信息

  • Stars: 15
  • Watchers: 2
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固