Pages: 1 2 [3] 4 :: one page |
|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |

Rynlam
|
Posted - 2008.03.06 23:55:00 -
[61]
I've added my stuff to wiki.eve-dev.net
|

Kanmahr
|
Posted - 2008.05.30 12:04:00 -
[62]
Hello, wondering you can help
After a few retrievals (cached or not) the getSkillTree call throws the following error:
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: Entity: line 5492: parser error : out of memory error in /php/api/class.api.php on line 273
It's the first thing I call in my file. Anyone else have issues with this?
|

Aepod
|
Posted - 2008.06.01 01:36:00 -
[63]
I am seeing the same error. Anyone have any luck fixing it?
|

deadmeet
|
Posted - 2008.06.05 16:06:00 -
[64]
can somebody upload somewhere the php class you can find on the eve dev wiki ? the website is down...
|

Jessica May
|
Posted - 2008.06.09 13:49:00 -
[65]
Edited by: Jessica May on 09/06/2008 13:54:25 Edited by: Jessica May on 09/06/2008 13:54:08 <?php require_once('class.api.php'); require_once('class.charselect.php'); require_once('class.balance.php'); require_once('class.charactersheet.php'); require_once('class.generic.php'); require_once('class.membertrack.php'); require_once('class.transactions.php'); require_once('class.walletjournal.php');
$user= 'blah'; $pass= 'blah'; $charID= 'blah';
$api = new Api(); $api->debug(true); $api->cache(false); $api->setCredentials($user,$pass,$charID); $Tng = $api->getSkillInTraining();
$api->printErrors(); ?>
Gives me: Error: File does not exist: ./xmlcache/blah/char/SkillInTraining.xml.aspx Api: Invalid characterID. Error: File does not exist: ./xmlcache/blah/char/SkillInTraining.xml.aspx
(replace blah with actual info). It's as if it's looking in the wrong place. Anyone help? I've basic PHP skills and trying to learn on the job.
EDIT: Forget it, schoolboy error!
|

deadmeet
|
Posted - 2008.06.17 20:50:00 -
[66]
Hi,
It is possible to have an example of code to get the global skilltree ?
This call don't require the userId or APIkey, so there is no need to use the setcredential function I imagine, but not sure.
I would like to see an example of that please.
thanks in advance.
|

xconspirisist
|
Posted - 2008.06.20 23:51:00 -
[67]
This thing could really do with a very simple readme, because the way in which your code is structured is quite obscure, although I do appreciate your efforts.
I am trying to get the skill currently in training just for the moment, yet can't figure out how I am supposed to do that, as things like $api->getSkillInTraining and associated methods always return null! A little code a example in this forum would probably be ample, many thanks in advance.
|

Steven Sayers
Fluid Group Dynamics
|
Posted - 2008.06.21 01:46:00 -
[68]
This is a very exciting project you are working on and I hope it continues to be successful!
|

Hylax Ciai
Starlancer United
|
Posted - 2008.06.22 08:36:00 -
[69]
Anyone knows how to avoid this error?
Quote: Error: File does not exist: ./xmlcache/*******/account/Characters.xml.aspx Api: Must provide userID parameter for authentication. Error: File does not exist: ./xmlcache/*******/account/Characters.xml.aspx
code:
Quote: function check_reg($userid, $apikey) { $allowed = array ("*****"); //$allowed is an array of allowed corps. Will be loaded from database later on. require_once('./api/class.api.php'); require_once('./api/class.charselect.php');
$apiuser = $userid; $apipass = $apikey;
$api = new Api(); $api->debug(true); // enable debugging $api->cache(false); // do not use a cache-file, if one exists $api->setCredentials($apiuser,$apipass);
$apichars = $api->getCharacters(); // retrieve API character XML file $apicharacters = CharSelect::getCharacters($apichars);
$apichar = $apicharacters[0]['charid']; $apicharcorp = $apicharacters[0]['corpname'];
echo "<br />Character ID: ".$apichar; echo "<br />Corporation: ".$apicharcorp;
$api->printErrors(); // display errors }
Calling the function like this:
Quote: $userid = htmlspecialchars($_POST['userid']); $apikey = htmlspecialchars($_POST['apikey']); check_reg($userid,$apikey);
Saw some other people getting the same error.
|

Lumy
Minmatar Templars of Space
|
Posted - 2008.06.28 21:46:00 -
[70]
Edited by: Lumy on 28/06/2008 21:46:42 Another issue:
I needed function to retrieve Corporation Sheet. So I extended (EveHelperApi extends Api) original class and added my function.
Quote:
public function getCorporationSheet($corpid) { $params = array(); $params['corporationID'] = $corpid; return $this->retrieveXml("/corp/CorporationSheet.xml.aspx", $params); }
This won't work because on line 80 method retrieveXml rewrites $params parameter. So I had to replace it with
Quote:
if (!is_array($params)) { $params = array(); }
Hope this helps you. Is there anyone working on this class anymore?
Joomla! in EVE - IGB compatible CMS. |
|

Lumy
Minmatar Templars of Space
|
Posted - 2008.06.28 22:05:00 -
[71]
Originally by: Rynlam see last post on previous page
I'm afraid both mine oand yours solution will mess up with one thing - caching :( Sorry I've noticed it this late (past midnight here)). I'll try to post suggestion how to fix this later(TM).
Joomla! in EVE - IGB compatible CMS. |

