<?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>Code Fury &#187; Kenny Katzgrau</title>
	<atom:link href="http://codefury.net/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://codefury.net</link>
	<description>One programmer's formatted output stream</description>
	<lastBuildDate>Sat, 31 Dec 2011 22:20:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>The Top 10 CodeIgniter Sparks of 2011</title>
		<link>http://codefury.net/2011/12/top-10-codeigniter-sparks-of-2011/</link>
		<comments>http://codefury.net/2011/12/top-10-codeigniter-sparks-of-2011/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 22:15:08 +0000</pubDate>
		<dc:creator>Kenny Katzgrau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://codefury.net/?p=487</guid>
		<description><![CDATA[John Crepezzi and I launched GetSparks.org (the CodeIgniter package manager and repository) a little under a year ago, and the response we received from the community was overwhelmingly positive. The best part of GetSparks isn&#8217;t the site itself. It&#8217;s a moderately simple app that provides a vehicle for quickly dropping other developers&#8217; code in your [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcodefury.net%2F2011%2F12%2Ftop-10-codeigniter-sparks-of-2011%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcodefury.net%2F2011%2F12%2Ftop-10-codeigniter-sparks-of-2011%2F&amp;source=_kennyk_&amp;style=normal&amp;space=12&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://seejohncode.com" target="_blank">John Crepezzi </a>and I launched <a href="http://getsparks.org">GetSparks.org</a> (the CodeIgniter package manager and repository) a little under a year ago, and the response we received from the community was overwhelmingly positive.</p>
<p>The best part of GetSparks isn&#8217;t the site itself. It&#8217;s a moderately simple app that provides a vehicle for quickly dropping other developers&#8217; code in your codebase.</p>
<p>Many of the packages on GetSparks are very well maintained. I am <strong>continually</strong> impressed by the amount of effort spark developers pour into their submissions when I peruse the site and try new packages out. One example would be <a href="http://wanwizard.eu/" target="_blank">WanWizard</a>&#8216;s <a title="DataMapper-ORM" href="http://getsparks.org/packages/DataMapper-ORM/versions/HEAD/show" target="_blank">DataMapper-ORM</a>: Look at how well thought out it is, and <a href="http://datamapper.wanwizard.eu/pages/requirements.html" target="_blank">how detailed the docs are</a>.</p>
<p>Another would be codeigniter-payments. I rolled in to the second day of CICon 2011 NYC to find @<a href="http://www.calvinfroedge.com" target="_blank">calvinfroedge</a> talking about a new payment spark he had made — <a href="http://getsparks.org/packages/codeigniter-payments/versions/HEAD/show" target="_blank">one of the most in-depth, flexible payment libs</a> I&#8217;ve ever seen.</p>
<p>GetSparks has almost clocked 50,000 package downloads at this point, but there are handful of sparks that have really stood out in terms of popularity. They are the year&#8217;s top 10:</p>
<table>
<tbody>
<tr>
<td>name</td>
<td>contributor</td>
<td>installs</td>
</tr>
<tr>
<td><a href="http://getsparks.org/packages/php-activerecord/versions/HEAD/show">php-activerecord</a></td>
<td>machuga</td>
<td>1806</td>
</tr>
<tr>
<td><a href="http://getsparks.org/packages/curl/versions/HEAD/show">curl</a></td>
<td>philsturgeon</td>
<td>1361</td>
</tr>
<tr>
<td><a href="http://getsparks.org/packages/template/versions/HEAD/show">template</a></td>
<td>philsturgeon</td>
<td>1010</td>
</tr>
<tr>
<td><a href="http://getsparks.org/packages/ion_auth/versions/HEAD/show">ion_auth</a></td>
<td>benedmunds</td>
<td>990</td>
</tr>
<tr>
<td><a href="http://getsparks.org/packages/restclient/versions/HEAD/show">restclient</a></td>
<td>philsturgeon</td>
<td>931</td>
</tr>
<tr>
<td><a href="http://getsparks.org/packages/DataMapper-ORM/versions/HEAD/show">DataMapper-ORM</a></td>
<td>WanWizard</td>
<td>748</td>
</tr>
<tr>
<td><a href="http://getsparks.org/packages/gravatar_helper/versions/HEAD/show">gravatar_helper</a></td>
<td>seejohnrun</td>
<td>688</td>
</tr>
<tr>
<td><a href="http://getsparks.org/packages/assets/versions/HEAD/show">assets</a></td>
<td>bstrahija</td>
<td>636</td>
</tr>
<tr>
<td><a href="http://getsparks.org/packages/fire_log/versions/HEAD/show">fire_log</a></td>
<td>dperrymorrow</td>
<td>623</td>
</tr>
<tr>
<td><a href="http://getsparks.org/packages/markdown/versions/HEAD/show">markdown</a></td>
<td>katzgrau</td>
<td>622</td>
</tr>
</tbody>
</table>
<p>And of course, there are people whose contributions have made GetSparks.org the success it is. A special thanks goes out to:</p>
<ul>
<li>Beau Frusetta — First team member (retired), and the guy who made GetSparks look halfway decent</li>
<li>Mike Pauley — Team member</li>
<li>Sean Downey — Team member</li>
<li>Joe Auty — Team member</li>
<li>Jake Ingman — Who made us a sweet logo</li>
<li>Joel Cox — For some fine features and great sparks</li>
<li>Balsamiq — Who donated a copy of their mockup software</li>
<li>Spicer Matthews of CloudManic, who contributed the &#8220;forking&#8221; feature (which I have big plans for)</li>
</ul>
<p>Happy New Year everyone. Keep up the awesome work, and keep knocking out those timeshanks when developing a new app with new sparks (things like payments, emailing, auth, assets, etc).</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://codefury.net/2011/12/top-10-codeigniter-sparks-of-2011/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Your Awesome Hack That Nobody Ever Heard Of</title>
		<link>http://codefury.net/2011/10/your-awesome-hack-that-nobody-ever-heard-of/</link>
		<comments>http://codefury.net/2011/10/your-awesome-hack-that-nobody-ever-heard-of/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 16:15:28 +0000</pubDate>
		<dc:creator>Kenny Katzgrau</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://codefury.net/?p=454</guid>
		<description><![CDATA[Something that has always come naturally to me (I&#8217;m not saying it&#8217;s something I&#8217;m great at) is promotion of my projects. When I wrote chip a couple months ago, I wanted to spread the word and evangelize it. I presented it at Hack and Tell in NYC, made a screencast, and pretty much inundated my [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcodefury.net%2F2011%2F10%2Fyour-awesome-hack-that-nobody-ever-heard-of%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcodefury.net%2F2011%2F10%2Fyour-awesome-hack-that-nobody-ever-heard-of%2F&amp;source=_kennyk_&amp;style=normal&amp;space=12&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Something that has always come naturally to me (I&#8217;m not saying it&#8217;s something I&#8217;m great at) is promotion of my projects. When I wrote <a href="http://github.com/katzgrau/chip">chip</a> a couple months ago, I wanted to spread the word and evangelize it. I presented it at Hack and Tell in NYC, made a screencast, and pretty much inundated my co-workers at Yahoo! with tips and tricks on how to use it. I submitted it to Linux Journal, and now I&#8217;ll apply to couple sys-admin confs to present the next version.</p>
<p><a href="http://codefury.net/wp-content/uploads/2011/09/chip-lj.png"><img src="http://codefury.net/wp-content/uploads/2011/09/chip-lj.png" alt="" title="chip-lj" width="530" height="360" class="aligncenter size-full wp-image-470" /></a></p>
<p>Y! folks: `yinst install chip` <img src='http://codefury.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I did all that because I was excited about it and I wanted everyone who had ever had the same problems that chip solves to use it. Isn&#8217;t that why a lot of us make our projects open source — because other people might find it useful?</p>
<p>I think there are a few different reasons developers might open-source their projects, but I think it ultimately whittles down to this: You&#8217;ve solved some problem or made something easier, and you never want to see anyone without a solution (<strong>your</strong> solution in-particular) again.</p>
<p>But a lot of developers stop short of promotion. They hack something together that <em>they know</em> other people would find useful, release a few versions, and leave the project in the wilderness of github for someone else to stumble upon. That might — but probably never will — actually happen.</p>
<p>In a lot of ways you can find the exact same thing among startups. A couple developers get together with a great idea and a whole lot of initial excitement. They feverishly build whatever the hell it it is and put out an initial version. Then when they realize the software <em>does not</em> in-fact sell itself, the project begins its slow decline into obscurity and float away in the river of bad excuses.</p>
<p>Has this ever happened to you? Did you hack something that&#8217;s awesome and <em>should</em> be used by everyone, but no one has ever heard of it? Did you try and start a company, build an entire product, and start to lose interest in it when the time for marketing and promotion came around?</p>
<p>Following through on projects is one of the hardest things to do, but you owe it to yourself. I&#8217;m guilty of stumbling on this too. But remember: You didn&#8217;t spent 4 months of your life on 3 hours of sleep so you could look back and say &#8220;Yea, I should have followed through on that, but I &#8230;&#8221;</p>
<p><strong>The point: If you can&#8217;t close on a project, you can&#8217;t close shit. You are shit. Hit the bricks pal, and beat it.</strong></p>
<p>If you get the reference, it&#8217;s from a great movie named <a href="http://www.imdb.com/title/tt0104348/">Glengarry Glenn Ross</a>. A <a href="http://seejohncode.com">good friend of mine</a> turned me on to it. The relevance? It&#8217;s time to sell. To investors, to customers, to anyone who will listen. Get off your ass and go do it.</p>
<p><iframe width="500" height="375" src="http://www.youtube.com/embed/y-AXTx4PcKI" frameborder="0" allowfullscreen></iframe></p>
<p>The success of you and your app depends on your ability to work hard and follow through. Gary Vaynerchuck refers to it as &#8220;<a href="http://www.businessweek.com/smallbiz/content/sep2009/sb20090918_719216.htm">The Hustle</a>.&#8221; It&#8217;s how great products, projects, and brands are built.</p>
<p>So yea. Let me end on a quote. This is difficult, because I hate inspirational quotes — but Method Man and Biggie tell it like it is: &#8220;<a href="http://www.youtube.com/watch?v=y89axte5Wjs&#038;feature=related">Everything ya get you gotta work hard for it.</a>&#8220;</p>
]]></content:encoded>
			<wfw:commentRss>http://codefury.net/2011/10/your-awesome-hack-that-nobody-ever-heard-of/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GetSparks.org Beta Released, Big Changes</title>
		<link>http://codefury.net/2011/05/getsparks-org-beta-released-big-changes/</link>
		<comments>http://codefury.net/2011/05/getsparks-org-beta-released-big-changes/#comments</comments>
		<pubDate>Fri, 06 May 2011 13:00:30 +0000</pubDate>
		<dc:creator>Kenny Katzgrau</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[packages]]></category>
		<category><![CDATA[respository]]></category>
		<category><![CDATA[sparks]]></category>

		<guid isPermaLink="false">http://codefury.net/?p=442</guid>
		<description><![CDATA[Note: CodeIgniter Reactor 2.0.2 has a bug in it&#8217;s core Loader class that breaks package config file loading (and sparks, sadly). It&#8217;s recommended that you use 2.0.1 OR the latest at https://bitbucket.org/ellislab/codeigniter-reactor OR make the following change in your 2.0.2 installation: https://bitbucket.org/ellislab/codeigniter-reactor/changeset/c461483c8ca0 . The last option is the best. It took a month longer than [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcodefury.net%2F2011%2F05%2Fgetsparks-org-beta-released-big-changes%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcodefury.net%2F2011%2F05%2Fgetsparks-org-beta-released-big-changes%2F&amp;source=_kennyk_&amp;style=normal&amp;space=12&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>Note:</strong> <em>CodeIgniter Reactor 2.0.2 has a bug in it&#8217;s core Loader class that breaks package config file loading (and sparks, sadly). It&#8217;s recommended that you use 2.0.1 <strong>OR</strong> the latest at <a href="https://bitbucket.org/ellislab/codeigniter-reactor">https://bitbucket.org/ellislab/codeigniter-reactor</a> <strong>OR</strong> make the following change in your 2.0.2 installation: <a href="https://bitbucket.org/ellislab/codeigniter-reactor/changeset/c461483c8ca0">https://bitbucket.org/ellislab/codeigniter-reactor/changeset/c461483c8ca0</a> . The last option is the best.</em></p>
<p>It took a month longer than expected, but we&#8217;ve finally released the Beta version of <a href="http://getsparks.org">GetSparks.org</a>, the <a href="http://codefury.net/2011/03/introducing-codeigniter-sparks/">repository and package manager system for CodeIgniter</a>.</p>
<p>Here&#8217;s the very minimum of what you need to know:</p>
<ol>
<li>A spark.info file is now required in every spark</li>
<li>You should upgrade your spark system as soon as possible (just follow the usual installation instructions)</li>
<li>If you submitted a spark prior to the beta, we&#8217;ve normalized all version numbers to x.x.x. So curl 1.0 becomes curl 1.0.0. Check the site.</li>
</ol>
<p>The alpha was all about weeding out fundamental issues in the initial repo and system. The big problems we had were:</p>
<ul>
<li>Some spark developers wanted the ability to specify dependencies</li>
<li>There was no difference between a repository tag and the spark version — They had to be in sync</li>
<li>Users wanted RSS feeds for latest spark overall, and latest versions of individual sparks</li>
<li>There was no way to rate a spark</li>
<li>There was no way to tell if your spark was going to be accepted by the spark processor prior to submission</li>
</ul>
<p>We knocked those out and a little more with the beta. Going forward:</p>
<p>All sparks must have a spark.info file at the root. <a href="http://getsparks.org/spec-format">Details are here.</a></p>
<ul>
<li> You can now specify spark dependencies in spark.info</li>
<li> The spark manager will now install a spark and all of its dependencies</li>
<li> The spark manager can now self-update</li>
<li> All spark versions must be in x.x.x format. Sparks released prior to the beta had their version numbers change in the system (tags remained the same though)</li>
<li>Versions and tags are now decoupled. The version is pulled from spark.info</li>
<li>Sparks are now ratable via a simple &#8220;Love&#8221;, &#8220;Like&#8221;, or &#8220;Hate&#8221; rating</li>
<li><a href="http://getsparks.org/packages/spark-sdk/versions/HEAD/show">A Spark-SDK is available</a> to spark developers in order to validate their sparks prior to submission</li>
</ul>
<p><strong>It is necessary that you upgrade your spark manager with the release.</strong> The current version is 0.0.4. You can upgrade by removing the &#8216;tools&#8217; folder from your webroot and following the same installation instructions at: <a href="http://getsparks.org/install">http://getsparks.org/install</a></p>
<p>Send any issues to <a href="mailto:ohcrap@getsparks.org">ohcrap@getsparks.org</a>!</p>
<p>Now that the structural changes have been made, we can focus on tightening up the spark system&#8217;s feature set. This is what you see in the coming weeks:</p>
<ul>
<li>The ability to install sparks in configurations where the application folder is not in your webroot (possible now, but not automated)</li>
<li>The ability for sparks to act more like modules — ie, sparks will be able to override core libraries and more</li>
</ul>
<p>Also, we plan to:</p>
<ul>
<li>Put a news section on the site (long overdue)</li>
<li> Configure our notification system better so its emails don&#8217;t land in your spam folder</li>
</ul>
<p>And don&#8217;t forget the ultimate goal: <strong>Integration in CodeIgniter Reactor.</strong></p>
<p>Check out the beta and ping the team with any problems! ohcrap@getsparks.org</p>
]]></content:encoded>
			<wfw:commentRss>http://codefury.net/2011/05/getsparks-org-beta-released-big-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Video: chip — A Log File Monitor &amp; Multiplexer</title>
		<link>http://codefury.net/2011/04/video-chip-a-log-file-monitor-multiplexer/</link>
		<comments>http://codefury.net/2011/04/video-chip-a-log-file-monitor-multiplexer/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 12:09:12 +0000</pubDate>
		<dc:creator>Kenny Katzgrau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://codefury.net/?p=424</guid>
		<description><![CDATA[If you&#8217;ve ever had the need to investigate production issues in a load-balanced setup, you&#8217;d know why having a tool to pull down all of your remote log files into a single filtered stream can be handy. I think splunk is great at this, but in many cases, overkill. I wrote chip to accommodate this [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcodefury.net%2F2011%2F04%2Fvideo-chip-a-log-file-monitor-multiplexer%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcodefury.net%2F2011%2F04%2Fvideo-chip-a-log-file-monitor-multiplexer%2F&amp;source=_kennyk_&amp;style=normal&amp;space=12&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>If you&#8217;ve ever had the need to investigate production issues in a load-balanced setup, you&#8217;d know why having a tool to pull down all of your remote log files into a single filtered stream can be handy. I think <a title="splunk" href="http://splunk.com" target="_blank">splunk</a> is great at this, but in many cases, overkill.</p>
<p><strong>I wrote <a  target="_blank" href="http://github.com/katzgrau/chip">chip</a> to accommodate this demanding use case:</strong></p>
<p><em>I have n production servers. From my local machine, I want to view the web application logs across those servers on a single terminal, while highlighting error lines in red. Additionally, I want those errors emailed to me.</em></p>
<p>That&#8217;s what chip does. It&#8217;s a powerful log file monitor (like swatch) and multiplexer. That is, it combines local or remote logs into one stream that you can see. Watch the screencast:</p>
<p><iframe src="http://www.screenr.com/embed/kDi" width="500" height="305" frameborder="0"></iframe></p>
<p>A full description of what chip can do is at the <a  target="_blank"  href="https://github.com/katzgrau/chip">github project page</a>, but the gist is:</p>
<blockquote><p><code>chip</code> starts up and tries to open log file(s), either local or remote. If one isn&#8217;t specified, it reads from standard input. It goes through each line looking for patterns that <em>you</em> have specified as arguments. When it finds a match, chip does whatever you told it to do with that match.</p></blockquote>
<p>I use chip daily to watch production logs. When I&#8217;m investigating issues, I set up an additional pattern and handler to send certain log lines to my inbox. Just think: An instant monitor set up to watch all of your production logs while you do more important things. Useful for just tailing logs, splitting them, colorizing them, monitoring them, or any combination of the above. You can also use it as a more flexible alternative to `tee` when piping in input.</p>
<p>Anyway, now I can get back to working on the <a target="_blank" href="http://getsparks.org">GetSparks.org</a> project <img src='http://codefury.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><code>chip</code> is still technically a beta, but has been stable throughout my use of it. Check out chip at <a  target="_blank"  href="https://github.com/katzgrau/chip">https://github.com/katzgrau/chip</a>.</p>
<p><em>On Twitter, I&#8217;m <a  target="_blank"  href="http://twitter.com/_kennyk_">@_kennyk_</a>.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://codefury.net/2011/04/video-chip-a-log-file-monitor-multiplexer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why PHP Was a Ghetto</title>
		<link>http://codefury.net/2011/04/why-php-was-a-ghetto/</link>
		<comments>http://codefury.net/2011/04/why-php-was-a-ghetto/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 12:14:08 +0000</pubDate>
		<dc:creator>Kenny Katzgrau</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[Soap Box]]></category>
		<category><![CDATA[ghetto]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://codefury.net/?p=389</guid>
		<description><![CDATA[Note: I wrote this over a month ago, but decided not to publish it until now. I was talking with the Co-founder of a pretty cool start-up in DUMBO the other day about why the non-PHP development world generally has such disdain for PHP and the community surrounding it. He brought up an interesting point [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcodefury.net%2F2011%2F04%2Fwhy-php-was-a-ghetto%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcodefury.net%2F2011%2F04%2Fwhy-php-was-a-ghetto%2F&amp;source=_kennyk_&amp;style=normal&amp;space=12&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>Note:</strong> I wrote this over a month ago, but decided not to publish it until now.</p>
<p>I was talking with the Co-founder of a <a href="http://www.saaspire.com/">pretty cool start-up</a> in <a href="http://dumbonyc.com/">DUMBO</a> the other day about why the non-PHP development world generally has such disdain for PHP and the community surrounding it. He brought up an interesting point that stuck with me, largely because I hadn&#8217;t heard it before.</p>
<p>If you&#8217;re unaware of the usual beef most developers have with PHP, it tends to revolve around:</p>
<ol>
<li>Ugly syntax</li>
<li>Lack of some necessary features that other languages have (prior to 5.3, namespacing, closures)</li>
<li>Inconsistent function naming, usage, and other quirks</li>
<li>Mix of procedural and OO-ness</li>
<li>The fact that 80-90% of PHP projects are probably gigantic piles of shit</li>
</ol>
<p>But his problem with PHP was a little different. He didn&#8217;t say the actual language was poor — he said it was the general culture surrounding the language, which is usually iconified by a language&#8217;s founder, that seems to encourage bad practices. That is, PHP code bases tend to be hacky and unmaintainable.</p>
<p>The concept that the community surrounding a language or framework embodies an author&#8217;s philosophy seems to be true. He brought up Ruby and <a href="http://en.wikipedia.org/wiki/Yukihiro_Matsumoto">Matz</a>. Matz wanted a language that was easy to read and write, and enhanced programmer productivity. Don&#8217;t Ruby developers seem to harp on rapid application development and the elegance of their language?</p>
<p>Then <a href="http://en.wikipedia.org/wiki/David_Heinemeier_Hansson">DHH</a> and the Rails came up. Then <a href="http://www.python.org/~guido/">Guido</a> and Python. So I thought: What about <a href="http://en.wikipedia.org/wiki/Rasmus_Lerdorf">Rasmus</a>?</p>
<p>Rasmus Lerdorf is an interesting figure. He created the original version of PHP, continues to contribute, is widely considered a demigod in the community and the authority on almost anything PHP. He <a href="http://www.urbandictionary.com/define.php?term=rasmussed">steals masses of attendees at conferences</a>, <a href="http://yahoo.com">gets hired by big internet places</a>, and garners the respect of everyone despite one glaring property: Rasmus represents what most non-PHP developers hate about PHP.</p>
<p>Rasmus generally promotes abstention from using frameworks, and the use of PHP as more of a templating language. To him, this translates to raw speed and scalability (load-wise). To everyone else, this translates to piles of procedural spaghetti code, and unmaintainable projects. For roughly 10 years following the birth of PHP in 1995, this was how PHP projects were written.</p>
<p>But another issue cropped up:  In it&#8217;s pizza-faced adolescent years (pre-5.0), PHP gained a serious following among novices. The language has a fantastically low barrier to entry, so anyone could get started in 2 minutes by downloading some self-extracting *AMP stack for Windows. Additionally, the acceptance of the MVC paradigm hadn&#8217;t really occurred yet in web development. What do you get when you mix n00bs and a lack of best practices? Unmaintainable garbage. And that&#8217;s what proliferated.</p>
<p>Don&#8217;t get me wrong — there were some great PHP developers around, even back then. But like I said, unrefined n00b-sauce was all around. When cowboy PHP developers with no standards got together to build a project, it came out looking like PHPbb, PHPNuke, or some other gnarled mash of .php3 files. But can you singularly blame PHP developers? No! The other web language giants, ASP and Perl, were also gross as hell and promoting the same spaghetti-code practices.</p>
<p>So why does PHP get a bad rap? Because of its legacy. And most old-time PHP devs who have fled to Python, Ruby, and Java haven&#8217;t really looked back to see what kind of development has happened in the language since the introduction of MVC on the web. Additionally, there were super-outspoken critics like &#8220;Ruby guy&#8221; Zed Shaw complaining of developers with &#8220;PHP-Infected Brains&#8221;, and the distribution of <a href="http://www.rubyinside.com/holiday-fun-how-programming-language-fanboys-see-each-others-languages-2911.html">stuff like this on RubyInside</a>.</p>
<p><em>PHP was a ghetto.</em></p>
<p>But the development of frameworks like Zend and CodeIgniter have greatly pushed the language development into the right direction. In fact, it&#8217;s been pushed in the <em>opposite </em>direction of where Rasmus would probably like to see it. Check out the Zend or CodeIgniter frameworks and tell me it&#8217;s not some of the best documented, most well-written code you&#8217;ve seen.</p>
<p>When most developers learned Ruby, they were learning Rails and MVC  at the same time. PHP was in use for a full 10 years before that. So there really wasn&#8217;t a period of time when heinous Ruby was being written by novices. There was an established standard in place for Rails, and the barrier to entry was a much higher, typically keeping less experienced developers out.</p>
<p>The fact is, a PHP applications can be as well-written as an application in any other language, and probably have the additional advantage of speed. The widespread use of MVC-style development in the PHP world is a relatively recent phenomena though, and admittedly, we can probably thank Rails for it.</p>
<p>So what does PHP have going for it now?</p>
<ol>
<li>Standards (not universal, but generally a flavor of MVC for most projects, and little procedural crap)</li>
<li>A very low barrier to entry</li>
<li>Speed &amp; Scalability (maybe the best among script-based languages)</li>
<li>A great unit testing framework</li>
<li>Arguably the best documentation for any language</li>
</ol>
<p>Additionally, it&#8217;s behind some of the internet&#8217;s most influential websites and tools, like Facebook, Digg, Wikipedia, WordPress, Drupal, etc. I&#8217;d bet that having a solid understanding of it opens more doors for a developer than any other.</p>
<p>If you don&#8217;t agree with the above, comment on this post, or email me — I&#8217;d like to hear why you don&#8217;t think so.</p>
<p>I&#8217;m no PHP fanboy — in fact, I&#8217;m very language-agnostic. I write PHP more often because, you guessed it, people pay me to. So it all comes down to this:</p>
<p><em>If you are capable of making wise software design decisions, PHP is a great choice to build your web application with.<br />
</em></p>
<p>By the way, if I just convinced you to build your next webapp in PHP, check out CodeIgniter. <a href="http://codeigniter.com">It&#8217;s the lightweight, no magic, ultra fast framework for PHP</a>. When it comes to CodeIgniter, I am a fanboy.</p>
<p><strong>4/4 Edit</strong>: I&#8217;ll be presenting a tool I wrote in Perl called &#8216;<a href="https://github.com/katzgrau/chip">divvy</a>&#8216; tonight at <a href="http://www.meetup.com/hack-and-tell/">Hack and Tell</a> in NYC. Here&#8217;s a<a href="http://blip.tv/file/4739441"> video of a previous event</a> (about 10 minutes in) where a developer plugs in his laptop to reveal Windows XP on his desktop (strike 1.5) and then admits to being a &#8220;PHP Coder&#8221; (strike 4). Is it me, or can you feel the judgment in the air? Maybe it&#8217;s me.</p>
<p><em>On Twitter, I&#8217;m <a title="@_kennyk_" href="http://twitter.com/_kennyk_" target="_blank">@_kennyk_</a></em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://codefury.net/2011/04/why-php-was-a-ghetto/feed/</wfw:commentRss>
		<slash:comments>91</slash:comments>
		</item>
		<item>
		<title>Video: How GetSparks.org Uses CodeIgniter Sparks</title>
		<link>http://codefury.net/2011/03/video-how-getsparks-org-uses-codeigniter-sparks/</link>
		<comments>http://codefury.net/2011/03/video-how-getsparks-org-uses-codeigniter-sparks/#comments</comments>
		<pubDate>Mon, 07 Mar 2011 13:54:40 +0000</pubDate>
		<dc:creator>Kenny Katzgrau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://codefury.net/?p=402</guid>
		<description><![CDATA[If you aren&#8217;t already familiar, a package manager and repository for CodeIgniter libraries was released last week at GetSparks.org. In the few days between then and now, some very interesting and useful packages have been submitted. There&#8217;s one for combining, minifying and caching assets, one for database scaffolding, viewing logs, geocoding, template-ing, etc. Here&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcodefury.net%2F2011%2F03%2Fvideo-how-getsparks-org-uses-codeigniter-sparks%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcodefury.net%2F2011%2F03%2Fvideo-how-getsparks-org-uses-codeigniter-sparks%2F&amp;source=_kennyk_&amp;style=normal&amp;space=12&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>If you aren&#8217;t already familiar, a package manager and repository for CodeIgniter libraries was released last week at GetSparks.org. In the few days between then and now, some <em>very</em> interesting and useful packages have been submitted. There&#8217;s one for combining, minifying and caching assets, one for database scaffolding, viewing logs, geocoding, template-ing, etc.</p>
<p>Here&#8217;s a short screencast that shows how GetSparks.org has already started using some of these sparks in its own development.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="345" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="i=181605" /><param name="allowFullScreen" value="true" /><param name="src" value="http://screenr.com/Content/assets/screenr_1116090935.swf" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="540" height="333" src="http://screenr.com/Content/assets/screenr_1116090935.swf" allowfullscreen="true" flashvars="i=181605"></embed></object></p>
<p>If you&#8217;re interested in the project, follow it at <a href="http://twitter.com/getsparks">twitter.com/getsparks</a>. If you&#8217;re a developer and you&#8217;re interested in following or helping out with development, head to the github repository over at <a href="http://github.com/katzgrau/getsparks.org">http://github.com/katzgrau/getsparks.org</a>.</p>
<p>As always, if you&#8217;d like to join the project, find me at: katzgrau@gmail.com.</p>
]]></content:encoded>
			<wfw:commentRss>http://codefury.net/2011/03/video-how-getsparks-org-uses-codeigniter-sparks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Introducing CodeIgniter Sparks</title>
		<link>http://codefury.net/2011/03/introducing-codeigniter-sparks/</link>
		<comments>http://codefury.net/2011/03/introducing-codeigniter-sparks/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 04:24:48 +0000</pubDate>
		<dc:creator>Kenny Katzgrau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://codefury.net/?p=394</guid>
		<description><![CDATA[If you&#8217;re familiar with package management, you&#8217;re aware of how awesome it can be. Yum, Apt, MacPorts, homebrew are examples of package managers on the Operating System level. Need to install some common software package like mysql? On OSX, it isn&#8217;t any harder than: $ brew install mysql For software development, you have Python&#8217;s eggs [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcodefury.net%2F2011%2F03%2Fintroducing-codeigniter-sparks%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcodefury.net%2F2011%2F03%2Fintroducing-codeigniter-sparks%2F&amp;source=_kennyk_&amp;style=normal&amp;space=12&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>If you&#8217;re familiar with package management, you&#8217;re aware of how awesome it can be. Yum, Apt, MacPorts, homebrew are examples of package managers on the Operating System level. Need to install some common software package like mysql? On OSX, it isn&#8217;t any harder than:</p>
<pre>$ brew install mysql
</pre>
<p>For software development, you have Python&#8217;s eggs and Rails&#8217; gems, which each work a bit differently, but generally achieve a solution to a big problem: Using, installing, and contributing other developers&#8217; libraries should be easy.</p>
<p>So if you&#8217;re a CodeIgniter developer, picture this common scenario: You need a library to interact with Amazon&#8217;s new Simple Email Service, but you know someone out there must have already written one. You end up on some guy&#8217;s blog, and it looks like he has a working library. You copy/paste, download, whatever.</p>
<p>Maybe the lib was written to work with CodeIgniter, or maybe it&#8217;s just a general PHP lib. Maybe it works, maybe it doesn&#8217;t. Maybe it has solid documentation, maybe it doesn&#8217;t. If it&#8217;s not to your liking, back to Google you go, and search for something else. This is all time-consuming.</p>
<p>As of today, this problem is solved for CodeIgniter. It&#8217;s called CodeIgniter Sparks, and you can read all about it at <a href="http://getsparks.org">http://getsparks.org</a>.</p>
<p>CodeIgniter &#8220;Sparks&#8221; is still in an alpha state at the time of this writing, but it&#8217;s planned to be a full package manager for CodeIgniter applications. You can install it by using a <a href="http://getsparks.org/install">one-liner</a>.</p>
<p>Thanks to some early contributions, you can now <a href="http://getsparks.org/packages/amazon-ses/versions/HEAD/show">get some Amazon SES</a> functionality by:</p>
<pre>$ php tools/spark install amazon-ses</pre>
<p>And <a href="http://en.wikipedia.org/wiki/NBA_Jam">boom-shakalaka</a>! It&#8217;s installed in your application. A special thanks to <a href="http://joelcox.nl/">Joël Cox</a> for that one.</p>
<p><a href="http://philsturgeon.co.uk/">Phil Sturgeon</a> and <a href="http://dhorrigan.com/">Dan Horrigan</a> each came through with their respective &#8216;<a href="http://getsparks.org/packages/template/versions/HEAD/show">template</a>&#8216; and &#8216;<a href="http://getsparks.org/packages/tags/versions/HEAD/show">tag</a>&#8216; packages.</p>
<p>It&#8217;s still very early in the project&#8217;s lifetime, but I don&#8217;t think its too early to say that this could be very beneficial to the frameworks as a whole. As I put in the &#8220;GetSparks.org Manifesto&#8221;:</p>
<blockquote>
<ol>
<li>There are plenty of feature requests for CodeIgniter, especially when it             comes to libraries. 99% of the suggested libraries don&#8217;t belong             built-in to the framework. We hope that Sparks helps keep CodeIgniter             one of the lightest, fastest frameworks for PHP.</li>
<li>Some fantastic and useful libraries have been written             for CodeIgniter, but they remain scattered around the internet on blogs,             wikis, forums, and github. Using these in your projects is a chore             of copy and paste.</li>
<li>When you&#8217;re thinking of using someone else&#8217;s code, there isn&#8217;t much             of a way to gauge whether it&#8217;s ready for the big-time. Is it fault             tolerant? Unit tested? Relatively recent?</li>
<li><strong>Most importantly:</strong> CodeIgniter developers don&#8217;t have             an easy way to share their code and contribute extensions to CodeIgniter             functionality.</li>
</ol>
</blockquote>
<p>It all comes down to making code easier to use and share among CodeIgniter developers.</p>
<p>If you&#8217;re interested in helping out on the project, reach out to <a href="mailto:team@getsparks.org">team@getsparks.org</a>. Right now, the team consists of me, <a href="http://johncrepezzi.com">John</a>, <a href="http://beau.frusetta.com/">Beau</a>, and <a href="http://twitter.com/mdpauley">Mike</a>. If you just want to follow along, check out <a href="http://github.com/katzgrau/getsparks.org">http://github.com/katzgrau/getsparks.org</a>. I&#8217;ve already received a ton of feedback, and it&#8217;s <em><strong>all</strong></em> appreciated.</p>
<p>PS: John and I put together a podcast explaining <a href="http://oconf.org/">why we thought all this was needed by CI</a> a couple weeks ago. Check it out!</p>
]]></content:encoded>
			<wfw:commentRss>http://codefury.net/2011/03/introducing-codeigniter-sparks/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>List Your GitHub and BitBucket Projects On WordPress</title>
		<link>http://codefury.net/2011/02/list-your-github-and-bitbucket-projects-on-wordpress/</link>
		<comments>http://codefury.net/2011/02/list-your-github-and-bitbucket-projects-on-wordpress/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 14:00:08 +0000</pubDate>
		<dc:creator>Kenny Katzgrau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://codefury.net/?p=375</guid>
		<description><![CDATA[Over the weekend I put a full day into creating and completing a WordPress plugin that probably doesn&#8217;t appeal to anybody except for developers: A tool to list your github and bitbucket projects right inside a post or on your side bar. You can see it in action on my projects page. Basically, I was [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcodefury.net%2F2011%2F02%2Flist-your-github-and-bitbucket-projects-on-wordpress%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcodefury.net%2F2011%2F02%2Flist-your-github-and-bitbucket-projects-on-wordpress%2F&amp;source=_kennyk_&amp;style=normal&amp;space=12&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Over the weekend I put a full day into creating and completing a WordPress plugin that probably doesn&#8217;t appeal to anybody except for developers: <a href="http://wordpress.org/extend/plugins/github-bitbucket-project-lister/">A tool to list your github and bitbucket projects right inside a post or on your side bar</a>.</p>
<p>You can see it in action on my projects page.</p>
<p>Basically, I was tired of updating my long-obsolete project list. These days, everything I do is kept on a publicly-hosted repository anyway, so why not pull my project info from those places so it updates automatically?</p>
<p>The plugin is simple to use. Just insert something like:</p>
<pre>
&#123;&#123;github:katzgrau&#125;&#125;
</pre>
<p>In your post or page where you want the list. Here&#8217;s a real-life example of the output:</p>
<p><ul><li>
    <h4>
        <a href="https://github.com/katzgrau/KLogger">
            KLogger — 87 following
        </a>
    </h4>
    <p>A Simple Logging Class For PHP</p>
</li>

<li>
    <h4>
        <a href="https://github.com/katzgrau/ajax-proxy">
            ajax-proxy — 5 following
        </a>
    </h4>
    <p>An easy-to-use PHP ajax proxy class and script for facilitating cross-domain ajax calls which supports cookies and has minimal dependencies (doesn't need curl)</p>
</li>

<li>
    <h4>
        <a href="https://github.com/katzgrau/WP-Easy-Cache">
            WP-Easy-Cache — 1 following
        </a>
    </h4>
    <p>A PHP class for easily caching data programmatically in WordPress. Oriented for develeopers pulling Twitter feeds, etc. A nice alternative to the weak built-in cache functions.</p>
</li>

<li>
    <h4>
        <a href="https://github.com/katzgrau/ci-robot-helper">
            ci-robot-helper — 5 following
        </a>
    </h4>
    <p>A spark that can be used to generate questions and answers to avoid robot form submissions</p>
</li>

<li>
    <h4>
        <a href="https://github.com/katzgrau/wordpress-github">
            wordpress-github — 21 following
        </a>
    </h4>
    <p>List your github and bitbucket projects on your WordPress blog really, really easily. Why? Because you're a baller.</p>
</li>

<li>
    <h4>
        <a href="https://github.com/katzgrau/getsparks.org">
            getsparks.org — 74 following
        </a>
    </h4>
    <p>getsparks.org - The CodeIgniter Package Managment Repository</p>
</li>

<li>
    <h4>
        <a href="https://github.com/katzgrau/spark-sdk">
            spark-sdk — 5 following
        </a>
    </h4>
    <p>A CodeIgniter Spark to assist in developing and validating new sparks.</p>
</li>

<li>
    <h4>
        <a href="https://github.com/katzgrau/chip">
            chip — 57 following
        </a>
    </h4>
    <p>A log file multiplexer and monitor. Tail multiple remote or local log files, set actions, and more. A friend to every developer and system admin. Alpha.</p>
</li>

<li>
    <h4>
        <a href="https://github.com/katzgrau/boomcalc">
            boomcalc — 1 following
        </a>
    </h4>
    <p>A jQuery plugin that renders a usable calculator in a DOM element.</p>
</li>

<li>
    <h4>
        <a href="https://github.com/katzgrau/notes">
            notes — 1 following
        </a>
    </h4>
    <p>An open-source multi-user website building application</p>
</li>

<li>
    <h4>
        <a href="https://github.com/katzgrau/access">
            access — 6 following
        </a>
    </h4>
    <p>A CodeIgniter Spark for easily protecting all or part of your site with HTTP Auth prompts</p>
</li>

<li>
    <h4>
        <a href="https://github.com/katzgrau/codeigniter-amazon-ses">
            codeigniter-amazon-ses — 2 following
        </a>
    </h4>
    <p>A CodeIgniter library to interact with Amazon Web Services (AWS) Simple Email Service (SES)</p>
</li>

</ul></p>
<p>I use BitBucket for CodeIgniter-related projects, and GitHub for pretty much everything else. So on my project page, I actually do:</p>
<pre>
&#123;&#123;github:katzgrau,bitbucket:katzgrau,sortby:watchers,sortdir:desc&#125;&#125;
</pre>
<p>Which pulls projects from both github and bitbucket, combines them, sorts them, and displays a list. A widget which comes with the plugin will do the same thing if you just want to list projects in your sidebar.</p>
<p>Anyway, check it out. You can find it in the WP admin plugin panel by searching for &#8216;GitHub&#8217;. Then just look for the &#8216;<a href="http://wordpress.org/extend/plugins/github-bitbucket-project-lister/">GitHub and BitBucket Project Lister</a>&#8216;. You can find the github repo (where it&#8217;s developed) here: <a href="https://github.com/katzgrau/wordpress-github">https://github.com/katzgrau/wordpress-github</a></p>
]]></content:encoded>
			<wfw:commentRss>http://codefury.net/2011/02/list-your-github-and-bitbucket-projects-on-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeIgniter 2.0 Released, User-Contributed Notes Coming</title>
		<link>http://codefury.net/2011/02/codeigniter-2-0-released-user-contributed-notes-coming/</link>
		<comments>http://codefury.net/2011/02/codeigniter-2-0-released-user-contributed-notes-coming/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 14:03:38 +0000</pubDate>
		<dc:creator>Kenny Katzgrau</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP Development]]></category>

		<guid isPermaLink="false">http://codefury.net/?p=339</guid>
		<description><![CDATA[In my initial post after joining the CodeIgniter Reactor team (over Thanksgiving weekend &#8217;10), I went as far as to saying that you could hold me responsible for the quality of the CodeIgniter documentation. Here&#8217;s a universal truth: Documentation &#62; magic. CodeIgniter 2.0 was released last week, with an announcement on the EllisLab news feed. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcodefury.net%2F2011%2F02%2Fcodeigniter-2-0-released-user-contributed-notes-coming%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcodefury.net%2F2011%2F02%2Fcodeigniter-2-0-released-user-contributed-notes-coming%2F&amp;source=_kennyk_&amp;style=normal&amp;space=12&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>In my initial post after joining the CodeIgniter Reactor team (over Thanksgiving weekend &#8217;10), I went as far as to saying that you could hold me responsible for the quality of the CodeIgniter documentation. Here&#8217;s a universal truth: Documentation &gt; magic.</p>
<p>CodeIgniter 2.0 was released last week, with an announcement on the EllisLab news feed. The &#8220;Reactor&#8221; project is now considered to be &#8220;CodeIgniter&#8221;. All official forum references, downloads, and docs referring to CodeIgniter are referring to the project sitting here at <a target="_blank" href="https://bitbucket.org/ellislab/codeigniter-reactor">BitBucket</a>.</p>
<p>You can check out the lengthy change-log here: <a target="_blank" href="http://codeigniter.com/user_guide/changelog.html">http://codeigniter.com/user_guide/changelog.html</a></p>
<p>Version 2.0 was released while some big features were still in development (but not 100% ready for the limelight). My favorite upcoming feature (by no coincidence) is something I&#8217;m currently putting together: A user-contributed note system for the user guide.</p>
<p>Everyone who keeps a place in their heart for PHP (as hard as it may be at times) knows how helpful php.net is. It&#8217;s a single place for clear PHP documentation, code examples, and user-contributed notes.</p>
<p>Some would argue that the most helpful parts of the PHP docs are the notes that PHP developers contributed themselves. A long-time request for CodeIgniter has been to add something similar the user guide.</p>
<p>Since late December, I&#8217;ve worked been working on (and have pretty much completed) a full-featured versioned user-contributed notes system for the docs. You can the see the progress in the BitBucket &#8216;user-notes&#8217; branch:  <a target="_blank" href="https://bitbucket.org/ellislab/codeigniter-reactor/src/a6f52cbc8229">https://bitbucket.org/ellislab/codeigniter-reactor/src/a6f52cbc8229</a></p>
<p>The actual application used to host the notes is being developed at: <a target="_blank" href="https://bitbucket.org/katzgrau/ci-userguide-notes">https://bitbucket.org/katzgrau/ci-userguide-notes</a></p>
<p>And of course, some screenshots of notes in action:</p>
<p style="text-align: center;"><a target="_blank" href="http://codefury.net/wp-content/uploads/2011/02/user-note-displayed.png"><img class="size-medium wp-image-341 aligncenter" title="CodeIgniter User Notes" src="http://codefury.net/wp-content/uploads/2011/02/user-note-displayed-300x155.png" alt="" width="300" height="155" /></a></p>
<p>Adding a note looks like a clone of the contribution page at PHP.net:</p>
<p><a target="_blank" href="http://codefury.net/wp-content/uploads/2011/02/user-note-create.png"><img class="aligncenter size-medium wp-image-344" title="Create a CodeIgniter User Note" src="http://codefury.net/wp-content/uploads/2011/02/user-note-create-300x155.png" alt="" width="300" height="155" /></a></p>
<p>You can check out a live instance of a user guide with the new system here (link not guaranteed to work into the future!): <a target="_blank" href="http://ci-notes-exp.katzgrau.com/user_guide/libraries/benchmark.html">http://ci-notes-exp.katzgrau.com/user_guide/libraries/benchmark.html</a></p>
<p>Like I mentioned, the notes are versioned. That means notes can be promoted from older versions to newer versions, and they can be pruned from newer versions as they become obsolete, without affecting the old. Best of all, the user_guide will still come distributed in HTML format with the framework. The notes are pulled in and loaded via some simple Javascript.</p>
<p>I&#8217;ve always thought the CodeIgniter docs were the best among any framework that I&#8217;ve come across. I think this&#8217;ll take them even further.</p>
<p>Look for them at the end of Q1 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://codefury.net/2011/02/codeigniter-2-0-released-user-contributed-notes-coming/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CodeIgniter/PHP + IIS + MySQL + MSSQL: It Works!</title>
		<link>http://codefury.net/2011/01/codeigniter-php-iis-mysql-mssql/</link>
		<comments>http://codefury.net/2011/01/codeigniter-php-iis-mysql-mssql/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 13:41:48 +0000</pubDate>
		<dc:creator>Kenny Katzgrau</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[mssql]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sqlsrv]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://codefury.net/?p=316</guid>
		<description><![CDATA[There are a lot of people out there who call themselves &#8220;LAMP&#8221; developers — short for Linux, Apache, MySQL, PHP. That&#8217;s the standard configuration for production PHP applications. Recently, I ended up having to build a CodeIgniter application on Windows, IIS, Mysql+MS-SQL, and PHP. Sound like there are bound to be issues? You bet, and [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcodefury.net%2F2011%2F01%2Fcodeigniter-php-iis-mysql-mssql%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcodefury.net%2F2011%2F01%2Fcodeigniter-php-iis-mysql-mssql%2F&amp;source=_kennyk_&amp;style=normal&amp;space=12&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>There are a lot of people out there who call themselves &#8220;LAMP&#8221; developers — short for Linux, Apache, MySQL, PHP. That&#8217;s the standard configuration for production PHP applications. Recently, I ended up having to build a CodeIgniter application on <strong>W</strong>indows<strong>, I</strong>IS, Mysql+<strong>M</strong>S-SQL, and <strong>P</strong>HP. Sound like there are bound to be issues? You bet, and it especially hurts because now I&#8217;m a real-live WIMP developer.</p>
<p>And what made it even more interesting was that due to constraints, I had to develop the application in Ubuntu and deploy to Windows for production.</p>
<p>Please keep in mind that I didn&#8217;t opt for this setup by choice. The servers to be used were already in place, and well, it just had to be this way. I&#8217;d imagine this unholy mix can be found on server farms somewhere around the seventh or eighth circle of hell.</p>
<p><em><strong>Anyway, the point of this post is to document a few &#8220;gotchas&#8221; that came up along the way.</strong></em> At this point I should say that application is now happily humming along in production. I knew from the start that mixing all of the above would be a headache, but luckily, things worked out without sapping too much time. I should also say this before I start: Thanks to some great work done by others over the past 2 years, this setup was actually possible.</p>
<p><strong>Gotcha #1: PHP and MSSQL on Ubuntu</strong></p>
<p>Thank god this was so easy. In order to use the standard database functions like mssql_connect, mssql_query, etc, all I needed to do within my existing LAMP installation was run:</p>
<pre>$ sudo apt-get install php5-sybase</pre>
<p>And sh-bang, I could connect to SQL Server without an issue. From CodeIgniter, I set the database to use mssql as my driver, and I was home free.</p>
<p><strong>Gotcha #2: PHP and MSSQL on Windows</strong></p>
<p>For years, forums and IRC rooms were filled with hopeless requests to get these two to mix. In 2008, Microsoft wrote a driver to help PHP developers seamlessly connect to SQL Server. For Win-PHP installations, just install this gem:<a href="http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&amp;FamilyID=80e44913-24b4-4113-8807-caae6cf2ca05"> http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&amp;FamilyID=80e44913-24b4-4113-8807-caae6cf2ca05</a> . Also, read up on the docs.</p>
<p>That driver uses a different API then the regular PHP mssql_* functions. In fact, it uses sqlsrv_* functions instead. So CodeIgniter can&#8217;t work with it out of the box. Luckily I found an excellent 2 and 1/2 year-old post by a guy who wrote the CodeIgniter driver to work with the Microsoft drivers. Just download the code, and drop it into system/database/drivers. Read up here: <a href="http://www.kaweb.co.uk/blog/mssql-server-2005-and-codeigniter/">http://www.kaweb.co.uk/blog/mssql-server-2005-and-codeigniter/</a></p>
<p>One thing you will have to do to make it work with the latest version of CodeIgniter is create a dummy function in sqlsrv_driver.php. Just drop &#8216;function db_set_charset() { }&#8217; somewhere in the class declaration.</p>
<p><em>As a side note, that driver would make a great addition to <a href="http://codefury.net/2010/12/codeigniter-reactor/">CodeIgniter Reactor</a>.</em></p>
<p><strong>Gotcha #3: mssql vs. sqlsrv<br />
</strong></p>
<p>Notice that I had to use different drivers for connecting to SQL Server between Ubuntu and Windows. This is why it&#8217;s handy to use some sort of database abstraction class like the one that comes with CodeIgniter. All I had to do to switch between drivers when I deployed to the new environment was edit the configuration.</p>
<p>Also, query result fields that are fetched using PHP&#8217;s mssql driver come back as strings. The Windows sqlsrv driver gets fancy and hands back field values as objects. Your code won&#8217;t have to change for the most part, but beware that MSSQL &#8216;datetime&#8217; fields come back as native <a href="http://php.net/manual/en/class.datetime.php">PHP DateTime</a> objects using sqlsrv_*, not strings. In the code, I ended up doing something like: <em>if($date instanceof DateTime) return $date-&gt;format(&#8230;); else return $date;</em></p>
<p><em><strong>Edit: </strong>Commenter <a href="http://blogs.msdn.com/b/brian_swan">Brian Swan</a> and Twitter user <a href="http://www.juokaz.com/">Juozas Kaziukėnas</a> have pointed out that the sqlsrv_ PHP driver will take a boolean &#8216;ReturnDatesAsStrings&#8217; option in sqlsrv_connect() that specifies whether datetime fields come back as strings or objects. More info is here: <a href="http://msdn.microsoft.com/en-us/library/ee376928%28v=sql.90%29.aspx">http://msdn.microsoft.com/en-us/library/ee376928%28v=sql.90%29.aspx</a>. Thanks guys!</em></p>
<p><strong>Gotcha #4: File Permissions and Logging</strong></p>
<p>As the author of WPSearch, a Wordress search plugin which does heavy work with the filesystem, I can say that the number one cause of broken installations is that the permissions are too strict. On Windows, files can appear to be 777 when viewing them via FTP, but on the Windows end, they are set as &#8216;Read Only&#8217;, or &#8216;Archive&#8217;. This throws a serious wrench into things.</p>
<p>When I first deployed to the production server, all I would get for responses was a blank page. Worst of all, the log wasn&#8217;t writing anything. After a trace through the CodeIgniter bootstrap, I found that the application died when the logging class was loaded. If your application&#8217;s logging threshold is set to write anything, and the logging fails, the application might just crap-out. This is different behavior than I&#8217;ve seen on linux, where you just won&#8217;t see logs appear in the logging directory, but the overall application still works fine.</p>
<p>Just turn off logging to make sure that empty responses aren&#8217;t the result of file permission errors.</p>
<p><strong>Gotcha #5: No .htaccess Fo&#8217; You!</strong></p>
<p>I hadn&#8217;t known that I needed to drop the final application into an IIS instance from the start. I learned about that 1 day prior to the launch. Before that, I though I&#8217;d be rollin&#8217; on Windows/Apache. Wrong!</p>
<p>IIS doesn&#8217;t use silly .htaccess files, which I had only used for standard URL rewriting/prettified URLs. I was forced to decide between converting the .htaccess to an IIS web.config file, or just ditch the prettified URLs. Since it was a small application, I went with the latter. Here&#8217;s a nice StackOverflow thread discussing a translation though: <a href="http://stackoverflow.com/questions/702526/translating-an-apache-htaccess-file-to-an-iis-web-config">http://stackoverflow.com/questions/702526/translating-an-apache-htaccess-file-to-an-iis-web-config</a></p>
<p><em><strong>Edit:</strong> Juozas had some comments here too: &#8220;@_kennyk_  about .htaccess vs web.config &#8211; you can actually import .htaccess in IIS URL Rewrite section.&#8221;</em></p>
<p><strong>Gotcha #6: 2 Databases, 1 Application</strong></p>
<p>This is more of a CodeIgniter issue. For this application I had to lookup data in a MySQL database, then use some of that information to pull rows from a MSSQL database. The hurdle revolves around having two concurrent database connections open in CodeIgniter.</p>
<p>You can&#8217;t really load the database in traditional CodeIgniter style, like $this-&gt;load-&gt;database(), or by autoloading it. Something like this doesn&#8217;t work:</p>
<pre>$this-&gt;load-&gt;database('mysql-group-name');
# Do Stuff with mysql
$this-&gt;load-&gt;database('mssql-group-name');
# Do Stuff with mssql</pre>
<p>Instead, you have to ask CodeIgniter to hand you back the actual database object with each connection. It&#8217;s a good idea to encapsulate each within the models where you&#8217;re using them. Do something like this:</p>
<pre>class SomeMySQLModel extends Model {
  # the mysql db instance
  private $_db = NULL;

  function SomeMySQLModel() {
    $this-&gt;_db = $this-&gt;load-&gt;database('mysql-group', TRUE);
  }
}</pre>
<pre>class SomeMSSQLModel extends Model {
   # the mssql db instance
   private $_db = NULL;

   function SomeMSSQLModel() {
     $this-&gt;_db = $this-&gt;load-&gt;database('mssql-group', TRUE);
   }
 }</pre>
<p><strong>Gotcha #7: Mysterious lag time</strong></p>
<p>IIS can exhibit some odd behavior regarding response times. When I was initially testing the application on my SliceHost dev server, I was getting pretty speedy responses in about ~100ms (keep in mind that I was connecting to both MSSQL and MySQL across the internet, not locally).</p>
<p>But when I moved to production, requests were taking 6 seconds each. Confused, I thought there must be some sort of bottleneck in the application. I used CodeIgniter&#8217;s profiling and benchmarking classes to investigate. I benchmarked the MySQL and MSSQL connections, queries, and overall application execution time.</p>
<p>The app was reporting that it was finishing responses within 100ms. So where was this strange delay coming from?</p>
<p>I then thought there might be some sort of redirect loop going on. From the shell, I ran:</p>
<pre>$ time curl -v [address]</pre>
<p>And something else became apparent. The full content of the page would come back, but there was a 6 second lag before the connection would finally close. After a little research on the Google, it turns out I&#8217;m not the only one who&#8217;s observed this with PHP and IIS: <a href="http://www.google.com/search?q=iis+php+response+lag">http://www.google.com/search?q=iis+php+response+lag</a></p>
<p>I would like to say I figured out why IIS was being so lame, but the in-house net-admin suggested moving the application to another production server on hand, where the issue mysteriously dissappeared. At that point, everyone was happy, so I didn&#8217;t look into it any further. I <em>did</em> read about some resolutions regarding DNS settings, and skipping name resolutions in the db configurations. That might have been it, but I&#8217;ll never know.</p>
<p><strong>Recap:</strong></p>
<p>Don&#8217;t willingly try this. That being said, everything worked out much better than it could have, and there were relatively easy solutions to the bumps along the way. If you have to put together a project like this, I highly suggest using some sort of database abstraction (or a framework like CodeIgniter), and planning out how you&#8217;ll work out URLs, permissions, and differing environments. Thinking these things over will save you a lot of time, and hopefully leave the stakeholders a whole lot happier.</p>
]]></content:encoded>
			<wfw:commentRss>http://codefury.net/2011/01/codeigniter-php-iis-mysql-mssql/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

