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.
 

Yapeal PHP API library (version 1.0.5)

First post
Author
Louis Vitton
Viziam
Amarr Empire
#41 - 2011-10-05 05:57:48 UTC
Hey guys,

Sorry this could be a long post, i tried connecting to your jabber but i am having massive DNS issues atm from the service provider i have for my internet.

i wish to know if yapeal will help me archive the following;


  • Create a form to input the API information for yapeal to parse and display.
  • i wish to get character info, wallets, character sheets, skill sheets and market orders.


I have never used php to perform these kinda functions and i am noob at using it.

so any help would be great and maybe some example if possible explaining whats happening.

Cheers Louis and sorry if this is to noobish.

Dragonaire
Here there be Dragons
#42 - 2011-10-05 06:28:30 UTC
Only way to learn stuff is to ask questions so not a problem. Yapeal doesn't have any kind of frontend for getting the keys etc into it but does include classes you can use from class/util/*php to add them to it once you collect them. It should have all the APIs you need to get the other stuff you want once that's done. Make sure you read the wiki pages I pointed out a couple post back as they should be helpful to you as well.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Kossaw
Body Count Inc.
Mercenary Coalition
#43 - 2011-10-05 10:10:12 UTC
Found an issue with importing the eveerrorlist. (it worked OK a couple of days ago but broke today - I think CCP added a new error message) I've opened a ticket.

WTB : An image in my signature

Kossaw
Body Count Inc.
Mercenary Coalition
#44 - 2011-10-05 10:14:50 UTC
Louis Vitton wrote:
Hey guys,

  • Create a form to input the API information for yapeal to parse and display. <- No, Yapeal doesn't do this. You have to code it.
  • i wish to get character info, wallets, character sheets, skill sheets and market orders. <- yes, Yapeal does this (quite well actually)



I'm new to Yapeal as well. It's taken a couple of nights to get my head round how it works, but I will give it two thumbs up. Thanks Dragonaire

WTB : An image in my signature

Dragonaire
Here there be Dragons
#45 - 2011-10-05 21:32:20 UTC
Okay decided to push out fixes for issue 86 and hopefully issue 76 as well.

revision 1243

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Dragonaire
Here there be Dragons
#46 - 2011-10-10 17:17:36 UTC  |  Edited by: Dragonaire
Ok Thought I'd update everyone on some changes that I've finished in the last couple days which should make existing users happier and make it easier for people just getting start with Yapeal. They also should help decrease the number of times I get to explain some of the same things over and over again. That my hope anyway but we'll see if it works that way Blink

First let me give a little history. There have been a couple tries at adding things to Yapeal to make it easier to install. There was one that used a series of web pages first which worked and was a great chance for someone that was relative new to PHP to and Yapeal get started on. After a few months they moved on to other projects I also didn't think a web front end installer for a command line tool like Yapeal was a good match but I did see where having some kind of instiller would be helpful so I worked on adding an installer that had both GUI and command line interfaces that worked cross platform on Linux, Windows, Mac, and several other Unix platforms.

No one but me seemed to like it and many long time users continued to install manually or use the web installer even though it wasn't really working correctly any more. The GUI had several problems with it most of which came down to me trying to have it do things it wasn't made to do and trying to do it in the same ways as the web installer had.

During the development of the GUI installer I found a need to write some scripts to let it do some stuff I need so I hack together a few PHP scripts for it to use on the back end. In the mean time the Web installer became totally unusable with the changes that had happened in Yapeal and I didn't have the time to update it and like I said I thought it was bad match anyway. I was also in the middle of a rewrite in the GUI installer at the same time so Yapeal was once again without a working installer.

One reason many of the developers using Yapeal didn't like the GUI installer or even the CLI version of it is they didn't have shell access on their hosting service but they did have crontab service so they could simple install it locally and copy it over and do a few database updates with phpMyAdmin which they also had access to. I suggested to a few of them when they said something about not have either the old web or new GUI installer to use locally to help out that they could use some of the back end scripts from the GUI to do stuff if they wanted and even finally wrote up a quick check list to help them remember the steps.

If this is starting to sound familiar that's because the current process used is basically the same now but I did improve on the instructions a little Blink and started including them with Yapeal. What wasn't improved was the scripts since the plan was to one day go back and do an improved GUI installer.

