open All Channels
seplocked EVE Technology Lab
blankseplocked Pheal - a new, simple to use PHP5 API Library
 
This thread is older than 90 days and has been locked due to inactivity.


 
Pages: 1 [2] 3

Author Topic

Peter Powers
FinFleet
Raiden.
Posted - 2010.11.12 13:01:00 - [31]
 

Pheal 0.0.7:

Bugfixes:
- a bug with element names has been fixed (Wollari)
- in some php configurations $_ENV is not available, now getenv() is used (niki)

Features
- can now use curl rather then usual file getting (Wollari)
- can now archive API cache (Wollari)
- RowSetRows can now be casted to strings, when done so they will contain the text content of such element (Peter Powers)

For the new features feel free to read the README,
i dont know if Wollari is going to add a few words to this thread.

Recommendation: Update ASAP, should be compatible.

Peter Powers
FinFleet
Raiden.
Posted - 2010.11.14 11:37:00 - [32]
 

Pheal 0.0.8:

Bugfixes:
- caching broken in 0.0.7 fixed again (Wollari)

Recommendation: Update ASAP, should be compatible.

Peter Powers
FinFleet
Raiden.
Posted - 2010.11.24 08:16:00 - [33]
 

Wollari did some more work,

Release:
v0.0.9 https://github.com/ppetermann/pheal

Changes
- few bug fixes / adjustments relating to rights in the filesystem
- feature: logging of API calls

Recommendation
Update if having errors, or needing new feature.

Wollari
Phoenix Industries
Wicked Nation
Posted - 2010.11.24 15:21:00 - [34]
 

Originally by: Peter Powers
I don't know if Wollari is going to add a few words to this thread.

Sure. Atm I'm busy recoding all my API daemons that are updating dotlan evemaps to use Pheal instead of pure SimpleXML (what I'm still using).

I like the simple approach just to provide an easier and generic interface to the API results rather then having a full API library that wants to handle everything. My application defines the database layout not the API library.

ATM I'm looking forward to see what kind of Features I'll enable on evemaps in the future.

Ghorth
Posted - 2010.11.29 21:38:00 - [35]
 

I'm very glad on finding this library. Very easy to use, install, with just a single line of code :)
I'm still a rookie in all this php and api thing, but managed to get it to work on an mvc!

It's really simple to get any value from the api... But I am struggeling on getting a list of values.
For example:
Quote:
echo $api->CharacterSheet(array("characterID" => $character->characterID))->skills[24]->skillpoints;

This will get me the amount of skillpoints for the skill at index 24.

But what if you want to get ALL your skills?
and how do you get the naming of the skill (typeID to name)?

Regards

Wollari
Phoenix Industries
Wicked Nation
Posted - 2010.11.30 15:44:00 - [36]
 

Originally by: Ghorth
echo $api->CharacterSheet(array("characterID" => $character->characterID))->skills[24]->skillpoints;

This will get me the amount of skillpoints for the skill at index 24.

But what if you want to get ALL your skills?
and how do you get the naming of the skill (typeID to name)?

Regards

You just loop through the skills and count them

try {
$API = new Pheal($userID, $apiKey, 'char');
$sheet = $API->CharacterSheet(array('characterID' => $characterID));
} catch (PhealException $E) {
// do something with the error $E->getCode();
// maybe mark your API Key as Invalid (see CCP's error codes, etc)
}

$skillpoints = 0;
foreach($sheet->skills AS $skill)
$skillpoints += $skill->skillpoints;

For the real names of the Skills/Items you better take a look into the Static Database Dump (invTypes/eveNames) and match this with the typeID

Peter Powers
FinFleet
Raiden.
Posted - 2011.01.31 08:25:00 - [37]
 

Hey guys,
after the last few weeks have been a bit silent,
here is the latest release of Pheal.


Release:
v0.0.13 https://github.com/ppetermann/pheal

Changes
- Workarround for a bug with cachetimers (thanks Wollari)
- Extended Support for https (thanks Wollari)
- Support for http keep_alive (and again, thanks Wollari)
- support for fluent scope settings (thanks erik)

Recommendation
Upgrade, use https.

Peter Powers
FinFleet
Raiden.
Posted - 2011.02.07 21:56:00 - [38]
 

Wollari is killing my sleep with all his Pull requests,
so now presending the next version

Release:
v0.0.14 https://github.com/ppetermann/pheal

