These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

PhealNG Examples Request

Author
Kalstir
Imperial Academy
Amarr Empire
#1 - 2014-08-18 07:32:21 UTC  |  Edited by: Kalstir
I have started to get interested in trying to build my own tool to just mess with the eve api and would like to try to use PhealNG. However I am a newer n00b to php and was wondering if anyone could provide some more in-depth examples to using PhealNG.

The 2 examples on git-hub were extremely helpful in helping me understand how to direct my query of what i wanted, however I am running into some issues understanding how to get as an example the wallet balance out of the request and into a displayable format and etc.

so if someone could provide some links to either the php concepts that I am missing in the foundation of my limited knowledge or some examples of PhealNG usage that would be amazing.


Also just as a side note, I would just sit down and read a book and learn how to become a php ninja, however I am more of one of those learners that does a hell of a lot better tearing something apart and seeing how it works in application than just reading text.

Anyways as said above, if anyone could provide me with any of the requested info above I would be extremely grateful!

Thanks,
Kal

PS. Please excuse any incorrect usage of terminology.



Edit: After using var_dump() I am getting better at stepping through to the data that I want. however right now I am banging my head against the wall trying to step through rowsets in the other api parts. such as the "/char/AccountBalance"

EVEDev xml example

I can "echo var_dump($response);" and I can tell that its all in there, i am just stuck at the $response->where->is->the->data
suid0
Pandemic Horde Inc.
Pandemic Horde
#2 - 2014-08-18 10:30:32 UTC
Going off memory so may not be 100% correct.

But I believe it goes into a rows array?

foreach($response->rows as $row) {
echo $row->balance;
}

the entire enemy support fleet is dead except for one interdictor a titan could easily finish off with drones  - Commander Ted

Peter Powers
Terrorists of Dimensions
#3 - 2014-08-18 11:18:13 UTC
"phealngcli" wrote:

[0] phealngcli> $keyID = 12345678;
→ 12345678

[1] phealngcli> $vCode = "somevcodehere";
→ 'somevcodehere'

[2] phealngcli> $characterID = 12345678;
→ 12345678

[3] phealngcli> $pheal = new \Pheal\Pheal($keyID, $vCode);
→ object(Pheal\Pheal)(
'scope' => 'account',
'xml' => NULL
)
[4] phealngcli> $result = $pheal->charScope->AccountBalance(['characterID' => $characterID]);
→ object(Pheal\Core\Result)(
'request_time' => '2014-08-18 11:10:20',
'request_time_unixtime' => 1408360220,
'cached_until' => '2014-08-18 11:11:20',
'cached_until_unixtime' => 1408360280
)

[5] phealngcli> foreach($result->accounts as $account) { echo $account->accountID . " :: " . $account->balance . "\n"; }
8677395 :: 29977282.50


just have done the quick example on my cli tool, but basically you can just use that code as an example... easy mode:
"concatenated" wrote:

// set the vars
$keyID = 12345678;
$vCode = "somevcodehere";
$characterID = 12345678;

// create pheal instance
$pheal = new \Pheal\Pheal($keyID, $vCode);

// fetch api result
$result = $pheal->charScope->AccountBalance(['characterID' => $characterID]);

// iterate over the accounts found
foreach($result->accounts as $account) { echo $account->accountID . " :: " . $account->balance . "\n"; }

3rdPartyEve.net - your catalogue for 3rd party applications

Kalstir
Imperial Academy
Amarr Empire
#4 - 2014-08-18 15:01:48 UTC
Thanks for the reply guys, I will give it another go when i get home today.
Kalstir
Imperial Academy
Amarr Empire
#5 - 2014-08-19 06:57:29 UTC
Thanks Peter Powers for the examples,

what finally worked for me was:

$response = $pheal->charScope->AccountBalance(['characterID' => $characterID]);

echo var_dump($response->accounts[0]->balance);



webpage:

0.00

Peter Powers
Terrorists of Dimensions
#6 - 2014-08-20 10:24:47 UTC
pheal(ng) always tries to use the name of the value it provides,
in case of a rowset thats the name attribute of that rowset =)

3rdPartyEve.net - your catalogue for 3rd party applications