So now it's been a while and some other projects demanded some attention so for the last 6 months to a year everyone has used the scripts I hack together for the GUI back end. During that time I've had many questions about installing Yapeal etc plus had feedback from developers using it that it would be nice if they didn't have to keep reentering the same information a couple times during updates.

Now pair the above with CAK coming out and I had to switch my attention back to Yapeal again for a while and deciding I could make it smarter and take advantage of some additional information that has been made available. Also during that time PHP 5.3 was released with many improvements and many hosting sites finally dropping the older versions of PHP when the PHP developer team stopped doing updates for them etc. One of the improvements with PHP 5.3 is the Windows CLI gained better support for command line parameter processing including using long versions which all of the other platforms had supported for a long time. So now it's possible to really design CLI scripts in PHP with all the features that have been available to every other shell or command line scripting language for a long time.

So what does all of this long history lesson have to do with this update? I'm glad you asked Blink

I've updated the old hack together scripts used to install Yapeal currently into ones that are much more human friendly and even more intelligent then before. They now have actual parameters instead of just putting the settings needed after them in the right order to make them work. You can actually ask them for help with -h or --help and not just have to figure it out by trial and error from the error you got back if you entered something wrong. At the same time using the parameters has become largely unneeded with the other major change which is they can now use the same information that the rest of Yapeal does from config/yapeal.ini.

So now you can just download/extract Yapeal some where, edit one file, and then run a few simple scripts to setup the database and tables and have it ready to take your API information. Big smile

As always your feedback is welcome both good and bad as can be seen from the above history it's important in determining what improves in Yapeal even if it sometimes seems to take forever Blink Also bug reports are always welcome as well even if the bugs themselves aren't. You can report them here or preferably as an issue on Google Code web site.

Fly safe and continue to camp those stations I'll be inside Big smile

revision 1246

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Dragonaire
Here there be Dragons
#47 - 2011-10-17 21:33:12 UTC
Ok lots of updates and refactoring done on Yapeal in the last couple of days. Most interesting changes in no particular order:

  • Yapeal now looks for and will use two new environmental settings. YAPEAL_BASE and YAPEAL_INI. If they are set they will used in place of the normal defaults.
  • All the unused scripts in install/ have been removed. They were used by the old dead GUI installer and saw no reason to have them around still.
  • The remaining scripts in install/ have been refactored to be much more human friendly.
  • The install/ scripts now will look for their settings from an ini file in addition to the command line and the new environmental settings. They default to using the config/yapeal.ini file so if you've already edited it you shouldn't need to add any parameters to the command line when running them or use the YAPEAL_INI setting.
  • yapeal.php has had most of the same updates as the install/ scripts as well.
  • All the stuff that use to done in inc/common_backend.php has been moved into the other classes or yapeal.php and no longer exists. There is still some more work to do on this but everything works and has been greatly improved.
  • Added new 'status' column to utilAccessMask table. This will be used to track the working status of each API in Yapeal. So now you can see which ones are working fully or not etc.
  • Added a couple of new methods to trunk/class/util/AccessMask.php that will return section API masks or per section lists of APIs. This should satisfy Enhancement request from issue 82.
  • Update the ActiveAPIMasks in utilSection to match all APIs with a status of COMPLETE.