Changes
now offers an toArray() method, that allows to convert pheal results to arrays (for example if you need to put 'em out as json)

Recommendation
Upgrade, if you have use for toArray, otherwise you can skip version.

Aglaia Adrastos
Posted - 2011.02.15 23:41:00 - [39]
 

I'm trying some tests to get to know this library but i gather its only me getting issues :P

Quote:
Warning: SimpleXMLElement::__construct()


and a lot of them. the code I'm using is;

Quote:
$pheal = new Pheal();
try {
$result = $pheal->eveScope->FacWarStats();
$result = $pheal->ApiPage();
$rawxml = $pheal->xml;
} catch(PhealException $e) {
echo 'error: ' . $e->code . ' meesage: ' . $e->getMessage();
}



Maybe i'm miss understanding something but it caches the file fine and so on, just doesn't print the xml.

Aglaia Adrastos
Posted - 2011.02.16 09:40:00 - [40]
 

Edited by: Aglaia Adrastos on 16/02/2011 10:09:19
Originally by: Wollari
Originally by: Ghorth
echo $api->CharacterSheet(array("characterID" => $character->characterID))->skills[24]->skillpoints;

This will get me the amount of skillpoints for the skill at index 24.

But what if you want to get ALL your skills?
and how do you get the naming of the skill (typeID to name)?

Regards

You just loop through the skills and count them

try {
$API = new Pheal($userID, $apiKey, 'char');
$sheet = $API->CharacterSheet(array('characterID' => $characterID));
} catch (PhealException $E) {
// do something with the error $E->getCode();
// maybe mark your API Key as Invalid (see CCP's error codes, etc)
}

$skillpoints = 0;
foreach($sheet->skills AS $skill)
$skillpoints += $skill->skillpoints;

For the real names of the Skills/Items you better take a look into the Static Database Dump (invTypes/eveNames) and match this with the typeID


found the foreach was adding up skill points to display total not each one as a new record.


$skillpoints = 0;
foreach($sheet->skills AS $skill){
$skillpoints = $skill->skillpoints;
}


still looking into my own learning of this to get the skill id displayed.

so far:


$skillpoints = 0;
foreach($sheet->skills AS $skill){
$skilltype - $sheet->skills->typeID;
$skillpoints = $skill->skillpoints;
$level = $skill->level;
echo ' - '. $skilltype . ', ' .$skillpoints . 'sp, L' . $level . '<br />';
}

Peter Powers
FinFleet
Raiden.
Posted - 2011.02.16 12:02:00 - [41]
 

Originally by: Aglaia Adrastos
I'm trying some tests to get to know this library but i gather its only me getting issues :P

Quote:
Warning: SimpleXMLElement::__construct()


and a lot of them. the code I'm using is;

Quote:
$pheal = new Pheal();
try {
$result = $pheal->eveScope->FacWarStats();
$result = $pheal->ApiPage();
$rawxml = $pheal->xml;
} catch(PhealException $e) {
echo 'error: ' . $e->code . ' meesage: ' . $e->getMessage();
}



Maybe i'm miss understanding something but it caches the file fine and so on, just doesn't print the xml.

does it give you any line/file where that warning occurs?

Wollari
Phoenix Industries
Wicked Nation
Posted - 2011.02.16 13:06:00 - [42]
 

Originally by: Aglaia Adrastos
found the foreach was adding up skill points to display total not each one as a new record.


$skillpoints = 0;
foreach($sheet->skills AS $skill){
$skillpoints = $skill->skillpoints;
}

Of course ... if you wanna have the total SP of your character you've to just sum up all skillpoints, thats what the loop was for. And it should give your an example on how things work.

If you wanna get all skills you loop through them and fetch typeID, level and skillpoints. Additionally you need the Skill Names and their Group (from invTypes/invGroups) to sort them right and display their name.

Wollari
Phoenix Industries
Wicked Nation
Posted - 2011.02.16 13:13:00 - [43]
 

Originally by: Aglaia Adrastos
I'm trying some tests to get to know this library but i gather its only me getting issues :P

Quote:
Warning: SimpleXMLElement::__construct()


and a lot of them. the code I'm using is;

Quote:
$pheal = new Pheal();
try {
$result = $pheal->eveScope->FacWarStats();
$result = $pheal->ApiPage();
$rawxml = $pheal->xml;
} catch(PhealException $e) {
echo 'error: ' . $e->code . ' meesage: ' . $e->getMessage();
}



Maybe i'm miss understanding something but it caches the file fine and so on, just doesn't print the xml.

It maybe don't work cause you're calling $pheal->ApiPage() which was just an example and not a real API Page. The combination of Scope + called method(params) gets translated into api.eveonline.com/<scope>/<method>?<params>. Afterwords the result is parsed using SimpleXML and transformed into the return PhealResult object.

The construct() warning messages comes likely from a non-xml result. API Pages that are not beeing returned as XML (404 messags are HTML) will result in XML parsing warnings/errors. Errors are beeing catched with "try{}catch()" and are throwing a PhealException finally, but php warnings will still be displayed until we suppress them (which would be a bad way)

Anyway ... I'll change Pheal that we'll throw a PhealException if the Server returns something that's not okay (like 404 or 500)

Aglaia Adrastos
Posted - 2011.02.16 22:46:00 - [44]
 

Edited by: Aglaia Adrastos on 16/02/2011 22:50:03
Just linked in my copy of the static dump... should of done it before.

Now i just want to join a mail group for any updates to Pheal, now officially ADDICTED as this is what I've been needing and wanting for a LOOOONG time.

Keep up the good work

Quote:

$skillpoints = 0;
foreach($sheet->skills AS $skill){

$ergebnis = mysql_query("SELECT * FROM " . $evedb . ".invTypes WHERE typeID = '".$skill->typeID."'", $intel);
while($ds = mysql_fetch_array($ergebnis)) {
$skilltype = $ds['typeName'];
}

$skillpoints = $skill->skillpoints;
$level = $skill->level;
echo ' - '. $skilltype . ', ' .$skillpoints . 'sp, L' . $level . '<br />';
}



works like a dream for testing, will future proof the mysql_query with another function just this was written for a quick glance.

the $evedb and $intel are due to me using more than one table in my site so not to lose any information when i update the static dump.

MJ Maverick
IronPig
Sev3rance
Posted - 2011.02.27 23:53:00 - [45]
 

Any idea how I would pull a list of corporationIDs that are members of a specified alliance from AllianceList? I'm trying to pull them in but just can't find an example to go off and what I have tried so far pulls in nothing.

Wollari
Phoenix Industries
Wicked Nation
Posted - 2011.02.28 19:15:00 - [46]
 

Originally by: MJ Maverick
Any idea how I would pull a list of corporationIDs that are members of a specified alliance from AllianceList? I'm trying to pull them in but just can't find an example to go off and what I have tried so far pulls in nothing.

Sadly there's no API that let you query a specific alliance. You've to query the whole AllianceList API and loop through it until you find what you need.

tbh It would make more sense to load that data into the db first, but hat something different.

MJ Maverick
IronPig
Sev3rance
Posted - 2011.02.28 19:24:00 - [47]
 

Ah, damn. So basically dump the AllianceList.xml into a DB?

Is there a function in Pheal to do that? If not any ideas what the best way to do it would be and an example database structure?

Peter Powers
FinFleet
Raiden.
Posted - 2011.02.28 23:46:00 - [48]
 

Originally by: MJ Maverick
Ah, damn. So basically dump the AllianceList.xml into a DB?

Is there a function in Pheal to do that? If not any ideas what the best way to do it would be and an example database structure?

no, the api library would be the wrong place to do this.
the design of the database depends on what you need, and what database system you are using.

MJ Maverick
IronPig
Sev3rance
Posted - 2011.03.01 02:41:00 - [49]
 

Edited by: MJ Maverick on 02/03/2011 00:34:20
Thanks for the reply. It would be using MySQL and PHP5.

I'm having some trouble getting it to echo CorporationIDs, any idea what I'm missing? I'm pretty new to PHP.


Quote:
spl_autoload_register("Pheal::classload");
$pheal = new Pheal(null, null, null);

$pheal->scope = "eve";
$result = $pheal->AllianceList();
$alliances = $result->alliances;
foreach($alliances as $currentAlliance) {
if ($currentAlliance->name == "Sev3rance") {
$AexecutorCorpID = $currentAlliance->executorCorpID;
$AmemberCount = $currentAlliance->memberCount;
$AstartDate = $currentAlliance->startDate;
echo "<strong>Debug:</strong><br /> Executor Corp ID: $AexecutorCorpID<br /> Alliance Members: $AmemberCount<br /> Alliance Founded: $AstartDate<br />";

$corporationID = $currentAlliance->Sev3rance->memberCorporations->corporationID; //Test
echo "$corporationID <br />"; //Test

foreach($currentAlliance as $currentCorp) {
//$corporationID = $memberCorporations->memberCorporations->corporationID;
//echo $corporationID;
$corporationID = $currentCorp->corporationID;
echo "$corporationID <br />";
}
}
}


Spartan 019
Posted - 2011.03.11 07:06:00 - [50]
 

Edited by: Spartan 019 on 11/03/2011 09:19:07
Ok, I've been playing with this thing for the past few hours... lol. I'm a nub at php really.

I've got it displaying the characters per your example... but how do I go about finding how to display other things like a characters corporation, alliance, skills... etc?

I've been looking everywhere for documentation beyond the readme... and it's pretty bleak.

Please help. =)

