mentos1386/opencrest

此包已被废弃且不再维护。尚未建议替代包。

EVE Online CREST库

3.0.1 2016-07-19 17:48 UTC

This package is not auto-updated.

Last update: 2020-01-18 20:52:24 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License Documentation Status Code Climate Test Coverage Build Status

EVE Online CREST PHP库

用于使用EVE Online CREST API的开源PHP库

由于CREST API缺少数据,目前还不建议用于生产。最好暂时使用XML API。

如何使用

use OpenCrest\OpenCrest;
$token = "Access Token you got from OAuth authentication | Required only for Authenticated resources";
OpenCrest::setToken($token);

// Get list of constellations
$constellations = OpenCrest::Constellations->get();

// You can then foreach list to get more details on constellations
foreach ($constellations as $constellation) {
    // This will make show($id) request for every object.
    //Beware, that OpenCrest::[something]->get() can be very long and that making get request on every item 
    // will make alot of reqquests.
    var_dump($constellation->get);

}
// Get specific constellation
$id = 20000002;
$constellation = OpenCrest::Constellations->get($id);

// Same with planets
$id = 40000017;
$planet = OpenCrest::Planets->get($id);

// Or alliances
$id = 99000006;
$alliance = OpenCrest::Alliances->get($id)->description;

// Get list of alliances
$alliances = OpenCrest::Alliances->get();

// Go to specific page
$alliances = OpenCrest::Alliances->page(2);

// Go to next page
// Using allrady recived object to know which page is next.
$alliances = $alliances->nextPage();

// Go to previouse page
// Using allrady recived object to know which page is previous.
$alliances = $alliances->previousPage();

端点文档

文档

许可

MIT许可(MIT)。请参阅许可文件获取更多信息。