Eve-apiphp
From EVEDev
| API Resources - Category Home - API Libraries - API Usage Examples - API Method Reference |
| Ale API Library for EvE (PHP 5) | |
|---|---|
| Maintainer: | Lumy |
| Stable release: | stable |
| Development release: | 0.50.1 |
| OS: | Platform independent, PHP 5 required |
| License: | LGPL v3 |
| Website: | http://code-box.sk/software/ale.html |
Contents |
[edit] Description
ALE is complex library for accessing EVE Online and EVE Central API. Library is fully object oriented allowing to use one of several cache plugins and http request handlers available. Developer can also make his own plugins suitable for his hosting without need to modify library itself. 0.5 series is a complete rewrite of Kw4h's original work. that uses OOP principles and allows database caching and other neat features.
[edit] Features
- Highly configurable.
- Multiple cache plugins. File system, raw MySQL, ADOdb and more possible.
- PostgreSQL cache by Luna Harkor
- Curl or fsock http request plugins.
- Easy to use. Just include single file and use factory to build you object by your preference.
- Dynamic API calls. No more waiting for update when CCP release new API.
- Errors handling by exceptions.
- Specialized XML parser. Access <rowset> elements by their name and use them as array. And few more neat features.
- API for EVE Central. Returns SimpleXMLElement. Nothing fancy, but good enough.
[edit] Installation
Download the latest release from the Sourceforge project page. Extract the "ale" directory - for example into ./classes/ale. Change eveonline.ini to match your desired configuration.
[edit] Examples
require_once 'ale/factory.php'; //get ALE object try { $ale = AleFactory::getEVEOnline(); //set user credentials, third parameter $characterID is also possible; $ale->setCredentials($userID, $apiKey); //all errors are handled by exceptions //let's fetch characters first. $account = $ale->account->Characters(); //you can traverse <rowset> element with attribute name="characters" as array foreach ($account->result->characters as $character) { //this is how you can get attributes of element $characterID = (string) $character->characterID; //set characterID for CharacterSheet $ale->setCharacterID($characterID); $characterSheet = $ale->char->CharacterSheet(); } } //and finally, we should handle exceptions catch (Exception $e) { echo $e->getMessage(); }
[edit] Documentation
Documentation is included in source code as PHPDOC.

