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.
123Next pageLast page
 

Yapeal PHP API library (2.0)

Author
Dragonaire
Here there be Dragons
#1 - 2014-07-24 22:21:20 UTC  |  Edited by: Dragonaire
Yet Another Php Eve Api Library also know as Yapeal which can be used to access the Eve Online API data and place it into a database.

Welcome to the new Yapeal forum thread.Big smile

I decided with all the changes that have been happening with Yapeal it was time to start a new one since 99% of the old one was of no use to anyone interest in the current version of Yapeal. The old version lasted over 5 years with all the updates to it but it's time to let it go and start looking to the future now.

You can find the old thread here. All 26 pages of it. The last couple pages might be useful to you for this version but I expect all the info you might have found there to end up here soon again as well.

Here's some links that everybody should find useful:

HOME PAGE:
https://github.com/Dragonrun1/yapeal
ISSUES:
https://github.com/Dragonrun1/yapeal/issues
README:
https://github.com/Dragonrun1/yapeal/blob/master/README.md
WIKI:
https://github.com/Dragonrun1/yapeal/wiki Outdated!

It's now recommended that everyone uses Composer to install Yapeal. You'll now find Yapeal on Packagist. All developers should look at moving their own project to using Composer as it'll make dependence management oh so much easier.

Long time users will notice the change to 2.0.x version from the older 1.0.x. I decided because of the complete re-write of the code base and some backward compatibility breaks it was time to make the move. Anyone that has been following the 1.1.x-WIP or 1.1.x version should see that the version now in master that replaced to old code came from them. The old version 1.0.5 can still be found in Git but with the changes that were made with Crius many things have broke and it will continue to become less useful going forward as Eve and the Eve APIs continue to change.

I'll add more stuff here in the future as I think of them.

As always thank you for using Yapeal, Dragonaire

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
#2 - 2014-07-24 22:21:46 UTC
Reserved

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

Legedric Striker
State War Academy
Caldari State
#3 - 2014-07-25 03:57:40 UTC  |  Edited by: Legedric Striker
Ok, as I am at my pc again and I tried the new master branch with composer, here is what I get after I run "composer install -o":

Quote:
C:\yapeal-master>composer install -o
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.jso
n. You may be getting outdated dependencies. Run update to update them.
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package php could not be found in any version, there may be a typo in the package name.
Problem 2
- The requested PHP extension ext-xsl * is missing from your system.
Problem 3
- The requested package php could not be found in any version, there may be a typo in the package name.
Problem 4
- Installation request for guzzle/guzzle v3.9.1 -> satisfiable by guzzle/guzzle[v3.9.1].
- guzzle/guzzle v3.9.1 requires php >=5.3.3 -> no matching package found.


Several others follow after this until Problem 37. But they more or less repeat what problem 4 is saysing: A package is being requested, the package needs php 5.3.X and there is no matching package found...

However, I do have PHP 5.4.31 installed on my machine and it is running for several other projects just fine in my IIS webserver, so I don't know why composer refuses to recognize my php installment, although I selected the right PHP folder patch during the composer installation :(

So "Problem 1" is my real issue, the rest are just follow up issues.

EVE-Skillplan.net - Plan your pilot skill training online on PC, Mac, tablet or smartphone!

Dragonaire
Here there be Dragons
#4 - 2014-07-25 04:40:57 UTC
Okay so basically though you might have PHP 5.4 installed for your webserver it doesn't seem to be in your path where composer can find it or it is finding a different version. Try running 'php --version' from cmd prompt and see if it sees the correct version if not you'll need to fix your path. Use 'env' if you are getting a different version and look at your PATH setting in there to see if there's a older version listed before PHP 5.4. You'll need to go in and fix it if it's wrong. You'll need t do web search for how to updated path for your version of Windows because there are some difference how you get to it depending on version used etc.

A neat tool I found for things like this is http://www.rapidee.com/en/about you might want to check it out.

Once you have the path set right so composer can find and use the correct version most if not all of your problems should be solved as you said.

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

Legedric Striker
State War Academy
Caldari State
#5 - 2014-07-25 05:32:50 UTC  |  Edited by: Legedric Striker
Oh boy, of course I forgot to set the PATH variable to the new PHP path... shame on me Roll

However, the Composer part worked but your next step, the CONFIG.md ends quite abrupt in line 94:

Quote:
Let say you have a `config/yapeal.yaml` file that has these settings:

```
Yapeal:
Database:
database: yapeal
password: secret
tablePrefix: ''
userName: YapealUser
...
```

And you have


No more content after this line, so I guess your file got somehow corrupted or you committed an incomplete file Blink

PS: I pulled a fresh zip from your master branch which included the incomplete CONFIG.md file.

EVE-Skillplan.net - Plan your pilot skill training online on PC, Mac, tablet or smartphone!

