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.
limit=250- https://xivapi.com/docs/Content#limitids=1,4,8,20- https://xivapi.com/docs/Content#idsminify=1- https://xivapi.com/docs/Content#minifylanguage=en- https://xivapi.com/docs/Welcome#languagesnake_case- https://xivapi.com/docs/Welcome#snake_casecolumns- https://xivapi.com/docs/Welcome#columnstags- https://xivapi.com/docs/Welcome#tags
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
_privateAPI is for internal use within XIVAPI and MogBoard. It cannot be used publicly and is locked behind an access key.
xivapi/xivapi-php 适用场景与选型建议
xivapi/xivapi-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 883 次下载、GitHub Stars 达 15, 最近一次更新时间为 2018 年 08 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「api」 「sdk」 「ffxiv」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 xivapi/xivapi-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 xivapi/xivapi-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 xivapi/xivapi-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Alfabank REST API integration
Zero-dependency raw PHP DNS resolver, domain-ownership verification, and intoDNS/MxToolbox-style diagnostics. Queries authoritative nameservers directly over sockets — never trusts the recursive cache for ownership checks.
A lightweight plain-PHP framework for database-backed CRUD APIs.
bughq error tracking - PHP SDK
ABsurge PHP SDK for feature flags and A/B testing
统计信息
- 总下载量: 883
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-08-14