Dark Fibre
|
Posted - 2008.06.29 00:49:00 -
[72]
I'm going to bed now, banging my head trying to make a php page display all the members in a corp (using a director api).
If anybody can supply a working page or at least point me in the right direction I will line your pockets with iskies!
Thanks,
DF |

Yorick Downe
Caldari Agony Unleashed Agony Empire
|
Posted - 2008.07.03 02:16:00 -
[73]
DF, I sent you EveMail. I'll be happy to work with you :)
Rynlam, Lumy, I have an idea on how to fix the caching issue: The trouble is that the cache does not know corpID, just charID. Teaching it corpID would fix that particular problem.
However, I don't just want to do that - there are more issues with the cache, for example, for walletJournal, it would need to know refID too, or something along those lines, so that caching does not mess with retrieving more than 1000 journal lines. There may be more API functions like that that have such issues.
The "raw XML caching in a directory" method has an advantage - it's easy and quick. I think DB caching would be overkill for this little thing. But still, rethinking the way caching works and making it work for more API functions - and being able to set cache timeout individually, while respecting EvE API's caching time - would be a good thing. That last one is for functions that you may want to keep cached for 24 hours or so on your webpage.
I'll ponder this for a bit. In the meantime, my class.api.php is changing - is it time to throw this thing into a source repository? Or just keep tinkering with it for a bit and then release a "0.21", since Kw4h appears to be MIA?
|