Tazo Chi
Posted - 2011.03.12 05:55:00 - [51]
 

Originally by: Spartan 019
Edited by: Spartan 019 on 11/03/2011 09:19:07
Ok, I've been playing with this thing for the past few hours... lol. I'm a nub at php really.

I've got it displaying the characters per your example... but how do I go about finding how to display other things like a characters corporation, alliance, skills... etc?

I've been looking everywhere for documentation beyond the readme... and it's pretty bleak.

Please help. =)


I've written a basic program that shows most of the Character Sheet info, skill lists, and your ability to fly a pvp battlecruiser. This is a stripped down version of a larger program but you should be able to read through the source and figure out what it is doing. If you have the ability to install it you can do that as well but it needs an SQL database to be able to look up the skill names from the invTypes table.

I'm also new to pheal and php. I'm sure there are better ways to have written this but it's the best I could do.

api_check.zip 563kb zip file

Wollari
Phoenix Industries
Wicked Nation
Posted - 2011.03.12 21:03:00 - [52]
 

Originally by: Spartan 019
Edited by: Spartan 019 on 11/03/2011 09:19:07
Ok, I've been playing with this thing for the past few hours... lol. I'm a nub at php really.

I've got it displaying the characters per your example... but how do I go about finding how to display other things like a characters corporation, alliance, skills... etc?

