|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |
Lumy
Minmatar eXceed Inc. Minor Threat.
|
Posted - 2009.04.04 22:51:00 -
[1]
0.50 RELEASE IS HERE
I'll try to keep this short. We have new release of Ale just for you. Currently marked as 0.5 RC1 (code name: Lumy's revenge) brings you:
- Complete OOP redesign
- Errors handling by exceptions. As God intended.
- Highly configurable. But you don't have to modify library.
- Multiple cache plugins. File system, raw MySQL, ADOdb and more possible.
- Curl or fsock http request plugins. Whatever your hosting supports.
- 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.
- Specialized XML parser. Access <rowset> elements by their name and use them as array. And few more neat features.
Note that this is release candidate. Though I'm using it for few of my project, there might be few bugs that need to be eradicated.
Eve-apiphp is currently undergoing rename to eve-ale on sourceforge. If the links get broken, change probably kicked in. I'll be watching and try correct links ASAP.
Links:
Project site
Example code
Documentation
Report bugs here
Need help? Ask here or use this thread.
Enjoy.
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar eXceed Inc. Minor Threat.
|
Posted - 2009.04.08 19:38:00 -
[2]
Yep, I suck at writing docs. I have added two more examples:
Get CorporationSheet using corporationID
Nestet <rowset> elements in KillLog
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar eXceed Inc. Minor Threat.
|
Posted - 2009.04.08 21:29:00 -
[3]
Originally by: Tonto Auri Edited by: Tonto Auri on 08/04/2009 21:07:24 Reading through CHANGES... just curious - are you going to have it ready for PHP 5.3? :)
EDIT: phpDocumenter ftw ^_^
Code is E_STRICT, so it should be fine. I don't expect to use any new 5.3 features. Namespaces would break backward compatibility. Every class and constant uses Ale- prefix, so it should be fine in almost all cases. Library doesn't extend any classes with static methods, so no need for late static binding.
I guess (persistent) mysqli cache would be nice. Will have a look at it.
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar eXceed Inc. Minor Threat.
|
Posted - 2009.04.24 21:32:00 -
[4]
Originally by: Syringe Edited by: Syringe on 24/04/2009 21:14:43 Thanks for the work on this release - you're a badass Lumy.
I'll be dissecting this thing for my drupal integration. You want me to follow through with documentation?
I hope only thing you'll have to do is to implement Drupal cache. Either implement AleInterfaceCache interface, or extend AleCacheAbstractDB class. Dunno which will suit you better (never coded Drupal extensions).
If you're willing to send final class to me, I'll gladly include it to library. Any contribution is welcome.
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar Sebiestor tribe
|
Posted - 2009.04.25 22:42:00 -
[5]
Quick update:
Added new class for EVE Central API. Example:
require_once 'ale/factory.php'; $ale = AleFactory::getEVECentral();
$params = array('typeid'=>array(34,35)); $xml = $ale->marketstat($params);
$params = array('typeid'=>34); $xml = $ale->quicklook($params);
$xml = $ale->evemon();
IMPORTANT: Always use config option "request.flattenParams = true". This will allow you to request multiple itemid-s in single request and more importantly, you won't get 417 server error. Cache time is in seconds from time of last uncached call. Option main.cacheTime. If you don't want to use cache, set cache.class to "Dummy".
Enjoy.
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar Sebiestor tribe
|
Posted - 2009.04.26 20:01:00 -
[6]
Edited by: Lumy on 26/04/2009 20:03:06 That's why do we have multiple http request connectors here ;)
Just go to eveonline.ini and set
[request] class= "Fsock"
or you can pass override in config array
$config = array('request.class' => 'Fsock'); $ale = AleFactory::getEVEOnline($config);
edit: or you can try to install curl
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar Sebiestor tribe
|
Posted - 2009.05.06 14:01:00 -
[7]
Both AleEVEOnline and AleEVECentral generates methods dynamically. Example: http://api.eveonline.com/example/call.xml.aspx translates to $eo_ale->example->call(); http://api.eve-central.com/api/examplecall translates to $ec_ale->examplecall();
For all available calls see documentation at EVE Central and EVE Development Network
There is one more complicated example here: http://sourceforge.net/docman/display_doc.php?docid=174933&group_id=233060. It's for KillLog, but I hope you'll get an idea. When in doubt, you can always transform result to array using $xml->toArray() (works only for EVE Online).
Hope it helps.
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar Sebiestor tribe
|
Posted - 2009.05.15 08:49:00 -
[8]
Actually, __construct() is a constructor. It changed from PHP4, where constructor was function named as class itself. http://php.net/manual/en/language.oop5.decon.php
For unnamed attributes and methods see __get and __call methods and AleUtilContext class. AleUtilContext is responsible for chaining section->call(). http://php.net/manual/en/language.oop5.overloading.php
The cache is intentionally simple and oblivious to structure of data. Otherwise I would have to code separate cache logic for every call. But nothing prevents you to make your own cache . Large amounts of data might be a problem, especially when you don't have access to db configuration. I'll add another config option for DB caches: maxDataSize (or something) to ignore larger data. Hopefully this weekend.
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar Sebiestor tribe
|
Posted - 2009.05.15 10:14:00 -
[9]
Btw, what version/config you're using? RC2/cache.class=mysql? I'm just checking code and I don't one fkin reason why should the library dump SQL into output.
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar Sebiestor tribe
|
Posted - 2009.06.10 10:26:00 -
[10]
Edited by: Lumy on 10/06/2009 10:29:22 Hi. Use "try { } catch ( ) { }" block to display error message. See this example http://sourceforge.net/docman/display_doc.php?docid=174326&group_id=233060. This will show whole SQL error, which will be more helpfull. Post it here please, or file a bug report.
Joomla! in EVE - IGB compatible CMS. |
|
Lumy
Minmatar Sebiestor tribe
|
Posted - 2009.06.11 11:13:00 -
[11]
Originally by: Clark Manson
Originally by: Lumy Edited by: Lumy on 10/06/2009 10:29:22 Hi. Use "try { } catch ( ) { }" block to display error message. See this example http://sourceforge.net/docman/display_doc.php?docid=174326&group_id=233060. This will show whole SQL error, which will be more helpfull. Post it here please, or file a bug report.
I removed the try-catch because it was not displaying anything....this was the only way I could get any feedback at all.
No wai.
catch (Exception $e) { echo $e->getMessage(); }
should print error message from MySQL server. Unless you instantly redirect script to another page or something. Anyway this should give more info: turn on error_reporting to E_ALL and set display_errors to true. If it doesn't help, go to /ale/cache/mysql.php:62 and print mysql_error directly and let script die().
Please let me know what you'll find.
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar Sebiestor tribe
|
Posted - 2009.07.16 16:31:00 -
[12]
Edited by: Lumy on 16/07/2009 16:34:58 Hi. Eve Central returns SimpleXMLElement object.
//you have to use children() method, if element contains multiple elements of the same name foreach ($xml->marketstat->children() as $type) { //you can get name of element echo $type->getName();
//if it contains only elements with different names, you can access it as property of object //and don't forget to cast type to string echo (string) $type->all->volume; //this is how you can access attributes $attributes = $type->attributes(); echo $attributes['id'];
I hope this helps.
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar Sebiestor tribe
|
Posted - 2009.08.05 21:35:00 -
[13]
Little update: Version 0.50.1 is up. Now with PostgreSQL cache plugin. Thanks to Luna Harkor.
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar Sebiestor tribe
|
Posted - 2009.08.26 09:47:00 -
[14]
Originally by: Aedrine Hello there,
Thanks for the good work! How do I complitely disable the sql part of the api? I'm happy to handle XML files and would rather do that.
I get:
Quote: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in /blabla/mysql.php on line 41
it's normal as I haven't set it up, just looking into how not to get that :)
Thx
You can either use File cache
[cache] class= "File" rootdir= "/path/to/cache/directory/ Or you can bypass caching system system completely
[cache] class= "Dummy"
If you want to get raw XML string, aset
parserClass= "string" Here you can find some documentation.
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar Sebiestor tribe
|
Posted - 2009.08.27 18:24:00 -
[15]
Originally by: Dedo 93 Hi.. i've a problem with the library.... this is the error: [http://api.eve-online.com/account/Characters.xml.aspx] Server Response Error::Forbidden i've just downloaded the last version and modified the MySQL's infos in the eveonline.ini and put all the files in /ale
Hmm, looks like PHP cannot connect to http://api.eve-online.com/ for whatever reason - it's getting 403 Forbidden response (Note to myself: make better error descriptions). Honestly, I don't know what could be the problem. Just wild guessing: firewall, you're behind proxy, something wrong with PHP/configuration, temporary glitch...
You could try to switch to fsock connector, if it helps. Set
[request] class= "Fsock" In your .ini file. Sorry, i'm kinda in dark here.
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar Sebiestor tribe
|
Posted - 2009.08.27 23:05:00 -
[16]
Originally by: Luna Harkor Edited by: Luna Harkor on 27/08/2009 21:08:05 Edited by: Luna Harkor on 27/08/2009 21:04:42 Lumy,
I found an issue with the PostgreSQL caching component that was causing periodic issues with insertions, the offending code is in the pgsql.php cache file and is the execute function:
protected function &execute($query) { if (preg_match("/INSERT INTO alecache \(content, cachedUntil/", $query)) { $query = preg_replace('/content, cachedUntil/', 'content, "cachedUntil"', $query); }
$result = pg_query($this->db, $query); if ($result === false) { throw new AleExceptionCache(pg_last_error($this->db), pg_result_status($result)); } return $result; }
is the fixed varient.
This is, by no means, a clean fix, but because of how different PostgreSQL and MySQL deal with column cases, this was the easiest fix that did not require a complete re-write of the query execution engine.
Edit: note, the formatting here is not what I had posted, but eve-o has re-formatted it on my and it wont correct.
Thanks for letting me know. But I won't be adding this to SVN, instead I'll try to properly quote all names. Just to make sure, tables in PostgreSQL can be quoted, right? I assume "mydb"."alecache" is equivalent of MySQL `mydb`.`alecache`.
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar Sebiestor tribe
|
Posted - 2009.11.24 18:50:00 -
[17]
Originally by: Anne Sapyx
Originally by: Lumy Here you can find some documentation.
404 Error û Page Not Found
Oh snap, Sourceforge removed docman. I'll have to redo whole documentation I guess.
Originally by: Seruph I'm interested in helping with Drupal module development based on this library. I've read several posts discussing this but the main one was apparently locked 90 days ago. Is the Drupal integration still under development? If so, how can I help? If not, would I be able to get a hold of the existing code so I can test it out and expand on it?
Dunno about Drupal integration. Definitely not by me. If you want help, you would be welcome. To integrate Ale in Drupal so it could use default Drupal DB connection, you'll need to make new cache plugin. Either implement AleInterfaceCache interface in new class, or try to extend AleCacheAbstractDB. Also, would it be possible to encapsulate whole library as Drupal extension, so people could install it?
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar Sebiestor tribe
|
Posted - 2009.12.14 13:59:00 -
[18]
Originally by: Anne Sapyx Why
Quote: try { $param = array('corporationID' => $this->corpId); $this->xmlCorp = $ale->corp->CorporationSheet($param); return TRUE; } catch (Exception $e) { $this->logSection('[Corps-Detail]', $e->getMessage()); return FALSE; }
returns me
Quote: Api call requires characterID
The library assumes 'corp' and 'char' calls require userID/API key/characterID. To override this you'll have add ALE_AUTH_NONE as 2nd parameter to disable check.
Quote:
$this->xmlCorp = $ale->corp->CorporationSheet($param, ALE_AUTH_NONE);
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar Sebiestor tribe
|
Posted - 2009.12.15 21:57:00 -
[19]
Some news: 1st: 0.50.2 Release fixes several issue with database caches. 2nd: I'll be "moving" documentation to my site: http://code-box.sk/software/ale.html. Give me a little time, k?
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar Sebiestor tribe
|
Posted - 2009.12.23 14:40:00 -
[20]
I've updated links at 1st page.
Joomla! in EVE - IGB compatible CMS. |
|
Lumy
Minmatar Sebiestor tribe
|
Posted - 2010.01.04 22:38:00 -
[21]
Originally by: Iyotaka Hi. I have been working with "early" version, tried the 50.2 and it broke things (which I'll report on later when I have time to figure it out)...
Damn it! :( File a bug report, please.
Originally by: Iyotaka
However, I am trying to figure out how to get some additional output.
onCorpWar: ======================================== from the code below: - excuse the mess, my guesses have failed.
How do I get the single value ->enabled ?
$x = $POSdetails->result->combatSettings->onCorporationWar; //you can use this $array = $x->toArray(); print_r($array); //or this $attribs = $x->attributes(); print_r($attribs);
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar eXceed Inc.
|
Posted - 2010.01.08 23:09:00 -
[22]
Originally by: Miss Zulu How can i force the cachemode? The thing is during dev & test time i dont want to query the eve-online api everytime i hit F5. So i just want to query it once, grab all the data and then use the mysql stored cached xml. How to do that?
I'm doing something like:
require_once 'libs/ale/factory.php'; $ale = AleFactory::getEVEOnline(); $ale->setCredentials(...); $xml = $ale->char->WalletJournal(); var_dump($xml);
Have look at eveonline.ini and fill the required parameters (see help).
[cache] class= "MySQL" host= "localhost" user= "<user name>" password= "<passowrd>" database= "<database name>" table= "<table name>" ;default "alecahce", look for definition in /ale/sql directory maxDataSize= null
If you don't want to create new DB connection, you can pass active connection through config array: $config = array('db' => $db); $ale = AleFactory::getEVEOnline($config);
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar eXceed Inc.
|
Posted - 2010.02.20 18:36:00 -
[23]
Originally by: Von Orca Could anyone provide an example on how to walk through the wallet journal?
This should help: http://code-box.sk/software/ale/documentation/14-calls-with-pagination-example.html
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar eXceed Inc. Tread Alliance
|
Posted - 2010.02.24 01:14:00 -
[24]
New release is here! 0.50.3 Fixed couple of issues from tracker. Also fixed problem with EVE Central LAZst metioned. Sorry it took so long.
Joomla! in EVE - IGB compatible CMS. |
Lumy
Minmatar eXceed Inc.
|
Posted - 2010.03.25 09:10:00 -
[25]
Edited by: Lumy on 25/03/2010 09:15:53
Originally by: Anna Logic
//###################################### $array = $ale->corp->MemberSecurity($params);
foreach ($array->result->member as $members){ $characterID=$members->characterID; $name=$members->name;
foreach ($members->roles as $roles){ $roleID=$roles->roleID; } } //######################################
Don't iterate through <member> node. Parser recognizes it as s single node, not a rowset. So you'll have to use children() method to fetch all kids.
$array = $ale->corp->MemberSecurity($params); foreach ($array->result->children() as $members){ $characterID = $members->characterID; //I don't remember if this actually works, maybe you'll have to use $members->attributes(); $name = $members->name;
foreach ($members->roles as $roles){ $roleID=$roles->roleID; } }
Joomla! in EVE - IGB compatible CMS. |
|
|
|