Legedric Striker
State War Academy
Caldari State
#6 - 2014-07-25 05:58:39 UTC  |  Edited by: Legedric Striker
Ok so I continued on my own and took my "cmd" to the yapeal\bin folder and executed the "yc" command.
First error I encountered was that the system tries to find the config file in "yapeal/bin/config/yapeal.yaml" which isn't there as it is in yapeal/config/.

So I too -c as an argument and added a configuration file manually... still "not accessible" error...

After that I passed the database configuration with single arguments (-u... -p... etc.) and the next error...
Could NOT find SQL file yapeal/bin/bin/sql/CreateDatabase.sql
.... (continued for each .sql file)

So I went into Console\Command\DatabaseInitialized.php and change line 312 from
Quote:
$file = $this->getCwd() . '/bin/sql/Create' . $fileName . '.sql';


to

Quote:
$file = $this->getCwd() . '/sql/Create' . $fileName . '.sql';


To get rid of the double "bin" in there with the result that all my tables are setup properly right now Idea

I will try to figure out the next steps and keep you posted about what trouble I encounter Cool



Edit:
I now ran /bin/yapeal.php and I've got some data in my accountapikeyinfo table, so I guess I did it right and should be able to go from here. Smile

EVE-Skillplan.net - Plan your pilot skill training online on PC, Mac, tablet or smartphone!

Legedric Striker
State War Academy
Caldari State
#7 - 2014-07-25 06:39:59 UTC  |  Edited by: Legedric Striker
Ok as your wiki seems to be outdated (I know, you told me so in your OP) I want to ask some questions:

1. How do I refresh the API data for a single character? So which exact class/function do I call after I included yapeal into my project? I only found the instructions to just start "auto magic", which will updated all active API keys - which may get me some huge performance issues as I am planning to have many characters/accounts within my database.

2. How do I refresh the API data just for a single section? So for example: Only the wallet section of one character and not all API information for this character at once?

Thanks in advance!

EVE-Skillplan.net - Plan your pilot skill training online on PC, Mac, tablet or smartphone!

Dragonaire
Here there be Dragons
#8 - 2014-07-25 16:42:48 UTC
Easiest way to get a good working yapeal.yaml is much like with the older version where you copy over the yapeal-example. * file and make any needed changes to it.

For getting help on any of the 'yc' command just run it without any parameters or options. For the individual commands themselves use 'yc help command'. To understand the new console commands in general look at the docs for the Symfony2 console as that is what's being used to create them.

The reason you were having problems run the 'yc D:I' command is it was made to be run from the root directory so needs to be run from 'yapeal' directory from your example. It does need some work to make it better as it was kind of hacked together in just a day or two but works well within it's limitations. The reason it was adding 'bin' in your case is anytime you give it a relative path it assume you want it to use the current working directory. This is common with many other CLI commands on all platforms. If you look in the bin/yc file you'll see where it gets the CWD and passes it on for the commands to use.

1. How do I refresh the API data for a single character?
First I'll state that Yapeal is made to be run as a crontab or scheduled task EVERY minute to keep everything up to date. If you do run it this way even though no one seems to believe it it'll actually help increase your performance over all by NOT having all the APIs 'come due' so to say at the same time. The idea is you have a database that is always as up to date as the API server allows and you don't need do anything to make that happen in your application.

That being said the new version has been design to allow individual API classes to be called directly. This is mainly meant for things in your application like new account creation where you need something more interactive. It can also be used for cases where you want a single snapshot of the data and don't want to have it changing while looking at it.

To use Yapeal in this mode you'll be using the oneShot() method. This method is the same method that autoMagic() calls to do the actual work of getting the XML and putting it into the DB. I thought about trying to add a quick guide here on how to use oneShot() but it would be to long and the formating on the forums here sucks to put it kindly. I think its better to do this a wiki page so I'll try to put one together that should help everyone find their way on this new feature.

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

Legedric Striker
State War Academy
Caldari State
#9 - 2014-07-25 17:51:20 UTC
Sounds great!

I worked on my project nearly the whole day and I managed to integrate the first parts of Yapeal into it and it's working like a charm Attention

In addition, as I did not know about the oneShot method, I managed to rework parts of my project for being able to run Yapeal the way it is intended to be run: As a fixed cronjob every couple of minutes.

Looks great so far and I will continue working on my project. Although it will still take some weeks at least to be ready I can't wait to launch the project and see how Yapeal will work with lots of users in my database Smile

EVE-Skillplan.net - Plan your pilot skill training online on PC, Mac, tablet or smartphone!

Tiberius Zol
Moira.
#10 - 2014-07-25 22:58:41 UTC
I get it working on a seperate DB now.. so far so good...
My question is: what is to do if i want to upgrade from 1.0 to this version? Is there any table conversion with all my old data?
And which APIs don't work in 2.0. ?

Mr. Tibbers on twitter: @Mr_Tibbers

Mr. Tibbers Blog: www.eve-versum.de

