<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Marenkay.com &#187; PHP4</title>
	<atom:link href="http://www.marenkay.com/tag/php4/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marenkay.com</link>
	<description>developer, father, gamer, and nerd.</description>
	<lastBuildDate>Thu, 03 Jun 2010 10:19:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Porting legacy PHP apps: Rewrite, refactor, refine</title>
		<link>http://www.marenkay.com/featured/porting-legacy-php-apps-rewrite-refactor-refine/</link>
		<comments>http://www.marenkay.com/featured/porting-legacy-php-apps-rewrite-refactor-refine/#comments</comments>
		<pubDate>Mon, 04 May 2009 08:30:30 +0000</pubDate>
		<dc:creator>Daniel S. Reichenbach</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[PHP4]]></category>
		<category><![CDATA[PHP5]]></category>
		<category><![CDATA[Porting]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.marenkay.com/?p=284</guid>
		<description><![CDATA[This is the second article in the eight-part series &#8220;Porting legacy PHP apps&#8221;. In this session we will explore available options for breathing new life into our legacy application. Fasten your seat belts as we continue our journey after the jump. In the last article we have discovered that our application is at a dead [...]]]></description>
			<content:encoded><![CDATA[<p>This is the second article in the eight-part series &#8220;Porting legacy PHP apps&#8221;. In this session we will explore available options for breathing new life into our legacy application. Fasten your seat belts as we continue our journey after the jump.</p>

<p><span id="more-284"></span></p>

<p>In the last article we have discovered that our application is at a dead end: PHP 4 has <a href="http://www.php.net/archive/2008.php#2008-01-03-1">officially been declared dead</a>, we are facing an increasing number of issues with running our application and our code is cluttered. Maintaining &#8211; and probably extending &#8211; our application is becoming a task that wastes resources and decreases our teams&#8217; motivation to continue this piece of software.</p>

<p>Now we are facing a simple question: <strong>what are we supposed to do to keep our application running and our customer(s) happy?</strong></p>

<h2>Rewriting our application</h2>

<p>If you have been facing the above issues for a while it may seem appealing to start from scratch and rewrite your application. A fresh start, based upon current approaches, throwing away everything we have. There even is the chance to redefine the application specification.</p>

<p>While this may sound good from a developers&#8217; point of view (don&#8217;t developers love challenges), it does not smell good from a business point of view.</p>

<ul>
<li><strong>Rewrites are expensive</strong>: the teams&#8217; resources will be bound to rebuilding everything from zero, and this <em>is</em> expensive. Man-hours are not cheap these days, and it will be hardly possible to convince the boss(es) to invest more money compared to the current maintenance costs of your application.</li>
<li><strong>Rewrites are a waste of investments</strong>: if your application ran for a few years, there is a huge investment involved. Consider a team of three or four developers and a designer in charge for maintaining an application. It is quite an impressive number of man-hours invested, and the Euros or Dollars (or whatever you are paid in) are not earned easy. After all, throwing investments into the thrash is no Good Thing.</li>
<li><strong>Rewrites ignore existing achievements</strong>: over the years the code in your application will have matured, as you very likely faced most issues that could raise during the application lifetime. This is of value, and should not be left behind. After all it <em>is</em> knowledge you gained.</li>
</ul>

<h2>Refactoring your application</h2>

<p>Refacto-what? <a href="http://en.wikipedia.org/wiki/Code_refactoring">Code refactoring</a> describes the process of &#8220;cleaning up&#8221; your applications&#8217; code. By refactoring we refer to modifying our existing code without touching the functionality or any defined <a href="http://en.wikipedia.org/wiki/API">API</a>.</p>

<p>Refactoring an application comes with a few requirements for your teams&#8217; knowledge:</p>

<ul>
<li>refactoring usually is tied to test-driven development. This means for every functionality you refactor, there will have to be a test defined and executed in order to verify the functionality of the refactored code. It has to deliver identical results, even though coded with a different approach.</li>
<li>refactoring forces you to revisit all skeletons in the closet. All the pieces of code giving you goose bumps will make a return in your teams&#8217; code editor of choice.</li>
<li>refactoring code and authoring test cases is different. If your team is used to procedural development, test-driven development may scare your team. Probably they read about unit testing in Java, C++, C#, etc. but unit testing in PHP?</li>
</ul>

<h2>Refining your application</h2>

<p>Porting is the most lightweight process to refine your applications. While rewriting and refactoring will include lot of code changes, porting only comes with a few changes.</p>

<p>If your application has been developed with PHP 4 and MySQL 4, you might make the jump and switch to PHP 5 and MySQL 5. Both versions only require minor changes to your code, and the manuals of both applications contain hints:</p>

<ul>
<li>Migrating from PHP 4 to PHP 5: <a href="http://www.php.net/manual/en/migration5.php">the PHP 4 to 5 migration</a> will only require a few code changes. It is recommended to work through the list of backward incompatible changes first.</li>
<li>Upgrading MySQL to MySQL 5: <a href="http://dev.mysql.com/doc/refman/5.0/en/upgrading-from-4-1.html">upgrading from 4.x to 5.x</a> mostly consists of updates for table storage engines, and might require a change of engines, and rebuilding indexes.</li>
</ul>

<p>Making the changes listed in the manual will require low effort, and can keep your application running for a few more years but it will not give you any benefits if you do not use new features introduced in PHP 5 and MySQL 5.</p>

<h1>Summary</h1>

<p>As we have seen there are a few options and the difference in effort and cost is huge. Before you decide on an option you will have to evaluate carefully what works best for you. Which option you chose will be different for every application, as no application will evolve equal to another.</p>

<p>In part three of our series we will develop a project plan for breathing new life into your legacy app.</p>

<p>Stay tuned for upcoming articles in <a href="http://www.marenkay.com/features/porting-legacy-php-apps-the-series/">&#8220;Porting legacy PHP apps ~ The Series</a>.</p>

<p>Comments and feedback is more than welcome, of course.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marenkay.com/featured/porting-legacy-php-apps-rewrite-refactor-refine/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Porting legacy PHP apps: Spotting legacy apps</title>
		<link>http://www.marenkay.com/featured/porting-legacy-php-apps-spotting-legacy-apps/</link>
		<comments>http://www.marenkay.com/featured/porting-legacy-php-apps-spotting-legacy-apps/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 15:37:48 +0000</pubDate>
		<dc:creator>Daniel S. Reichenbach</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[PHP4]]></category>
		<category><![CDATA[PHP5]]></category>
		<category><![CDATA[Porting]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.marenkay.com/?p=267</guid>
		<description><![CDATA[This is the first article in the eight-part series &#8220;Porting legacy PHP apps&#8221;. Throughout the duration of this series we will be speaking about PHP functions and language features, a little bit about XHTML and CSS, and also about client-side scripting. As you read through the series, you might see code that could be written [...]]]></description>
			<content:encoded><![CDATA[<p>This is the first article in the eight-part series &#8220;Porting legacy PHP apps&#8221;. Throughout the duration of this series we will be speaking about PHP functions and language features, a little bit about XHTML and CSS, and also about client-side scripting.</p>

<p><span id="more-267"></span></p>

<p>As you read through the series, you might see code that could be written differently or improved. At least I do expect you to do so and comment on the articles to refine what I wrote or just tell me that I suck. After all this is intended to help commercial PHP developers, and there are a lot of us out there who would all benefit from this.</p>

<h2>What actually is that thing you name &#8220;legacy app&#8221;?</h2>

<p>Speaking of &#8220;legacy applications&#8221; or &#8220;legacy code&#8221; as some might say, there comes <a href="http://en.wikipedia.org/wiki/Legacy_code">Wikipedia</a> to the rescue with a broad definition of what we can consider to be a legacy in terms of code:</p>

<blockquote>
  <p>Legacy code is source code that relates to a no-longer supported or manufactured operating system or other computer technology. The term can also mean code inserted into modern software for the purpose of maintaining an older or previously supported feature.</p>
</blockquote>

<p>Simply said, PHP is such a computer technology, and PHP scripts are source code after all, even though some may have considered PHP to be no <em>real</em> development language for commercial applications.</p>

<p>If you&#8217;re developing PHP application for a few years now, chances are good that you will have quite a few legacy applications in your companies portfolio and even a few that are still running on servers for your clients. As an example I have picked a PHP application developed for a commercial project which is dated back to mid-2000 when most of the PHP installations still were running a 3.x version of PHP and only a few early adopters made the switch to PHP4. The application is still running on a PHP 4.3.2 installation.</p>

<h2>What about your projects?</h2>

<p>If you are developing PHP applications for companies which sell services to consumers, chances are good that your application is still running. This is our first checkpoint for a legacy application.</p>

<h3>What is the lifetime of your application?</h3>

<p>Considering that PHP 4 was released in 2000, any PHP application older than five years can safely be stamped as <em>legacy code</em>. PHP 4.3.0 was released in December 2002, and it marked a point where the 4.x branch of PHP started to replace PHP3 installations in larger numbers.</p>

<h3>How large is your application?</h3>

<p>If you are using a Linux or Apple server, you can find out how many lines of code your application has pretty quickly. Open a console and enter</p>

<pre><code>wc -l `find . -name *.php4 -print`
</code></pre>

<p>Of course, adapt the line for the file extension you used. In my case we had to use <code>.php4</code> as <code>.php</code> still was pointing to an old PHP 3 installation. In my case this resulted in <em>312374</em> lines of code for an application that handles a few GB of user data, and ~300K users per month.</p>

<p>Now if I compare this with an application &#8211; written half a year ago &#8211; that comes with stuff like unit testing, UTF8 support, full i18n localization, separation of code and views and run the above command line again, I end up with whopping <em>116229</em> lines of code. This application does leverage what PHP 5 has to offer and leaves behind functions and language features from PHP 4 which have a replacement with a different approach in PHP 5.</p>

<p>They say, size does not matter. I say: <em>size matters</em>. It&#8217;s a combination of technique and size that wins the deal. After all size should be a sign for maintainability. Even if your code is well written, the larger the code, the larger the number of maintenance tasks will become as the years pass by.</p>

<h3>Do you see an increasing number of issue reports?</h3>

<p>As application get older, you may start to see strange errors happening, and the number of issue reports for errors that are hard or even impossible to track will rise. PHP has gone through quite an evolution since PHP 4 was released and with PHP 5 the number of errors may grow silently.</p>

<h3>Is your application documented?</h3>

<p>If your application is four or five years old, it is very unlikely that you will have documented your code in a style that will be helpful today. Documentation tools like <a href="http://www.phpdoc.org/">phpDoc</a> were not broadly used and while there may have been a specification for your application, commented code will be rather rare.</p>

<p>Missing documentation or aged documentation may be an issue, especially when you are tasked with updating the application.</p>

<h3>Does your application make use of libraries / frameworks?</h3>

<p>Most likely not. <a href="http://pear.php.net">PEAR</a> was not very popular back then, and for most applications there was no defined set of libraries used. From my own backlog it seems like the focus was more on which PHP extensions were used than what libraries one may use. E.g. extensions like GD and Freetype for dynamic image creation have been on the list.</p>

<p>This also may be a reason for large line counts for such an application. Code had to be written in multiple places even though it was identical. Personally the only &#8220;framework&#8221; I have seen in use back then was <a href="http://www.smarty.net/">Smarty</a> for templates.</p>

<h3>Does you application have style?</h3>

<p>Even in larger teams with source code control as part of the work-flow style guides for authoring PHP code have been a rare thing on the task list. It is very likely that the team was working on one large application, where each developer was assigned to a specific part of the application, e.g. one handled templates and views, the other one handled database usage, another one was assigned to the administration system.</p>

<p>While this may result in code styles being adapted and used, chances are good that there will be one code style for each part of the application. If you add team changes to this, code styles will start to turn into something that lacks style aka. <a href="http://en.wikipedia.org/wiki/Spagetti_code">spaghetti code</a>.</p>

<h3>Does your application separate code from views?</h3>

<p>In the early days of PHP 4 application used to mix code to implement functions with code to display output. While this may seem strange from todays&#8217; perspective it was perfectly fine back then. PHP development was mostly done in procedural fashion, and thus application logic and user interfaces were not isolated.</p>

<p>Today PHP and especially PHP 5 are used more in classical fashion of software engineering, applying architectural patterns like <a href="http://en.wikipedia.org/wiki/Model-view-controller">Model-View-Controller</a> to PHP projects.</p>

<h3>Deprecation and your application</h3>

<p>Within five years of time a lot of progress and evolution happens in Free Software, and PHP was no exception. Language features have changed, new features have been added, experimental PHP extensions turned into mainline extensions which are available by default. On top of that you will see a lot of PHP functions which are considered to be security risks, and have been replaced with safer functions in PHP 5.</p>

<p>If you are using PHP 5, there is a chapter available in the PHP manual which describes potential issues when <a href="http://www.php.net/manual/en/migration5.php">migrating from PHP 4</a>.</p>

<h2>Last but not least</h2>

<p>By now you should have an idea what the signs are to spot a legacy PHP application, and with by looking at your application&#8217;s code you should know if it is legacy or not.</p>

<p>In part two of our series we will continue with exploring available options for breathing new life into your legacy app.</p>

<p>Stay tuned for upcoming articles in <a href="http://www.marenkay.com/features/porting-legacy-php-apps-the-series/">&#8220;Porting legacy PHP apps ~ The Series</a>.</p>

<p>Comments and feedback is more than welcome, of course.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marenkay.com/featured/porting-legacy-php-apps-spotting-legacy-apps/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Porting legacy PHP apps ~ The Series</title>
		<link>http://www.marenkay.com/featured/porting-legacy-php-apps-the-series/</link>
		<comments>http://www.marenkay.com/featured/porting-legacy-php-apps-the-series/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 14:21:01 +0000</pubDate>
		<dc:creator>Daniel S. Reichenbach</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[PHP4]]></category>
		<category><![CDATA[PHP5]]></category>
		<category><![CDATA[Porting]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.marenkay.com/?p=258</guid>
		<description><![CDATA[While I have been blogging for a few years now with varying spare time, this is the first time that I feel the need to publish an article series. Introducing &#8220;Porting legacy PHP apps&#8221;, an eight part series of how-to&#8217;s, rules and recommendations, and a few bits and pieces of good advice to be published [...]]]></description>
			<content:encoded><![CDATA[<p>While I have been blogging for a few years now with varying spare time, this is the first time that I feel the need to publish an article series.</p>

<p>Introducing &#8220;Porting legacy PHP apps&#8221;, an eight part series of how-to&#8217;s, rules and recommendations, and a few bits and pieces of good advice to be published in the next weeks, with the first part of the series debuting this week. The term &#8220;legacy&#8221; in the title refers to code developed for PHP when PHP version 3 was common on most servers, and PHP4 was right around the corner, mostly used by &#8220;early adopters&#8221;. Wikipedia of course offers a definition of <a href="http://en.wikipedia.org/wiki/Legacy_code">legacy code</a> for us to read, and you will probably discover a few of those common criteria in this series.</p>

<p><span id="more-258"></span></p>

<p>Here is what you can expect to see:</p>

<ul>
<li><a href="http://www.marenkay.com/features/porting-legacy-php-apps-spotting-legacy-apps/">Part One: Spotting legacy apps</a>.
The first part of the series will briefly discuss what a legacy PHP application actually is, and how you can run a quick check on your own applications to see if they qualify for being &#8220;dinosaurs&#8221;.</li>
<li><a href="http://www.marenkay.com/features/porting-legacy-php-apps-rewrite-refactor-refine/">Part Two: Rewrite, refactor, refine</a>.
Since we identified what apps are considered legacy apps, it is time to consider the available options. What&#8217;s worth the effort, and what not? </li>
<li><strong>Part Three: How to move your app forward.</strong>
Now that we know more about the available options for making changes to our beloved app, we can take a close look at the type of code which needs to be updated.</li>
<li><strong>Part Four: It&#8217;s all in the process.</strong>
Making changes to your app should not be done without a plan. Part four will supply the tools and tasks for you to make your plan.</li>
<li><strong>Part Five: The foundation.</strong>
With PHP5 and future versions you do have the unique option to apply common development methods to your workflow. Test-driven, agile development is not restricted to Ruby and Ruby on Rails, it&#8217;s an option for PHP5, too. We&#8217;ll explore available options, both available frameworks, and building your own framework.</li>
<li><strong>Part Six: Breathing new life into the beast.</strong>
This is all about <a href="http://gettingreal.37signals.com/">Getting Real</a>. By now you should have a plan, and the tools to start refreshing you app, and we&#8217;ll make the initial steps together.</li>
<li><strong>Part Seven: Are you prepared?</strong>
Now that our app has made its&#8217; steps into the future, we will take a look at the tasks we will face, once PHP5 leaves the stage, and makes room for PHP6. of course, assuming your customers still love your refreshed app.</li>
<li><strong>Part Eight: Final thoughts.</strong>
This is it. The last part of the series will feature a few recommendations and probably wise words by me featuring insights gathered during my own endeavors with legacy PHP apps.</li>
</ul>

<p>Code examples of legacy code and new code will be supplied with each part, and some will probably be taken from a few legacy apps that I currently work on as part of my contracted work.</p>

<p>See you back in a couple of days for part one of our series.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marenkay.com/featured/porting-legacy-php-apps-the-series/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>phpArmory 0.3.2 &#8211; &#8220;Giddyup!&#8221; released</title>
		<link>http://www.marenkay.com/tipsresources/programming/phparmory-032-giddyup-released/</link>
		<comments>http://www.marenkay.com/tipsresources/programming/phparmory-032-giddyup-released/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 09:55:01 +0000</pubDate>
		<dc:creator>Daniel S. Reichenbach</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[PHP4]]></category>
		<category><![CDATA[phpArmory]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Release]]></category>

		<guid isPermaLink="false">http://www.marenkay.com/?p=34</guid>
		<description><![CDATA[It has been a few months since my last updated release of phpArmory, and now a final release of the 0.3.x branch is available. phpArmory 0.3.2 &#8211; &#8220;Giddyup!&#8221; (named after the currently running event Brewfest ) is out and silently introduces bug fixes to make things run smooth. There has been a 0.3.1 release which [...]]]></description>
			<content:encoded><![CDATA[<p>It has been a few months since my last updated release of phpArmory, and now a final release of the 0.3.x branch is available. phpArmory 0.3.2 &#8211; &#8220;Giddyup!&#8221; (named after the currently running event <a href="http://www.wowwiki.com/Brewfest">Brewfest</a> ) is out and silently introduces bug fixes to make things run smooth.</p>

<p><span id="more-34"></span></p>

<p>There has been a 0.3.1 release which never made it into the open, due to a last minute issue discovered during testing. The Changelog has all the details on what was changed in 0.3.1 and 0.3.2, and why it changed.</p>

<h2>0.3.2 &#8211; Oct 02, 2008</h2>

<h3>Bugs squashed</h3>

<ul>
<li><em>phpArmory.class.php</em>: Class will not be instantiated if the Curl or XML extension is missing from your PHP installation.</li>
<li><em>examples/character.php</em>: Updated to use setArea. Properly dumps character data as XML. Please note that characterFetch() will now return the armory patchlevel, too.</li>
<li><em>examples/guildroster.php</em>: Updated to use setArea. Properly dumps the full guild roster as plain table.</li>
</ul>

<h2>0.3.1 &#8211; Sep 28, 2008</h2>

<h3>Features added</h3>

<ul>
<li>Patchlevel detection*: <code>getCurrentPatchlevel()</code> will return the current patch version for the armory region you use.</li>
<li>Talent definitions: <code>TalentDefinitionFetch()</code> will retrieve talent definition for all classes from the World of Warcraft website.</li>
<li>WoW armory lockout prevention: with previous phpArmory versions, it could happen that your applications would be temporarily locked out from the armory. To prevent this, you can now limit the number of retries for XML pulling. To do this inherit your own classes by specifying the `$retries&#8217; parameter with the number of retries to perform.</li>
</ul>

<h3>Features changed</h3>

<ul>
<li>*Armory region and locales: this has been simplified, to only supply a setArea function to define which armory region we use.</li>
</ul>

<h3>Download</h3>

<p>Enjoy the 0.3.2 release, and either grab <a href="http://www.marenkay.com/wp-content/uploads/2008/10/phparmory-032.zip">phparmory-0.3.2.zip</a> or <a href="http://www.marenkay.com/wp-content/uploads/2008/10/phparmory-032tar.gz">phparmory-0.3.2.tar.gz</a>. Please note that all PHP files are formatted with Unix line endings, as I am mostly a Linux / Mac geek.</p>

<p>Feel free to leave a comment if you should end up having trouble with the classes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marenkay.com/tipsresources/programming/phparmory-032-giddyup-released/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>phpArmory 0.3.0 &#8211; &#8220;Use soulstone&#8221; released</title>
		<link>http://www.marenkay.com/tipsresources/programming/phparmory-030-use-soulstone-released/</link>
		<comments>http://www.marenkay.com/tipsresources/programming/phparmory-030-use-soulstone-released/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 14:03:55 +0000</pubDate>
		<dc:creator>Daniel S. Reichenbach</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[PHP4]]></category>
		<category><![CDATA[phpArmory]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Release]]></category>

		<guid isPermaLink="false">http://www.marenkay.com/?p=42</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>As I mentioned <a href="http://www.marenkay.com/tipsresources/programming/wow-armory-plugin-progress/">earlier</a>, 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 <a href="http://sourceforge.net/projects/phparmory/">phpArmory</a> project.</p>

<p><span id="more-42"></span></p>

<p>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.</p>

<h2>phpArmory.class.php</h2>

<p>Below follows the list of changes and additions.</p>

<ul>
<li><em>Added</em>: 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.</li>
<li><em>Added</em>: 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.</li>
<li><em>Fixed</em>: the xmlToArray method was not properly checking if a children of the XML object really was an array. Checks added, thus warning message gone.</li>
</ul>

<h2>phpArmoryCache.class.php</h2>

<p>Below follows the list of changes and additions.</p>

<ul>
<li><p><em>Added</em>: the phpArmoryCache class now has a new optional parameters for its&#8217; 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.</p>

<pre><code class="php">$armory = new phpArmoryCache($armory = "http://www.wowarmory.com/", $dataStore = "mysql", $dataConn = "mysql://arthas:frostmourne@localhost/northrend", $dataTable = "frozen_throne"", $updateInterval = 14400
</code></pre></li>
<li><em>Fixed</em>: XML caching will now work again.</li>
<li><em>Fixed</em>: 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.</li>
</ul>

<h3>Download</h3>

<p>Enjoy the unofficial 0.3 release, and either grab <a href="http://www.marenkay.com/wp-content/uploads/2008/10/phparmory-03tar.gz">phparmory-0.3.0.tar.gz</a> or <a href="http://www.marenkay.com/wp-content/uploads/2008/10/phparmory-03.zip">phparmory-0.3.0.zip</a>. Please note that all PHP files are formatted with Unix line endings, as I am mostly a Linux / Mac geek.</p>

<p>Feel free to leave a comment if you should end up having trouble with the classes.</p>

<p><strong>Update</strong>: I have re-uploaded the archives and included the updated <a href="http://www.marenkay.com/wp-content/plugins/wow-armory/phparmory/doc/">phpDoc code documentation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marenkay.com/tipsresources/programming/phparmory-030-use-soulstone-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
