phpArmory “Use soulstone” 0.3 released

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

  • 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

  • Added: the phpArmoryCache class now has a new optional parameters for its’ constructur. Using $armory = new phpArmoryCache($armory = "http://www.wowarmory.com/", $dataStore = "mysql", $dataConn = "mysql://arthas:frostmourne@localhost/northrend", $dataTable = "frozen_throne"", $updateInterval = 14400) you can now define the MySQL connection settings instead of having to hack the PHP class to enter your settings.
  • 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.

Enjoy the unofficial 0.3 release, and either grab phparmory-03tar.gz or phparmory-03.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.


About this entry