I know there been some other changes like updating INSTALL.txt to reflect changes to the scripts in install/ but I wanted to give some instructions on doing this update since it could cause a few issues without some prep work.


  1. Stop any crontab or scheduled tasks.
  2. Backup your config/yapeal.ini somewhere just in case and it doesn't hurt to do a database backup as well but the changes there are minor over all and only to the utilAccessMask table.
  3. If you are using SVN export or one of the archives you need to clear out everything in install/ directory. A simple rm install/* should do for Linux or CTRL-A, SHIFT-DEL in Windows Explorer while in the directory.
  4. Clear out inc/ once again by doing rm inc/* should do or CTRL-A, SHIFT-DEL in Windows.
  5. Do the same for class/*, pics/*
  6. Download archive / svn up etc to get the latest version and install.
  7. If you backed up configyapeal.ini you can restore it now but it shouldn't have been clobbered by anything from above.
  8. Follow the updated instructions from INSTALL.txt. You should be able to skip steps 4, 5, and 6 but if you have any problems go back over them as well to check stuff. Don't forget to do step 8 as there is a database update.
  9. I like to clear out the old log files in log/ and run ./yapeal.php once manually at this point but it's optional and you can just restart crontab or scheduled task if you like.


You should not notice any changes to how Yapeal works but if you do please let me know.

revision 1250

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Drapko Nitzhonot
Abdera Logistics
#48 - 2011-10-18 00:02:57 UTC
I have just upgrade but I can't get MySQL update to work. I've tested connection and it's ok:
Quote:
yapeal has the needed privileges on the yapeal database

When I try to update tables (./createMySQLTables.php -s localhost -u myyapealuser -p myyapealpass --database=myyapealdb):
Quote:
Failed to execute schema for util
Failed to execute schema for util
There were problems during processing please check any error messages from above and correct.
Dragonaire
Here there be Dragons
#49 - 2011-10-18 05:20:43 UTC
Try putting all your settings into the config/yapeal.ini file and not using any parameters on the command line. Just from looking at the above messages you ran the first command and it checked out 'yapeal' database but then you try to install to a different one in the second command of 'myyapealdb' database. You need to be testing and installing to the same one.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Drapko Nitzhonot
Abdera Logistics
#50 - 2011-10-18 10:08:59 UTC  |  Edited by: Drapko Nitzhonot
Sorry for confusing you about names, I've changed them to post in forum.
I'm using Yapeal for over one month, so my yapeal.ini is working.

Quote:
./testForMySQLDatabasePrivs.php && ./createMySQLTables.php
yapeal has the needed privileges on the yapeal database.
Failed to execute schema for util
Failed to execute schema for util
There were problems during processing please check any error messages from above and correct.


I enabled mysql logging but I didn't see any error in queries. I have the log if you want to see it.

I've manually imported new utilAccessMask and utilCachedInterval into my "old" yapeal database and now it works ok.

Quote:
./testForMySQLDatabasePrivs.php && ./createMySQLTables.php
yapeal has the needed privileges on the yapeal database.
All database tables have been installed or updated as needed.
Dragonaire
Here there be Dragons
#51 - 2011-10-18 14:40:49 UTC
Just a guess for some reason MySQL has problems doing the TRUNCATE followed by the INSERT on those two tables. It seems to do it at random but more likely when you have something that is accessing the database at the same time as it's trying to update it. I've seen it when I've forgot to turn off crontab during testing myself but had it happen other times when I wasn't sure what caused it. Remember you can always run the cache/ADOdb/util.sql that createMySQLTables.php makes yourself which I think is what you've done. Usually when you do that it'll let you know which line is giving you problems.

Quote:
I enabled mysql logging but I didn't see any error in queries. I have the log if you want to see it
Sure It's worth a look just to see if I notice anything that might help track down why it does it. Send it to the project owner of Yapeal on GoogleCode which is a GMail account and I'll take a look through it.

Sounds like you finally got it to work for you just make sure utilAccessMask table has new 'status' column with data in it and you should be good.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Drapko Nitzhonot
Abdera Logistics
#52 - 2011-10-18 14:54:26 UTC  |  Edited by: Drapko Nitzhonot
I disabled my crontab line (although I've set it up every 2h), so I think nothing should be access to my Yapeal DB.
I didn't know about cache/ADOdb/util.sql, so I installed new Yapeal in another directory and DB and just export and import ^^;

MySQL log sent.

Yes, it's working now and I have "status" column :)

Thank you for this great tool!
Dragonaire
Here there be Dragons
#53 - 2011-10-24 08:31:37 UTC
So I've been playing around with Mercurial while trying to help out on some stuff in EMK and kind of liked it. I can see where it might better match my work flow on Yapeal. Just thought I'd get some feedback from everyone to see what they think about changing from Subversion to Mercurial instead? I've also looked at Git in the past but never really liked it and found it harder to work with so I was surprised when I found working Hg very easy.
Anyway like to hear get some feedback about switching.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Duffs McCurta
Forward Operating Bastards
#54 - 2011-10-26 13:05:40 UTC  |  Edited by: Duffs McCurta
Thanks for a great tool Dragonaire fits my requirements exactly!
I installed yapeal ver1249 yesterday.

I run yapeal.php and get the error:
Warning: getopt(): No support for long options in this build in /etc/yapeal/inc/parseCommandLineOptions.php on line 82

Presumably this is because im running slightly old version of php5-cli. (Just runnnig this by you in case it causes problems - I dont think it should)

Anyway I added a new (Full CAK) API to the utilRegisteredKey table and a character row to the utilRegisteredCharacter table.

When I run yapeal.php (This is presumably the script i should add to cron) - it does not pull all the available APIs associated with that key.

It *did* populate the following tables however: accountAPIKeyInfo,accountAccountStatus, accountCharacters, accountKeyBridge
utilXmlCache, serverServerStatus.
So it seems to have downloaded and saved certain information to the database.

How do i add other API feeds to the database such as AssetList etc. etc. Shouldn't it just pull all apis permitted by the access mask for each api key.
Can't seem to find this anywhere, can you show an example?

Also I can't seem to see any logs? My ini is set to log_level=E_ALL and has the standard log files defined.

I dont really want to use PHP - I just want the API results cached in a mysql - so thank you for this
-duffs
Zaepho
Goosewarms
Tactical Hunters and Gatherers
#55 - 2011-10-26 16:24:00 UTC
check yapeal_utilSections to make sure all the appropriate sections are enabled.
Duffs McCurta
Forward Operating Bastards
#56 - 2011-10-26 21:23:48 UTC  |  Edited by: Duffs McCurta
thanks dude - checking now

edit - yup that was it!
Sorry for wasting time and thanks again.
Sable Blitzmann
24th Imperial Crusade
Amarr Empire
#57 - 2011-10-26 22:01:25 UTC
Thanks for this project, but I get this error:

]$ php -f yapeal.php
[2011-10-26 21:59:56.678]
Uncaught exception in yapeal.php
[2011-10-26 21:59:56.679]
EXCEPTION: The APIs: ServerStatus.php, ServerStatus.php are unknown in section server
Code: 4
File: /home/ryan/www/dev/projects/apinew/yapeal/class/util/AccessMask.php(162)
Trace:
#0 /home/ryan/www/dev/projects/apinew/yapeal/class/ASection.php(100): AccessMask->apisToMask(Array, 'server')
#1 /home/ryan/www/dev/projects/apinew/yapeal/class/SectionServer.php(63): ASection->__construct()
#2 /home/ryan/www/dev/projects/apinew/yapeal/yapeal.php(172): SectionServer->__construct()
#3 {main}
--------- END TRACE ----------


I only have server section enabled, but if I enable the account, I get similar errors
Dragonaire
Here there be Dragons
#58 - 2011-10-27 04:57:48 UTC
@Sable Blitzmann - Make sure you backup your config/yapeal.ini and then clear the directory where you are installing Yapeal too. The most common cause of that error is ending up with multiple copies of a file in different places when they are moved around in Yapeal. I try not to do that very often because of the issues it can cause but had to do so in one of the recent versions. Also make sure you run the database update as well. You can find out more about what needs to be cleared in the CHANGELOG.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Sable Blitzmann
24th Imperial Crusade
Amarr Empire
#59 - 2011-10-27 07:02:25 UTC
Dragonaire wrote:
@Sable Blitzmann - Make sure you backup your config/yapeal.ini and then clear the directory where you are installing Yapeal too. The most common cause of that error is ending up with multiple copies of a file in different places when they are moved around in Yapeal. I try not to do that very often because of the issues it can cause but had to do so in one of the recent versions. Also make sure you run the database update as well. You can find out more about what needs to be cleared in the CHANGELOG.


Impossible. This is from a completely clean install, new config, new database, new everything. I've also removed the entire directory and downloaded again via SVN trunk multiple times... Not sure what can cause this...
Dragonaire
Here there be Dragons
#60 - 2011-10-27 16:30:26 UTC
Did you export from either your local working copy or directly from the SVN because it looks like it's finding the same API twice which the only other time I've seen that is when someone was trying to use their working copy directly without export.

Now that you have a working copy you can export from it to where you plan on

running Yapeal.

svn export --force /path/to/my/wc/ /directory/where/yapeal/should/be/installed/

Let me know if that doesn't clear it up. I'm testing some other changes right now that should help with this problem as well. Once I'm sure there aren't any problems with the changes I'm looking at I'll let everyone know and have to update some of the docs to reflect the changes.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.