<?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>A Path Less Taken</title>
	<atom:link href="http://www.legendrefamily.org/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.legendrefamily.org/blog</link>
	<description>Breaking with convention in a very conventional fashion.</description>
	<lastBuildDate>Wed, 21 Jul 2010 22:51:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Unit Testing FTW</title>
		<link>http://www.legendrefamily.org/blog/2010/07/unit-testing-ftw/</link>
		<comments>http://www.legendrefamily.org/blog/2010/07/unit-testing-ftw/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 22:51:26 +0000</pubDate>
		<dc:creator>JJ</dc:creator>
				<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpunit]]></category>

		<guid isPermaLink="false">http://www.legendrefamily.org/blog/?p=1313</guid>
		<description><![CDATA[I was recently working on a generic container class in PHP that implemented allowed, required and group behaviors related to assigned properties. While coding the class I built a test class using PHPUnit that had 7 tests and 33 assertions. After using the class on a limited basis I determined that the internal implementation left [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently working on a generic container class in PHP that implemented allowed, required and group behaviors related to assigned properties.  While coding the class I built a test class using PHPUnit that had 7 tests and 33 assertions.  After using the class on a limited basis I determined that the internal implementation left something to be desired.  Unswayed I dug in and re-implemented the bulk of the internal methods without changing much of the interface of the class.  I ran the unit test again and found that only 8 of the assertions related to the modified behavior needed to be updated.  After I changed those assertions the class passed all the tests.</p>
<p>I know that many you are asking &#8220;what&#8217;s the big deal about that?&#8221;  The big deal to me is that I&#8217;m often reluctant to write tests because I&#8217;m a hobbyist developer and I&#8217;m always anxious to get straight to the code.  I guess you could say that this simple experience has changed my point of view.  It is very powerful to be able to change a class as fundamentally as I did and still be able to validate that it behaves as desired with such ease.  The benefit of all the upfront work in building unit tests was clear to see in this case.</p>
<p>If you have a similar experience or just a point of view one way or another on unit testing please post a comment below and share it with me.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.legendrefamily.org/blog/2010/07/unit-testing-ftw/&amp;title=Unit+Testing+FTW" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.legendrefamily.org/blog/2010/07/unit-testing-ftw/&amp;title=Unit+Testing+FTW" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.legendrefamily.org/blog/2010/07/unit-testing-ftw/&amp;title=Unit+Testing+FTW&amp;desc=I%20was%20recently%20working%20on%20a%20generic%20container%20class%20in%20PHP%20that%20implemented%20allowed%2C%20required%20and%20group%20behaviors%20related%20to%20assigned%20properties.%20%20While%20coding%20the%20class%20I%20built%20a%20test%20class%20using%20PHPUnit%20that%20had%207%20tests%20and%2033%20assertions.%20%20After%20using%20the%20class%20on%20a%20limited%20basis%20I%20determined%20that" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.legendrefamily.org/blog/2010/07/unit-testing-ftw/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.legendrefamily.org/blog/2010/07/unit-testing-ftw/&amp;bm_description=Unit+Testing+FTW&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.legendrefamily.org/blog/2010/07/unit-testing-ftw/&amp;title=Unit+Testing+FTW" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.legendrefamily.org/blog/2010/07/unit-testing-ftw/&amp;title=Unit+Testing+FTW" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.legendrefamily.org/blog/2010/07/unit-testing-ftw/&amp;title=Unit+Testing+FTW" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.legendrefamily.org/blog/2010/07/unit-testing-ftw/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Unit+Testing+FTW+-+http://b2l.me/abqekh&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.legendrefamily.org/blog/2010/07/unit-testing-ftw/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing PHPUnit with Kohana 3</title>
		<link>http://www.legendrefamily.org/blog/2010/07/installing-phpunit-with-kohana-3/</link>
		<comments>http://www.legendrefamily.org/blog/2010/07/installing-phpunit-with-kohana-3/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 04:17:54 +0000</pubDate>
		<dc:creator>JJ</dc:creator>
				<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[kohana]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php framework]]></category>
		<category><![CDATA[phpunit]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://www.legendrefamily.org/blog/?p=1290</guid>
		<description><![CDATA[Before you post a comment that says something like &#8220;there&#8217;s a Kohana 3 module that does that&#8221; let me just say I know and I&#8217;m grateful for it. Some of what I did was inspired by that module. The issue was when I tried getting the Kohana 3 unittest module to work to test my [...]]]></description>
			<content:encoded><![CDATA[<p>Before you post a comment that says something like &#8220;there&#8217;s a Kohana 3 module that does that&#8221; let me just say I know and I&#8217;m grateful for it.  Some of what I did was inspired by that module. The issue was when I tried getting the Kohana 3 <a href="http://github.com/kohana/unittest" title="kohana / unittest">unittest</a> module to work to test my module it was giving me problems.  I read the Kohana forum posts and the unittest documentation and could not find an answer.  Finally I decided to start at the beginning and set up PHPUnit manually to work with Kohana 3 and my module to debug what I was doing wrong with unittest.  In the process I discovered that getting PHPUnit to work with Kohana 3 wasn&#8217;t that hard after all.  I thought I would share my solution in the event you are having similar issues.</p>
<p><span id="more-1290"></span></p>
<p>The system requirements for me were the following:</p>
<ul>
<li>LightTPD HTTP Server</li>
<li>PHP 5.3.2</li>
<li>Kohana 3.0.6</li>
<li>PHPUnit 3.4</li>
</ul>
<p>First I set up my Kohana 3 app normally which included the module that I wanted to test.  I edited the default controller and created a class instance of an object from my module to verify there were no syntax errors.  When that worked as expected I removed the new code from the default controller restoring it to it&#8217;s previous state.</p>
<p>Next I downloaded a copy of <a href="http://www.phpunit.de/" title="PHPUnit">PHPUnit</a> from <a href="http://pear.phpunit.de/get/">here</a>.  I chose to manually install PHPUnit rather than use the PEAR installer so I could learn more about how it worked.  I opened the .tgz and .tar files and copied everything inside the PHPUnit-3.4.9 folder into my php\pear folder.  Then I moved the phpunit.php and phpunit.bat files into the top level folder of my Kohana 3 module (as in myapp/modules/mymodule).  We have to edit both of these files.</p>
<p>With the files in place I opened phpunit.bat in my editor.  There are only two lines that execute at the bottom of the file.  I commented out the first line and changed the second on by replacing the @php_bin@ inside of each string with the following:</p>
<ol>
<li>Replace the first @php_bin@ with the explicit path and file name of the command line PHP executable (in my case something like c:\php\php.exe).</li>
<li>Replace the second @php_bin@ with the path to the phpunit file (our phpunit.php file in the same directory as this file that we will rename next to just phpunit).</li>
</ol>
<p>I then saved the changes and closed the file.
</p>
<p>Next I renamed the phpunit.php file to just phpunit with no file extension.  Then I edited the file and made the following changes:</p>
<ol>
<li>Insert the following line below the Copyright notice (thanks to unittest&#8217;s author for this idea):

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SUPRESS_REQUEST'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'SUPRESS_REQUEST'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
<li>Insert the following line after the if block that includes a call to set_include_path:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">set_include_path</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'.;c:\php\pear;c:\lighttpd\htdocs\aa\modules\mymodule\tests'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>The first path statement is to the php\pear directory where PHPUnit is found and the second is to the tests folder (you need to create this folder) where the unit tests for my module will be created.  I created mine in the root directory of my module.</li>
</ol>
<p>After making those changes I saved and closed this file.
</p>
<p>Next I edited the bootstrap.php file found at myapp\application\bootstrap.php.  I modified the last statement as follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span> <span style="color: #990000;">defined</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SUPRESS_REQUEST'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #009933; font-style: italic;">/**
	 * Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO'].
	 * If no source is specified, the URI will be automatically detected.
	 */</span>
	<span style="color: #b1b100;">echo</span> Request<span style="color: #339933;">::</span><span style="color: #004000;">instance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #339933;">-&gt;</span><span style="color: #004000;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #339933;">-&gt;</span><span style="color: #004000;">send_headers</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>This is part of what I copied from unittest.  It allows PHPUnit to bootstrap the Kohana framework using index.php which in turn calls bootstrap.php without actually taking the final step which is sending the response back to the browser with this statement.  When I was finished with this I saved and closed the file.  I also went back to the browser and confirmed that the site was still functioning normally.</p>
<p>All that was left was to write a unit test and try it out.  I followed the guidelines found <a href="http://www.phpunit.de/manual/current/en/writing-tests-for-phpunit.html">here</a> for writing a unit test.  Then I saved the test file, opened a command window, navigated to the root directory of my module and ran the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="batch" style="font-family:monospace;">phpunit --bootstrap=c:\lighttpd\htdocs\myapp\index.php MyTestFileName</pre></div></div>

<p>PHPUnit ran, bootstrapped Kohana 3, executed my test and returned the result.
</p>
<p>That was all there was to it.  I&#8217;m not willing to suggest that I&#8217;ve solved all the issues.  I did not deal with any database connections nor did I try to test the behavior of any response code, but I still think this was a pretty simple way to get PHPUnit unit tests enabled for a Kohana 3 module.  If you wanted to do this for the application I think you just move the tests folder to under the application folder (myapp\application\tests) and update all the other steps to reflect that location.  If you are also having problems getting your Kohana 3 and PHPUnit unit tests to work and want to learn more about PHPUnit then give this approach a try.  If you have any questions leave a comment and I&#8217;ll be happy to help if I can.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.legendrefamily.org/blog/2010/07/installing-phpunit-with-kohana-3/&amp;title=Installing+PHPUnit+with+Kohana+3" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.legendrefamily.org/blog/2010/07/installing-phpunit-with-kohana-3/&amp;title=Installing+PHPUnit+with+Kohana+3" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.legendrefamily.org/blog/2010/07/installing-phpunit-with-kohana-3/&amp;title=Installing+PHPUnit+with+Kohana+3&amp;desc=Before%20you%20post%20a%20comment%20that%20says%20something%20like%20%22there%27s%20a%20Kohana%203%20module%20that%20does%20that%22%20let%20me%20just%20say%20I%20know%20and%20I%27m%20grateful%20for%20it.%20%20Some%20of%20what%20I%20did%20was%20inspired%20by%20that%20module.%20The%20issue%20was%20when%20I%20tried%20getting%20the%20Kohana%203%20unittest%20module%20to%20work%20to%20test%20my%20module%20it%20was%20giving%20me%20pr" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.legendrefamily.org/blog/2010/07/installing-phpunit-with-kohana-3/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.legendrefamily.org/blog/2010/07/installing-phpunit-with-kohana-3/&amp;bm_description=Installing+PHPUnit+with+Kohana+3&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.legendrefamily.org/blog/2010/07/installing-phpunit-with-kohana-3/&amp;title=Installing+PHPUnit+with+Kohana+3" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.legendrefamily.org/blog/2010/07/installing-phpunit-with-kohana-3/&amp;title=Installing+PHPUnit+with+Kohana+3" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.legendrefamily.org/blog/2010/07/installing-phpunit-with-kohana-3/&amp;title=Installing+PHPUnit+with+Kohana+3" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.legendrefamily.org/blog/2010/07/installing-phpunit-with-kohana-3/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Installing+PHPUnit+with+Kohana+3+-+http://b2l.me/aaaka9&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.legendrefamily.org/blog/2010/07/installing-phpunit-with-kohana-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Harmful Addictions</title>
		<link>http://www.legendrefamily.org/blog/2010/07/harmful-addictions/</link>
		<comments>http://www.legendrefamily.org/blog/2010/07/harmful-addictions/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 03:08:37 +0000</pubDate>
		<dc:creator>JJ</dc:creator>
				<category><![CDATA[General Rants]]></category>
		<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://www.legendrefamily.org/blog/?p=1278</guid>
		<description><![CDATA[A few days back I watched a video of a presentation by Fred Wilson titled Fred Wilson on 10 Ways to Be Your Own Boss. In the video Fred shared the following quote from Nassim N Taleb: The three most harmful addictions are heroin, carbohydrates, and a monthly salary I&#8217;m willing to add video games [...]]]></description>
			<content:encoded><![CDATA[<p>A few days back I watched a video of a presentation by Fred Wilson titled <a href="http://carsonified.com/blog/business/fred-wilson-on-10-ways-to-be-your-own-boss/" title="Fred Wilson on 10 Ways to Be Your Own Boss">Fred Wilson on 10 Ways to Be Your Own Boss</a>.  In the video Fred shared the following quote from Nassim N Taleb:</p>
<blockquote><p>
The three most harmful addictions are heroin, carbohydrates, and a monthly salary
</p></blockquote>
<p>I&#8217;m willing to add video games to the list. None the less the last item caught my attention as intended.  I want to say that I&#8217;ve heard it before, but seeing it in this context was still thought provoking.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.legendrefamily.org/blog/2010/07/harmful-addictions/&amp;title=Harmful+Addictions" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.legendrefamily.org/blog/2010/07/harmful-addictions/&amp;title=Harmful+Addictions" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.legendrefamily.org/blog/2010/07/harmful-addictions/&amp;title=Harmful+Addictions&amp;desc=A%20few%20days%20back%20I%20watched%20a%20video%20of%20a%20presentation%20by%20Fred%20Wilson%20titled%20Fred%20Wilson%20on%2010%20Ways%20to%20Be%20Your%20Own%20Boss.%20%20In%20the%20video%20Fred%20shared%20the%20following%20quote%20from%20Nassim%20N%20Taleb%3A%0D%0A%0D%0AThe%20three%20most%20harmful%20addictions%20are%20heroin%2C%20carbohydrates%2C%20and%20a%20monthly%20salary%0D%0A%0D%0AI%27m%20willing%20to%20add%20video%20ga" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.legendrefamily.org/blog/2010/07/harmful-addictions/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.legendrefamily.org/blog/2010/07/harmful-addictions/&amp;bm_description=Harmful+Addictions&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.legendrefamily.org/blog/2010/07/harmful-addictions/&amp;title=Harmful+Addictions" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.legendrefamily.org/blog/2010/07/harmful-addictions/&amp;title=Harmful+Addictions" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.legendrefamily.org/blog/2010/07/harmful-addictions/&amp;title=Harmful+Addictions" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.legendrefamily.org/blog/2010/07/harmful-addictions/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Harmful+Addictions+-+http://b2l.me/9256p&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.legendrefamily.org/blog/2010/07/harmful-addictions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stack Exchange Web Applications</title>
		<link>http://www.legendrefamily.org/blog/2010/07/stack-exchange-web-applications/</link>
		<comments>http://www.legendrefamily.org/blog/2010/07/stack-exchange-web-applications/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 03:14:28 +0000</pubDate>
		<dc:creator>JJ</dc:creator>
				<category><![CDATA[General Rants]]></category>
		<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://www.legendrefamily.org/blog/?p=1273</guid>
		<description><![CDATA[You may have noticed that the Stack Overflow guys are listed among my blogs of interest. This is because they are interesting bloggers. Get it? Anyway, it looks like their new project Stack Exchange has a new member site and the first to go through what they call their Area-51 community site-creation process. The new [...]]]></description>
			<content:encoded><![CDATA[<p>You may have noticed that the <a href="http://stackoverflow.com/" title="Stack Overflow">Stack Overflow</a> guys are listed among my blogs of interest.  This is because they are interesting bloggers.  Get it?  Anyway, it looks like their new project Stack Exchange has a new member site and the first to go through what they call their Area-51 community site-creation process.  The new site is <a href="http://webapps.stackexchange.com/" title="Web Applications">Web Applications</a> and it seems to be a discussion of all geeky stuff web.  I kinda like it.  Anyway, have a look and see what you think.  I found <a href="http://cliqset.com/" title="Cliqset">Cliqset</a> just browsing around.  I&#8217;m not sure I need another social networking tool (I don&#8217;t use the one I have, ugh), but it is a darn spiffy looking site.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.legendrefamily.org/blog/2010/07/stack-exchange-web-applications/&amp;title=Stack+Exchange+Web+Applications" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.legendrefamily.org/blog/2010/07/stack-exchange-web-applications/&amp;title=Stack+Exchange+Web+Applications" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.legendrefamily.org/blog/2010/07/stack-exchange-web-applications/&amp;title=Stack+Exchange+Web+Applications&amp;desc=You%20may%20have%20noticed%20that%20the%20Stack%20Overflow%20guys%20are%20listed%20among%20my%20blogs%20of%20interest.%20%20This%20is%20because%20they%20are%20interesting%20bloggers.%20%20Get%20it%3F%20%20Anyway%2C%20it%20looks%20like%20their%20new%20project%20Stack%20Exchange%20has%20a%20new%20member%20site%20and%20the%20first%20to%20go%20through%20what%20they%20call%20their%20Area-51%20community%20site-crea" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.legendrefamily.org/blog/2010/07/stack-exchange-web-applications/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.legendrefamily.org/blog/2010/07/stack-exchange-web-applications/&amp;bm_description=Stack+Exchange+Web+Applications&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.legendrefamily.org/blog/2010/07/stack-exchange-web-applications/&amp;title=Stack+Exchange+Web+Applications" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.legendrefamily.org/blog/2010/07/stack-exchange-web-applications/&amp;title=Stack+Exchange+Web+Applications" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.legendrefamily.org/blog/2010/07/stack-exchange-web-applications/&amp;title=Stack+Exchange+Web+Applications" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.legendrefamily.org/blog/2010/07/stack-exchange-web-applications/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Stack+Exchange+Web+Applications+-+http://b2l.me/9k9pd&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.legendrefamily.org/blog/2010/07/stack-exchange-web-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving WordPress, Windows 7, PHP 5.3</title>
		<link>http://www.legendrefamily.org/blog/2010/07/moving-wordpress-windows-7-php-5-3/</link>
		<comments>http://www.legendrefamily.org/blog/2010/07/moving-wordpress-windows-7-php-5-3/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 16:40:52 +0000</pubDate>
		<dc:creator>JJ</dc:creator>
				<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.legendrefamily.org/blog/?p=1259</guid>
		<description><![CDATA[I was moving WordPress from Windows Vista and PHP 5.2 to Windows 7 and PHP 5.3 when I encountered what appeared to be a page timeout resulted in Apache HTTP Server rendering a blank page back to the browser. Initial Google sessions did not help, so I dove into the code. After some digging I [...]]]></description>
			<content:encoded><![CDATA[<p>I was moving WordPress from Windows Vista and PHP 5.2 to Windows 7 and PHP 5.3 when I encountered what appeared to be a page timeout resulted in Apache HTTP Server rendering a blank page back to the browser.  Initial Google sessions did not help, so I dove into the code.  After some digging I found the timeout was happening in the wpdb class, the constructor method when it was making the following call:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>520
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbh</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$dbhost</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dbuser</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dbpassword</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><span id="more-1259"></span></p>
<p>For those of you not familiar with the @ symbol&#8217;s use in PHP let&#8217;s just say that in simple terms it prevents error messages from being displayed.  I assume this is here to prevent UID and PWD from leaking out, but it also prevented me from knowing that the problem was with my MySQL connection until I traced this statement down.  Annoying.</p>
<p>Armed with this knowledge I was able to do some more intelligent searching.  First I looked up the <a href="http://php.net/manual/en/function.mysql-connect.php" title="mysql_connect">mysql_connect</a> function.  Down in the comments there was a very helpful comment by Bruce Kirkpatrick that explained what was causing the issue.  The new behavior of mysql_connect was relying on my hosts file to resolve localhost on Windows 7.  This was based on the change not from Windows Vista to Windows 7, but on the change of PHP 5.2 to PHP 5.3.</p>
<p>So I opened my trusty text editor as administrator, navigated to where the hosts files should be and nothing was there.  Even the etc directory was missing.  I checked out the Wikipedia article on the <a href="http://en.wikipedia.org/wiki/Hosts_(file)" title="Hosts (file)">Hosts (file)</a> and discovered that users of Windows 64 bit OS&#8217;s (other than Windows 7) could not access the hosts file with a 32 bit editor.  Since my editor is 32 bit, I could navigate as far as c:\windows\system32\drivers\ and then I could not see the hosts file.  So what I did was type in etc\hosts in the file open dialog box and it opened as expected.  I then uncommented the following line by removing the # symbol at the start of the line.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="hosts" style="font-family:monospace;">	127.0.0.1       localhost</pre></td></tr></table></div>

<p>I saved my changes and tested my blog site again using localhost and it worked perfectly.  It worked so well that the post you are reading was the first that I penned on my blog&#8217;s new server.  If you run into a similar problem I hope that this post can save you some time.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.legendrefamily.org/blog/2010/07/moving-wordpress-windows-7-php-5-3/&amp;title=Moving+WordPress%2C+Windows+7%2C+PHP+5.3" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.legendrefamily.org/blog/2010/07/moving-wordpress-windows-7-php-5-3/&amp;title=Moving+WordPress%2C+Windows+7%2C+PHP+5.3" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.legendrefamily.org/blog/2010/07/moving-wordpress-windows-7-php-5-3/&amp;title=Moving+WordPress%2C+Windows+7%2C+PHP+5.3&amp;desc=I%20was%20moving%20WordPress%20from%20Windows%20Vista%20and%20PHP%205.2%20to%20Windows%207%20and%20PHP%205.3%20when%20I%20encountered%20what%20appeared%20to%20be%20a%20page%20timeout%20resulted%20in%20Apache%20HTTP%20Server%20rendering%20a%20blank%20page%20back%20to%20the%20browser.%20%20Initial%20Google%20sessions%20did%20not%20help%2C%20so%20I%20dove%20into%20the%20code.%20%20After%20some%20digging%20I%20found%20" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.legendrefamily.org/blog/2010/07/moving-wordpress-windows-7-php-5-3/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.legendrefamily.org/blog/2010/07/moving-wordpress-windows-7-php-5-3/&amp;bm_description=Moving+WordPress%2C+Windows+7%2C+PHP+5.3&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.legendrefamily.org/blog/2010/07/moving-wordpress-windows-7-php-5-3/&amp;title=Moving+WordPress%2C+Windows+7%2C+PHP+5.3" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.legendrefamily.org/blog/2010/07/moving-wordpress-windows-7-php-5-3/&amp;title=Moving+WordPress%2C+Windows+7%2C+PHP+5.3" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.legendrefamily.org/blog/2010/07/moving-wordpress-windows-7-php-5-3/&amp;title=Moving+WordPress%2C+Windows+7%2C+PHP+5.3" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.legendrefamily.org/blog/2010/07/moving-wordpress-windows-7-php-5-3/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Moving+WordPress%2C+Windows+7%2C+PHP+5.3+-+http://b2l.me/8tv77&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.legendrefamily.org/blog/2010/07/moving-wordpress-windows-7-php-5-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
