ogetit/ogetit
Composer 安装命令:
composer require ogetit/ogetit
包简介
OGetIt is a open source PHP library for handling the new OGame API as of version 6.
关键字:
README 文档
README
#OGetIt
OGetIt is a open source library for handling the new OGame API as of version 6.
It handles everything from connecting with the API, parsing the API to advanced calculations to get detailed results.
##Supported features ###Reports
- Combat
- Harvest
- Espionage
- Missile
##How to use?
include('autoload.php'); //Or via Composer
$ogetit = new OGetIt($uni, $lang, $apikey);
//Get Combat report
$cr = $ogetit->getCombatReport($crkey);
//Get Harvest report
$rr = $ogetit->getHarvestReport($rrkey);
//Get Spy report
$sr = $ogetit->getSpyReport($srkey);
//Get Missile report
$mr = $ogetit->getMissileReport($mrkey);
###Examples ####Get attacker losses from combat report
$cr = $ogetit->getCombatReport($crkey);
$result = $cr->getCalculator()->getFinalResult();
$result->getAttackers()->getLosses();
####Get harvested metal from harvest report
$rr = $ogetit->getHarvestReport($rrkey);
$rr->getMetal();
####Get Astrophysics level from espionage report
$sr = $ogetit->getSpyReport($srkey);
$sr->getDefender()->getResearch()[Astrophysics::TYPE];
####Get defender losses from missile report
$mr = $ogetit->getMissileReport($mrkey);
$mr->getDefender()->getLosses();
##Requirements
- PHP v5.4+ (64-bit)
- PHP cURL (libcurl v7.10.5+)
##Exceptions
###cURL codes
http://curl.haxx.se/libcurl/c/libcurl-errors.html
###OGame API codes
OK = 1000;
INVALID_VERSION = 4000;
INVALID_API_KEY = 4001;
INVALID_API_KEY_EXPIRED = 4002;
INVALID_API_PERMISSION = 4003;
INVALID_PATH = 4004;
INTERNAL_ERROR = 5000;
INVALID_CR_ID = 6000;
##Contributing
If you want to contribute code please fork this repository and create a pull request to merge your changes. Your changes will be reviewed and merged afterwards if approved by the repository maintainers.
##License
GNU Lesser General Public License, version 2.1
- License: GNU LGPL
ogetit/ogetit 适用场景与选型建议
ogetit/ogetit 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 228 次下载、GitHub Stars 达 26, 最近一次更新时间为 2015 年 07 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「OGame」 「UniverseView」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ogetit/ogetit 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ogetit/ogetit 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ogetit/ogetit 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
统计信息
- 总下载量: 228
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 26
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-2.1
- 更新时间: 2015-07-18