I've been looking everywhere for documentation beyond the readme... and it's pretty bleak.

Please help. =)

You should take a closer look to the available APIs that CCP offers. Pheal is only a library to access and walk through the API result and at the same time handling caching, logging, keepalive and all this transportlayer stuff.

If you know what you want to achive with the given API data, you'll be fast accessing and using the given data with Pheal.

Spartan 019
Posted - 2011.03.14 07:11:00 - [53]
 

Edited by: Spartan 019 on 14/03/2011 07:11:37
Man, I've pretty much figured it out so far. Thanks to the developers! I've learned soo much with this! :D

Crystalia Knauk
Posted - 2011.04.14 15:57:00 - [54]
 

How do use the following api method with pheal?
Char_JournalEntries

MJ Maverick
IronPig
Sev3rance
Posted - 2011.05.24 03:01:00 - [55]
 

FYI:

Strict Standards: date_default_timezone_get() [function.date-default-timezone-get]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /home/*****/public_html/forumapi/pheal/PhealResult.php on line 70

Peter Powers
FinFleet
Raiden.
Posted - 2011.05.24 16:24:00 - [56]
 

Originally by: MJ Maverick
FYI:
Strict Standards: date_default_timezone_get() [function.date-default-timezone-get]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /home/*****/public_html/forumapi/pheal/PhealResult.php on line 70


so, either setup date.timezone in your php.ini,
set the TZ environment variable of your system,
or run date_default_timezone_set in your application,
its not like a library you use should change the timezone settings you have ;)

MJ Maverick
IronPig
Sev3rance
Posted - 2011.05.24 17:04:00 - [57]
 

Ah k, I can't find anything like that in my php.ini, do you know what the field actually is? I've CTRL+F'd "time" and "date" and can't find anything similar.

Squizz Caphinator
Woopatang
Posted - 2011.05.24 18:03:00 - [58]
 

Originally by: MJ Maverick
Ah k, I can't find anything like that in my php.ini, do you know what the field actually is? I've CTRL+F'd "time" and "date" and can't find anything similar.


http://php.net/manual/en/function.date-default-timezone-set.php

Example:

Quote:

date_default_timezone_set("UTC");


MJ Maverick
IronPig
Sev3rance
Posted - 2011.05.24 19:12:00 - [59]
 

Hmm, I added
Quote:
date.timezone = "Europe/London"

to php.ini (PHP v5.2.14) but I'm still getting it. :/

Peter Powers
FinFleet
Raiden.
Posted - 2011.05.26 05:39:00 - [60]
 

Originally by: MJ Maverick
Hmm, I added
Quote:
date.timezone = "Europe/London"

to php.ini (PHP v5.2.14) but I'm still getting it. :/


http://www.php.net/manual/en/datetime.configuration.php
it explains how it needs to be named, what options are accepted (link to a timezone list is there).
Also, have you restarted your webserver after changing the php.ini?


Pages: 1 [2] 3

This thread is older than 90 days and has been locked due to inactivity.


 


The new forums are live

Please adjust your bookmarks to https://forums.eveonline.com

These forums are archived and read-only