Dragonaire
Here there be Dragons
#11 - 2014-07-26 05:56:43 UTC
Tiberius Zol - If you do a data only export on most of the API tables they should import into the new ones okay. There are several APIs of course like IndustryJobs that have had a lot of changes to them which probably won't work without a lot of work. Also most of the old util Tables have had major changes to them. The only one that really matters there is utilRegisteredKey. If you delete the couple of columns that no longer exist on it you can export and import it as well. There is a outdated bin/sql/Update_1.0.4-1.1.x.sql file you may find some what useful but mostly not.

I can look into making a SQL file that would make the transfer easier but if there's only a couple of people needing to do so it might be just as easy to help them directly with problems and continue working more APIs than spend time on making something that will only be used a couple times.

As to which APIs have been done the best way to know is to look if there is an existing class for it in lib/Database/* directories. If you see a php and xsd file for it it's should be a working API but also have a look at the Database/TODO.md which I just updated.

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

Tiberius Zol
Moira.
#12 - 2014-07-26 18:48:43 UTC
yeah i see.. will wait for some more working APIs (like AssetLists and Standing, ...).
noobquestion: i downloaded your stuff via git.. how can i update it if you do some changes? never worked with git before..

Mr. Tibbers on twitter: @Mr_Tibbers

Mr. Tibbers Blog: www.eve-versum.de

Dragonaire
Here there be Dragons
#13 - 2014-07-26 20:22:43 UTC
git update should work for you.

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

Tiberius Zol
Moira.
#14 - 2014-07-26 22:25:07 UTC
this is...easy.. ^^ i will try it later

Mr. Tibbers on twitter: @Mr_Tibbers

Mr. Tibbers Blog: www.eve-versum.de

Dragonaire
Here there be Dragons
#15 - 2014-07-29 20:39:25 UTC
Hi all so if you been paying attention to master branch you've seen a lot of bug fixing and several APIs added. In some cases APIs had been done on char/corp but not the other and the hole has now been filled.

I now need some input on which APIs people want to see done next so I've decided to try to get some. I'm calling it the 'Vote for your most needed API' campaign. I've added 'enhancement' issues for several of APIs on GitHub and I'd like to have people vote on their top 3 APIs they would like to see done next. I didn't add all of the missing APIs so if you want one that's not list please go ahead and add it since I was guessing at which ones people might want and part of the reason for the campaign is to let me know if I'm right. I plan on looking at the votes in about a week and no that doesn't mean I won't working on some other APIs this week just really need some feedback here.

Another thing that would help speed up getting some of the APIs done would be some helpers. I've had one person helping me a some of the APIs in Stephen but he got busy again in RL it seems so it's back to just me doing everything for now. So I'm looking for people that are interesting in learn more about Yapeal, the APIs, PHP, XML, or XSD to help with some of the APIs. This is also a good chance for people that really need an API done so they can finish their application they are write or hope to write with Yapeal to maybe get it a little sooner. Understand this isn't where I just throw an API at you and expect you to do it all by yourself though that cool if someone wants to try it but where I'm more of a mentor/QA/programmer available to help you as needed to make it work.

I'll also take help with re-doing/starting over on the Wiki or the include docs like CONFIG.md which I started but haven't got back to. Basically any place someone would like to do something just let me know so I can make sure not duping work.

Anyway as always thanks for use Yapeal.

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

Tiberius Zol
Moira.
#16 - 2014-07-31 10:49:00 UTC
For me:
- Char/AssetList
- Char/SkillInTraining
- Corp/AssetList
- Corp/CorporationSheet

I really would help, but my PHP/Mysql knowledge are not more than rudimentary.. only theoretical OOP knowledge. Never used it in PHP.

Mr. Tibbers on twitter: @Mr_Tibbers

Mr. Tibbers Blog: www.eve-versum.de

Legedric Striker
State War Academy
Caldari State
#17 - 2014-07-31 14:30:52 UTC
For me it would be:
- Char/Mailbody
- Char/AssetList

No need for the others ;)

Who needs SkillInTraining when you have the complete skill queue at hand?

EVE-Skillplan.net - Plan your pilot skill training online on PC, Mac, tablet or smartphone!

Kolb
Fancy Fox Enterprises
#18 - 2014-07-31 15:46:43 UTC

I think the CONFIG.md file cut off mid sentence, and I'm not 'getting' how to add api's to the system.

In the old system I made a util.php that included the classes, but I don't see an equivalent in version 2.
Dragonaire
Here there be Dragons
#19 - 2014-07-31 17:02:15 UTC
Yeah I didn't finish writing the CONFIG.md I'll try to get back to it and push it out.

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

Tiberius Zol
Moira.
#20 - 2014-07-31 18:53:30 UTC
Legedric Striker wrote:
For me it would be:

Who needs SkillInTraining when you have the complete skill queue at hand?



yeah right.. shouldn't post after 40h without sleep..

Mr. Tibbers on twitter: @Mr_Tibbers

Mr. Tibbers Blog: www.eve-versum.de

123Next pageLast page