Lumy
Minmatar Templars of Space
|
Posted - 2008.07.03 07:44:00 -
[74]
Edited by: Lumy on 03/07/2008 07:45:10 The class definitely needs better way to build cache file path. Something that would allow build it based on passed parameters.
My suggestion: add third parameter to retrieveXML method: $cachePath. then rework getCacheFile to something like this:
Quote:
private function getCacheFile($params, $cachePath) { $realpath = $this->cachedir; foreach ($cachePath as $segment) { if (isset($params[$segment])) { $realpath .= DIRECTORY_SEPARATOR.$params[$segment]; } else { $realpath .= DIRECTORY_SEPARATOR.$segment; } return $realpath; }
and minor detail, you definitely could use something like this:
Quote:
public function setCacheDir($dir) { $this->cachedir = $dir; }
In case, that you have application with several roots (e.g. root/ and root/adminstrator), but you want them to use the same cache directory. |

Yorick Downe
Caldari Agony Unleashed Agony Empire
|
Posted - 2008.07.03 10:27:00 -
[75]
I like that idea. While we're setting the path, how about also passing along the timeout? That way, it would be individual per API function. You'd want a way to set the timeout "from the outside", too, ideally.
Alright, we need to be able to collaborate on this code. Got a suggestion for a source repository? Of course, there's always SourceForge, I suppose.
|

Lumy
Minmatar Templars of Space
|
Posted - 2008.07.03 12:32:00 -
[76]
Ehm:
Permission Denied
Access to this page is restricted (either to project members or to project administrators) and you do not meet the requirements to access this page. Please contact the administrator of this project for further assistance.
Joomla! in EVE - IGB compatible CMS. |

Yorick Downe
Caldari Agony Unleashed Agony Empire
|
Posted - 2008.07.03 16:16:00 -
[77]
Edited by: Yorick Downe on 04/07/2008 04:26:25 Edited by: Yorick Downe on 03/07/2008 16:27:52 SourceForge literally just now approved the project. Try again, you should see the page now. I'm at work for another 6-7 hours - I'll go upload stuff to SVN and process your dev access (if you can get the app in before then :)) when I come home.
[edit - let's use SVN, it's so much nicer overall. Didn't know SF did SVN as well as CVS, sweet]
[Edit2]
- SVN repository has been seeded - I've added your caching logic suggestions, Lumy, if slightly modified - I've also added individual timeouts and "cachethis" bools to all get functions - Fixed a bug that broke any get function that actually passed a $param. D'oh. - And annotated some stuff that I think should be changed
I've tested the new caching logic on wallet transactions, works nicely. Full regression testing for all get functions is needed and has not yet been done.
|

Yorick Downe
Caldari Agony Unleashed Agony Empire
|
Posted - 2008.07.04 06:24:00 -
[78]
Edited by: Yorick Downe on 04/07/2008 17:49:51 Edited by: Yorick Downe on 04/07/2008 17:49:32 Edited by: Yorick Downe on 04/07/2008 17:48:36 Testing is going well so far. Fixed the way the getAccountBalance parser works, it wasn't in line with how all the others do their thing.
I am currently questioning the design of this library. Everything's done in a one-two-punch of:
require_once('./classes/eveapi/class.api.php'); require_once('./classes/eveapi/class.something.php');
$dataxml = $Api->getSomething(); $data = Something::getSomething($dataxml); // Start working with the $data array
Now, yes, that gives me a way to get the raw XML. But - why would I ever want that? Couldn't I save myself some coding hassle by "folding" it all in and then doing:
require_once('./classes/eveapi/class.api.php');
$data = $Api->getSomething(); // Start working with the $data array
Got still a few edges to polish before a 0.21 can be released, and I want to give Lumy and Rynlam a chance to look at it. 0.21 integrates Lumy's and Rynlam's work, and beyond that just fixes some bugs that really needed fixing. 0.21 will work with code that was written for 0.20 without needing to change that code.
I'm thinking that after 0.21, it's time to do away with the "one-two-punch" for 0.30, and add all current API functions. That would, yes, break existing code. That's the drawback. I don't know how widely used this API library is, though. It might not be such a biggy, and judging from the comments in this thread, people get rather confused by the way the library does things.
Please, if you have a stake in this either way, let us all know.
[Edit]
Answered my own question - the legacy way of grabbing the data will stay, to not break existing apps. I'll add qgetSomething functions, for "quick-get", that will skip the xml part and deliver an array directly.
Alright, good progress has been made. 0.21 is close to ready - it fixes bugs and brings the existing library to a level where caching works throughout and all functions and classes follow a common naming convention. There's also some parameter checking so those pesky non-numeric charids will be more obvious :). Don't worry, the old class and function names are still here, too, the aim is not to break any existing code.
There's one bit left for 0.21 that may either not get done until later or I'll need help with: Creating parsers for starbase list and starbase detail. I don't have a char that owns a POS corp to test these. 0.20 had xml retrieve functions for these two, but no parsers to an array.
There's a TODO out on the SVN. For those that are interested in the project but don't want to wade into SourceForge, the current plan calls for: - Release 0.21, stabilized point-release to make the current API usable - Release 0.30, add all known API functions, add quickget functions, possibly release the test / sample code I am using. - Release 0.31, add eve-central market API - Release 0.32, add a bunch of "utility functions" so you don't have to re-invent the wheel. This is where input will be most welcome. I have things in mind like setcharid(charname), getWalletTransactionsByType(reftype as String), getWalletJournalByType(reftype as String), getCorpMemberDetails(charname) - I'm sure you can think of more. Market functions? Transactions by date or by recipient / sender? What's commonly needed? This'll be your chance to get that utility function in there. - Release 0.40, add a view into the static data export. Kinda hazy on this at the moment. - Release 0.41, utility functions for static data export? Even hazier on that part.
|

Yorick Downe
Caldari Agony Unleashed Agony Empire
|
Posted - 2008.07.05 14:02:00 -
[79]
eve-apiphp 0.21 has been released
Release 0.21 stabilizes the 0.20 release that Kw4h created in 2007. Caching is now functional, and some parsing errors have been resolved. All classes and functions follow a common naming convention, and more parameter checks have been added. Code that has been built with 0.20 naming conventions is still expected to work. As always, if you find any issues, speak up.
|

deadmeet
|
Posted - 2008.07.11 19:45:00 -
[80]
Hi,
I could retrieve all characters informations with 0.20 version and now, with 0.21 I get some errors on the first request : charselect.
I trace the problem a little and the $contents variable return nothing in class.api.php line 584, don't know why.
|
|

deadmeet
|
Posted - 2008.07.11 21:15:00 -
[81]
Hi again,
I found the origin of the problem, this is the
$poststring = http_build_query($params); that didn't work properly.
There is a pretty easy and maybe more universal way to do the same thing :
$poststring = '';
foreach($params as $key => $param) { $poststring .= $key.'='.$param.'&'; }
it do the same job and work correctly on my localhost.
In addition, I made some function to retrieve missing API informations ATM, one to retrieve the assets list, one to retrieve the market orders.
However, they need a review, and the assets system still need some work. Because the code should assume there is no real limit in the asset depth, but I have some difficulties to build the returning array taking care of an indinite depth. So, ATM, it assume level 2 depth (list containers, and item in them only, but it's a good begining ;)).
I added them in the wiki
|

deadmeet
|
Posted - 2008.07.11 21:34:00 -
[82]
Hi,
I would add that there is a little problem with the assets retrieve and the new caching system. If I make a loop to get the assets of all character of an account, it get the assets of the first character only if I enable caching. If I disable it, it work properly.
|

Yorick Downe
Caldari Agony Unleashed Agony Empire
|
Posted - 2008.07.15 12:58:00 -
[83]
Deadmeet, thank you. That's interesting - I suppose that function isn't available on all servers, then, or something along those lines? I'll incorporate your suggestion to be sure. I want the API library to work on as many servers as possible. Note I didn't change that part of the code - maybe your server changed since 0.20? It's always used the http_build_query function.
Update on where this project is at, BTW. After many fruitful discussions with Lumy (Thanks, man, I owe you!), I have decided to break from kw4h's vision. The procedural "PHP5-but-really-PHP4" approach he is taking is limited, it does not scale well to extending the class, and it doesn't scale at all to supporting a test server API, chinese API (maybe, no promises), or eve-central API. So, the code framework will be ripped out and replaced. Data structures will remain intact, but the way the API is called will change. More on that as work progresses. I'll likely create a new thread for it once there's something to show.
The TL;DR quick-summary: v0.21 is considered a stable point-release of kw4h's effort. v0.30 will change the code structure, will change the calling conventions, but leave the data structure alone. v0.30 will require you to change the code that calls the API, but the code that works on the results can stay the same.
Trust me, this is for the best. A suggested direction for v0.21, given that it is so procedural, would be for someone, anyone, to take it over and fork it into a PHP4 project. v0.30 will be firmly, very firmly, PHP5.
|

Yorick Downe
Caldari Agony Unleashed Agony Empire
|
Posted - 2008.07.16 11:34:00 -
[84]
deadmeet, do me a favor? Try this:
$poststring = http_build_query($params,'','&');
I just tried running my code on XAMPP and for reasons known only to the developers of that package, they set arg_separator.output to "&", instead of the default "&", which makes the EvE API server very unhappy. Some hosting providers do the same.
And let me know whether that resolves your issue, please.
|

deadmeet
|
Posted - 2008.07.16 16:53:00 -
[85]
Hi,
It seems to work like a charm, on a localhost wamp server ;)
I'm playing with the new version of API you provided on the wiki, great job !!
I can't wait to play with the missing stuff like assets listing ;)
|

Yorick Downe
Caldari Agony Unleashed Agony Empire
|
Posted - 2008.07.17 02:40:00 -
[86]
Wow, this is an annoyingly common problem - my corp just got bitten by it, too. The workaround code I gave you only works with PHP 5.2.x. For 5.0/5.1, you'd call this before http_build_query:
ini_set('arg_separator.output','&');
I thought anything before 5.2.x was well and truly done for, but I guess not. Shucks. And here I was going to use all kinds of nifty 5.2 features, too - guess not, then.
|

deadmeet
|
Posted - 2008.07.17 11:51:00 -
[87]
Hi,
Yes, I have php 5.2 on my localhost, so your previous suggestion worked well.
What about my solution ? maybe it's not the most "optimised", but I think it will work on most platform as it's only concatenation of strings.
|

Lumy
Minmatar Templars of Space
|
Posted - 2008.07.17 16:13:00 -
[88]
Originally by: deadmeet Hi,
Yes, I have php 5.2 on my localhost, so your previous suggestion worked well.
What about my solution ? maybe it's not the most "optimised", but I think it will work on most platform as it's only concatenation of strings.
You should use http_build_query because it automatically encode special characters like space, percent signs, etc. For example /eve/CharacterID.xml.aspx can contain them.
Joomla! in EVE - IGB compatible CMS. |

Rynlam
|
Posted - 2008.07.17 17:16:00 -
[89]
Nice to see someone has picked this up. I'll have to look at the updated stuff... I had moved everything into a single class using cURL and have been using that with no problems for a while. I much prefer a monolithic class over having to call a static function by name every time I want to get API data... getCharInfo() then CharInfo::getCharInfo() is just stupidly redundant and wasteful IMNSHO...
|

Yorick Downe
Caldari Agony Unleashed Agony Empire
|
Posted - 2008.07.18 17:33:00 -
[90]
Hey Rynlam, welcome to the project! I hope we can pull you over to the dark side - I really don't want a monolithic class, but I agree that the one-two-punch is highly annoying. That's going to go out the window and no mistake.
On the http_build_query(), what Lumy said. It can get a bit more involved than just that simple concat.
0.22 is in testing right now, it fixes the http_build_query() issue and has improved caching, once more - it will now obey CCP's cachedUntil hint if no explicit timeout is given, with the exception of the wallet functions, where cachedUntil is broken. Bad CCP, only a soggy cookie.
|
|
|
|
|
Pages: 1 2 [3] 4 :: one page |
First page | Previous page | Next page | Last page |