As I mentioned earlier, I based my armory plugin on the excellent phpArmory classes. phpArmory came into being soon after the armory went live and on 4th June 2007 we saw the last release of version 0.2 from the phpArmory project.
If you happen to be curious like I am, you will have very likely noticed that those nice PHP classes have not received much love and maintenance or bug fixing since then. Thus I decided to jump in, tasking myself with streamlining the classes and fixing any bugs I might find in there. Both the base class for grabbing and parsing XML data, and the database / file caching class had bugs and missing features, which I added.
phpArmory.class.php
Below follows the list of changes and additions.
- Added: language support. You now can use the setLanguage ($language) and getLanguage() methods to set and retrieve the language in which you want to query armory data.
- Added: the characterIconURL method now has a matching sister for items, named itemIconURL($itemRef). E.g. if you have the icon name from a character item slot, you can pass that and receive the full URL to the matching icon in JPG format.
- Fixed: the xmlToArray method was not properly checking if a children of the XML object really was an array. Checks added, thus warning message gone.
phpArmoryCache.class.php
Below follows the list of changes and additions.
Added: the phpArmoryCache class now has a new optional parameters for its’ constructur. Using the following example you can now define the MySQL connection settings instead of having to hack the PHP class to enter your settings.
$armory = new phpArmoryCache($armory = "http://www.wowarmory.com/", $dataStore = "mysql", $dataConn = "mysql://arthas:frostmourne@localhost/northrend", $dataTable = "frozen_throne"", $updateInterval = 14400- Fixed: XML caching will now work again.
- Fixed: corrected storing of MySQL results. The cacheSave() method was not properly checking if a XML result already was stored. Now old data will be updated in case it exists instead of giving back a duplicated key error.
Download
Enjoy the unofficial 0.3 release, and either grab phparmory-0.3.0.tar.gz or phparmory-0.3.0.zip. Please note that all PHP files are formatted with Unix line endings, as I am mostly a Linux / Mac geek.
Feel free to leave a comment if you should end up having trouble with the classes.
Update: I have re-uploaded the archives and included the updated phpDoc code documentation.
This is really nice. Finally a long awaited update. Seeing how the original phpArmory project hasn’t shown any updates for a long time I am considering this an “official” release.
I am certainly gonna use this in my guild’s website. Keep up the great work, new features and bugfixes are very welcome.
This is really nice. Seeing how the original phpArmory project hasn’t shown any updates for a long time I am considering this an “official” release.
I am certainly gonna use this in my guild’s website. Keep up the great work, new features and bugfixes are very welcome.
I have downloaded the updated classes and I am having problems using it. When I check the XML data in the cache, it’s not how it’s supposed to look. It’s just a couple random characters, not an entire XML page. I think the armory has changed recently and the code no longer works correctly. I can get the guild roster example code working if I manually enter the correct XML data into my MySQL cache. Any ideas?
Hello there,
I have been messing around with this class but I cant seem to make it work, is it working at this moment?
If you could mail me, would be awsome, to share info alot faster
awesome job mate, exactly what im looking for…
however
im having a bit of trouble (not sure if its a code bug or my server being rubbish). basically im making a crawler to search a guild, then search each person in that guild. i know this is a lot of querys (in my guild’s case 37 members * 18 items (hah, works out as 666, oh the irony xD) however, it kicks a fuss after 5-10 people have been searched.
It just hangs at first, the it returns and error in foreach(). It seems, randomly, it stops getting data from the armoury. Then, anytime after that, when you try to make even the basic of queries, it cant get the data off the armoury. The strange thing is, if you try again in an hour or so, it will start working again…
any ideas? =)
seems its an armoury issue. curl_exec timesout. looks like armoury is block me :/
The WoW armory website will lock clients out that are parsing too many items in short time.
Please check the updated phpArmory class on theGitHub page for phpArmory.
It has been extended with a few parameters to handle armory timeouts and similar issues.