<?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>Michael Wales &#187; CodeIgniter</title>
	<atom:link href="http://www.michaelwales.com/category/codeigniter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.michaelwales.com</link>
	<description>Senior Developer Michael Wales, featuring articles on web development (PHP, Python and Ruby), industry highlights and open source software releases.</description>
	<lastBuildDate>Tue, 22 Mar 2011 04:04:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>CodeIgniter Presentations</title>
		<link>http://www.michaelwales.com/2010/12/codeigniter-presentations/</link>
		<comments>http://www.michaelwales.com/2010/12/codeigniter-presentations/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 07:16:54 +0000</pubDate>
		<dc:creator>Michael Wales</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Mercurial]]></category>

		<guid isPermaLink="false">http://www.michaelwales.com/?p=208</guid>
		<description><![CDATA[Some would call me crazy, but I love building presentations and speaking to others &#8211; especially in regards to subjects I care about. I recently had a reason to start building a deck discussing the benefits of version control systems, specifically distributed version control and Mercurial. I wanted to gather some non-biased opinions about the [...]]]></description>
			<content:encoded><![CDATA[<p>Some would call me crazy, but I <em>love</em> building presentations and speaking to others &#8211; especially in regards to subjects I care about. I recently had a reason to start building a deck discussing the benefits of <a href="http://en.wikipedia.org/wiki/Revision_control" title="Wikipedia: Revision Control">version control systems</a>, specifically <a href="http://en.wikipedia.org/wiki/Distributed_revision_control" title="Wikipedia: Distributed Revision Control">distributed version control</a> and <a href="http://mercurial.selenic.com/" title="Mercurial">Mercurial</a>.</p>
<p>I wanted to gather some non-biased opinions about the current state of the presentation, so I uploaded it to <a href="http://www.slideshare.net/" title="SlideShare">SlideShare</a> and sent out a tweet asking for people&#8217;s thoughts. In doing this, I stumbled across two of my older presentations: two years ago I gave a presentation at <a href="http://www.refreshaugusta.com/" title="RefreshAugusta">RefreshAugusta</a> on <a href="http://www.codeigniter.com/" title="CodeIgniter">CodeIgniter</a> and three years ago I created a presentation discussing why I loved freelancing within the CodeIgniter community so much (if I remember correctly this was at the request of <a href="http://www.ellislab.net/" title="EllisLab">EllisLab</a> but I can&#8217;t really recall).</p>
<p>Although I only have these three presentations to look back on, the contrast and comparisons between them couldn&#8217;t be more apparent. It&#8217;s fun to go back and see where you came from to learn where you have arrived. The first presentation, <a href="http://www.slideshare.net/walesmd/how-codeigniter-made-me-a-freelancer" title="SlideShare: How CodeIgniter Made Me a Freelancer">How CodeIgniter Made Me a Freelancer</a> was nothing more than a wall of text. Although the content itself is pretty solid, and reflective of my opinions of the CodeIgniter not only then but now, this is a horrible presentation to give out in front of people. Luckily, this was never presented publicly. On the other hand, my second presentation <a href="http://www.slideshare.net/walesmd/introduction-to-codeigniter-refreshaugusta-20-may-2009" title="SlideShare: Introduction to CodeIgniter">Introduction to CodeIgniter</a> was presented publicly. There&#8217;s still a lot of text to get through but the overall opinion of the crowd was pretty solid, there&#8217;s enough gimicky fun in there (the CodeIgniter code in the bottom-right of each slide) and some imagery. In fact, you can <a href="http://vimeo.com/4847215" title="Vimeo: RefreshAugusta - Michael Wales - Introduction to CodeIgniter">watch the video of me giving this presentation</a> still thanks to RefreshAugusta and <a href="http://www.vimeo.com/" title="Vimeo">Vimeo</a> and despite looking up at the screen more-so than I should have, I think I did a pretty decent job (plus, I was nervous as all hell).</p>
<p>My latest presentation, <a href="http://www.slideshare.net/walesmd/mercurial-beginners-v1" title="SlideShare: Mercurial - Beginniners (v1)">Mercurial: Beginners (v1)</a> is vastly different than either of the previous two presentations and honestly, I believe it&#8217;s for the better. In this latest presentation I simply tried to convey emotions and concepts with the slide. In building the slide, I already knew what I would be talking about during its presentation, but the nature of the discussion deserves a visual representation to really &#8220;bring it all home&#8221; to the participants.</p>
<p>I&#8217;d love to hear your comments on my most recent presentation (still in development), as well as those in the past, so I&#8217;ve included them all within the post below:</p>
<h4>Mercurial: Beginners (v1)</h4>
<div style="width:425px" id="__ss_6057021"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=hgbeginners-101207001403-phpapp01&#038;rel=0&#038;stripped_title=mercurial-beginners-v1&#038;userName=walesmd" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse6057021" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=hgbeginners-101207001403-phpapp01&#038;rel=0&#038;stripped_title=mercurial-beginners-v1&#038;userName=walesmd" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></div>
<h4>Introduction to CodeIgniter: RefreshAugusta (May 2009)</h4>
<div style="width:425px" id="__ss_1467565"><object id="__sse1467565" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=reaugustamay-codeigniter-090520194132-phpapp02&#038;stripped_title=introduction-to-codeigniter-refreshaugusta-20-may-2009&#038;userName=walesmd" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse1467565" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=reaugustamay-codeigniter-090520194132-phpapp02&#038;stripped_title=introduction-to-codeigniter-refreshaugusta-20-may-2009&#038;userName=walesmd" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></div>
<h4>Video &#8211; Introduction to CodeIgniter: RefreshAugusta (May 2009)</h4>
<p><iframe src="http://player.vimeo.com/video/4847215" width="400" height="230" frameborder="0"></iframe></p>
<h4>How CodeIgniter Made Me a Freelancer</h4>
<div style="width:425px" id="__ss_397679"><object id="__sse397679" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=codeigniter-freelance-1210424999823373-8&#038;stripped_title=how-codeigniter-made-me-a-freelancer&#038;userName=walesmd" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse397679" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=codeigniter-freelance-1210424999823373-8&#038;stripped_title=how-codeigniter-made-me-a-freelancer&#038;userName=walesmd" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></div>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelwales.com/2010/12/codeigniter-presentations/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CodeIgniter, The Honeymoon Phase is Over</title>
		<link>http://www.michaelwales.com/2010/11/codeigniter-the-honeymoon-phase-is-over/</link>
		<comments>http://www.michaelwales.com/2010/11/codeigniter-the-honeymoon-phase-is-over/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 18:27:29 +0000</pubDate>
		<dc:creator>Michael Wales</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>

		<guid isPermaLink="false">http://www.michaelwales.com/?p=171</guid>
		<description><![CDATA[A lot of things have been going on within the CodeIgniter community &#8211; well, let&#8217;s rephrase that &#8211; very little has been going on within the CodeIgniter community and this has brought about a lot of change over the course of this month. I&#8217;ve been actively involved in the community for a little over 3.5 [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of things have been going on within the <a href="http://www.codeigniter.com/" title="CodeIgniter">CodeIgniter</a> community &#8211; well, let&#8217;s rephrase that &#8211; <em>very little</em> has been going on within the CodeIgniter community and this has brought about <em>a lot</em> of change over the course of this month. I&#8217;ve been actively involved in the community for a little <a href="http://codeigniter.com/forums/member/48108/" title="CodeIgniter Forums: Michael Wales' Profile">over 3.5 years now</a>, worked with the framework for around 4 and served as <a href="http://codeigniter.com/news/codeigniter_community_chieftain_michael_wales/" title="CodeIgniter News: CodeIgniter Community Chieftain - Michael Wales">EllisLab&#8217;s first Community Chieftain</a> (a program <a href="http://codeigniter.com/news/whats_happening_now/" title="CodeIgniter News: What's Happening Now?">recently cancelled</a>). During this time I&#8217;ve learned a lot, met some excellent people and managed to cause enough of a ruckus that real careers, with real salaries, were just being handed to me. Yet, I look back on this past year and I haven&#8217;t had the faintest bit of interest in the community and it got me questioning, &#8220;Why?&#8221;</p>
<p><strong>It&#8217;s not due to lack of time.</strong> I&#8217;m more readily available now than I was during my military career. Over the past year I&#8217;ve actually managed to get myself more &#8220;connected&#8221; than I&#8217;ve ever been in my life (thank you Android-powered phone) &#8211; I&#8217;m literally on the Internet (actively and passively) 19-20 hours per day. I <em>could</em> count the few hours per day I sleep, but telling you I&#8217;m available 24 hours just kind of gets brushed off as if your boss was telling you his open door policy; 20 hours has meaning/impact.</p>
<p><strong>It&#8217;s not due to lack of use/programming.</strong> In 2009 I was hired by <a href="http://www.gdit.com/" title="General Dynamics Information Technology">General Dynamics IT</a> as a Senior Web Developer and we used CodeIgniter on a few of the applications we built. I now work for <a href="http://www.kforcegov.com/" title="Kforce Government Solutions">Kforce Government Solutions</a> and although not directly using CodeIgniter, a lot of the practices/influences from that framework reflect in the work I do. I still have my personal projects I work on and many of them use CodeIgniter.</p>
<p><strong>It&#8217;s not due to lack of opinion/concern.</strong> Just today there were about 10 of us working together to lay out a roadmap for the new <a href="http://codeigniter.com/news/the_official_codeigniter_community_branch/" title="CodeIgniter News: The Official CodeIgniter Community Branch">CodeIgniter Community Branch</a>, organized by <a href="http://hilsturgeon.co.uk/" title="Phil Sturgeon">Phil Sturgeon</a>. It became apparent very quickly, I still have very strong opinions of the direction CodeIgniter should be headed. There are concepts/ideas that I would love to see CodeIgniter implement, and there are lots of others, although interesting/nice to have I just don&#8217;t agree with being in-line with the framework&#8217;s goals.</p>
<p>I try to think back. When did I actually stop caring about what happened to CodeIgniter? The event that comes to mind was when <a href="http://jamieonsoftware.com/" title="Jamie Rumbelow">Jamie Rumbelow</a> was appointed Community Chieftain. Now, this has nothing to do with Jamie; nor about me no longer being the Community Chieftain. But, rather, it was the events leading up to that transition that put a bad taste in my mouth.</p>
<p>The role of Community Chieftain was not well-thought out, which was understood from the get-go. I approached <a href="http://derekderekderek.com/" title="Derek Jones">Derek Jones</a> telling him I wanted to be more involved than just being a user &#8211; that I had the time and passion to really help out. Derek had a similar concept he had been mulling around in his head so him and I fleshed out the position of Community Chieftain via email over the course of a week or so. It was known from the beginning that the position would be temporary and would primarily focus on forum moderation and working in the bug tracker. Over the course of my time as Community Chieftain I took on some other &#8220;fun&#8221; things, like the CodeIgniter Town Hall video chats, speaking at a few local conferences, and really focusing on the forum posts that didn&#8217;t receive replies. The job was a blast, I loved every minute of it but exhausting.</p>
<p>I no longer have the emails but I would estimate about 6 months before Jamie&#8217;s public announcement as the new Community Chieftain I was hitting a pretty low-point in my personal life. I emailed Derek at this time, explaining a lot of what was going on and informing him I would like to step-down, giving them time to select and announce a replacement. The selection of Jamie happened pretty quickly and then Jamie and I stood by for the announcement&#8230; and waited&#8230; and waited&#8230; and waited.</p>
<p>Now, EllisLab is a for-profit company &#8211; they&#8217;ve been pretty up-front from the start that their profit generating products are the focus (as they should be). This means, historically, CodeIgniter has been given the back-burner for quite awhile. The company didn&#8217;t focus on it much, instead leaving much of the community involvement up to the developers that were passionate about it (<a href="http://www.derekallard.com/" title="Derek Allard">Derek Allard</a> and <a href="http://www.dhorrigan.com/" title="Dan Horrigan">Dan Horrigan</a> specifically, both of which had personal projects built with CodeIgniter). But, I honestly think this one act of delaying the announcement, over and over, is what made me truly realize: <strong>EllisLab simply forgets about the CodeIgniter community, and often</strong>. It&#8217;s not like the announcement of Community Chieftain requires a significant amount of work: a few permissions within the ExpressionEngine control panel that manages codeigniter.com and a 5-minute blog post. No, the only excuse that makes any sense as to why it took so long is, &#8220;Whoops &#8211; I forgot.&#8221; It wasn&#8217;t until I got drunk and went off on a tirade during one of the CI Town Halls (not something I&#8217;m proud of and I personally apologized to all of EllisLab) that anyone knew Jamie was taking over &#8211; Derek then, finally, made the announcement as a measure of damage control.</p>
<p>We all know CodeIgniter was born from ExpressionEngine. The CMS was developed, then EllisLab ripped out the real guts-and-glory, cleaned it off and released it as CodeIgniter. So, when it was announced that ExpressionEngine was going to be rewritten, from the ground up, and based off the CodeIgniter framework us developers were excited. We had come full circle &#8211; we were now an integral part of EllisLab&#8217;s business plan. We were surely going to see more frequent updates rolling down; hell, we may even be able to improve ExpressionEngine &#8211; make it more efficient &#8211; and help out EllisLab with our volunteer work within the framework!</p>
<p>But, in our excitement we forgot one key thing: <strong>EllisLab simply forgets about the CodeIgniter community, and often</strong>. By being rolled into ExpressionEngine now, we have lost our identity. Whereas before, the framework had grown, evolved on its own and was vastly different than the precursor work within ExpressionEngine; now, we are one in the same. Rarely can you respond to, or resolve, an ExpressionEngine issue without involving the underlying framework? Do you duplicate effort now and involve both communities?</p>
<p>From a workload, source management view, rewriting ExpressionEngine on CodeIgniter simply made sense. The <em>work</em> can be completed in one location and it affects both codebases. But, from a community management standpoint, it does nothing to decrease the workload &#8211; in an odd twist, it actually doubles the workload by not changing the workload at all (thanks to duplicate effort). If the CodeIgniter community wasn&#8217;t around, EllisLab wouldn&#8217;t be tackling repetitive community tasks &#8211; &#8220;do this&#8221; for ExpressionEngine, okay no go and &#8220;do that again&#8221; for CodeIgniter. Monotony is a beast and that is all we are now, an echo of the ExpressionEngine community; and it is with the release of ExpressionEngine 2, that we see the beginning of the end for the CodeIgniter community.</p>
<p>I won&#8217;t go into the multitude of ways the CodeIgniter community is being ignored, there are numerous posts that explain it in more detail than I ever could (particularly given my extended absence) but I hope I can shed some light as to <em>why</em> it happened. EllisLab simply can not legitimize the time and expense in maintaining a redundant process. Sure, we may see some future releases of CodeIgniter, but only when those releases fall in line with what is best for ExpressionEngine; and this is the reason for the mockery of the Community Fork. EllisLab has decided to create this as an opportunity for the community to shape CodeIgniter, to implement your ideas into the framework and turn it into what you want. In reality, it&#8217;s a farce to give the community the illusion of control, the illusion of change, and the means in which to keep CodeIgniter suppressed so that it may run ExpressionEngine to the best of its ability.</p>
<p>Sadly, the &#8220;key players&#8221; within the CodeIgniter community just don&#8217;t care anymore. Those of us that were the loudest, and dare I say (without sounding like a braggart), most influential have resigned to taking our own little copies of CodeIgniter, tweaked and modified to perfection, into the depths of our own localhost and we&#8217;ll just toil away at our duties silently. Of the names that stick out in my head over the past 4 years (and I am sure I will forget some of you, please forgive me) just look:</p>
<ul>
<li><a href="http://derekallard.com/blog/post/new-challenges/" title="Derek Allard">Derek Allard</a>: The one person on the EllisLab team that <strong>always</strong> cared about CodeIgniter, left EllisLab at the beginning of September.</li>
<li><a href="http://dhorrigan.com/blog/article/the-future-of-me-and-codeigniter" title="Dan Horrigan">Dan Horrigan</a>: Left EllisLab at the end of October, working on FuelPHP</li>
<li><a href="http://philsturgeon.co.uk/news/2010/10/what-happens-next" title="Phil Sturgeon">Phil Sturgeon</a>: He&#8217;s learning Ruby, working on another PHP framework (FuelPHP) with Dan Horrigan, and continuing to develop his CodeIgniter applications for the time being.</li>
<li><a href="http://www.haughin.com/" title="Elliot Haughin">Elliot Haughin</a>: Although still using CodeIgniter in his daily work, the number of tutorials, blog posts and libraries coming from Elliot has diminished greatly. Apart from a post about a CodeIgniter conference, his last post in regards to CodeIgniter was when CodeIgniter 2.0 was announced in March.</li>
<li><a href="http://jamieonsoftware.com/" title="Jamie Rumbelow">Jamie Rumbelow</a>: I personally haven&#8217;t seen/heard much from Jamie in quite sometime and appears as if he successfully taken his CodeIgniter experience into the ExpressionEngine commercial market (nothing wrong with that at all).</li>
</ul>
<p>As for me, I&#8217;m perfectly content with hacking away for Uncle Sam, much of which are heavily JavaScript-based, Rich Internet Applications, for which I wrote my own PHP framework to deal with months ago. My personal projects in development were frozen at CodeIgniter 1.7.2 a long time ago and I don&#8217;t see any reason to upgrade to 2.0. For those projects not yet in development &#8211; I&#8217;m going to be checking out <a href="http://fuelphp.com/" title="FuelPHP">FuelPHP</a>.</p>
<p><strong>Edit:</strong><br />
Let me go ahead and restate, in case this isn&#8217;t obvious &#8211; this is not an attack on EllisLab. I think they are a great company with some amazing people working for them, many of which I consider friends and know more about me than I care to share with the public. But, as stated, they must also remain profitable and promoting the growth of a redundant community is not how they do that.</p>
<p><strong>Edit 2:</strong><br />
Added some clarification to Elliot Haughin&#8217;s current situation involving his work with CodeIgniter &#8211; thanks for the clarification Elliot!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelwales.com/2010/11/codeigniter-the-honeymoon-phase-is-over/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Mirror Django&#8217;s get_object_or_404 in CodeIgniter</title>
		<link>http://www.michaelwales.com/2010/04/mirror-djangos-get_object_or_404-in-codeigniter/</link>
		<comments>http://www.michaelwales.com/2010/04/mirror-djangos-get_object_or_404-in-codeigniter/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 13:52:27 +0000</pubDate>
		<dc:creator>Michael Wales</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.michaelwales.com/?p=147</guid>
		<description><![CDATA[Django has an excellent function that assists in working with models, get_object_or_404. As Python functions tend to, the name of this function is pretty descriptive: we attempt to get an object (from the model) and if we can&#8217;t we throw a 404 error to the user. We can achieve a rather similar effect, and clean [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.djangoproject.com/" title="Django">Django</a> has an excellent function that assists in working with models, <code>get_object_or_404</code>. As <a href="http://www.python.org/" title="Python">Python</a> functions tend to, the name of this function is pretty descriptive: we attempt to get an object (from the model) and if we can&#8217;t we throw a 404 error to the user.</p>
<p>We can achieve a rather similar effect, and clean up our code, within a <a href="http://www.codeigniter.com/" title="CodeIgniter">CodeIgniter</a> controller. In the following example, we&#8217;ll load a model and attempt to retrieve a record, throwing a 404 error if the request fails:</p>
<script type="text/javascript" src="http://gist.github.com/376555.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/04/mirror-djangos-get_object_or_404-in-codeigniter/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<p>The other key component to this is the model itself, ensuring a value interpreted as FALSE is returned when an object can not be found. Here&#8217;s a quick sample:</p>
<script type="text/javascript" src="http://gist.github.com/376544.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/04/mirror-djangos-get_object_or_404-in-codeigniter/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<p><code>NULL</code> (along with <code>FALSE</code>, <code>0</code>, and an empty string) are all interpreted as <code>FALSE</code> by PHP in a loose comparison (<code>==</code> as opposed to <code>===</code>). When assigning a value to a variable using the <code>OR</code> operator, PHP will assign the first value that is interpreted as <code>TRUE</code> or the last value within the condition. Since our model will return <code>NULL</code> if a record is not found, PHP attempts to assign the return value of <code>show_404()</code> to that variable. This function doesn&#8217;t return a value though, instead it send your application&#8217;s <samp>./errors/error_404.php</samp> (with appropriate headers) to the user &#8211; the exact functionality we desire!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelwales.com/2010/04/mirror-djangos-get_object_or_404-in-codeigniter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CodeIgniter 2.0 and Mercurial Transition</title>
		<link>http://www.michaelwales.com/2010/03/codeigniter-2-0-and-mercurial-transition/</link>
		<comments>http://www.michaelwales.com/2010/03/codeigniter-2-0-and-mercurial-transition/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 19:03:35 +0000</pubDate>
		<dc:creator>Michael Wales</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.michaelwales.com/?p=133</guid>
		<description><![CDATA[EllisLab has just announced they have transitioned away from Subversion to Mercurial and are hosting the CodeIgniter 2.0 source on Bitbucket. I did a quick glance through the source and here are some of the things I immediately noticed in CodeIgniter 2.0 (this isn&#8217;t a comprehensive list, just what I find the most exciting): Scaffolding [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ellislab.com/" title="EllisLab">EllisLab</a> has <a href="http://codeigniter.com/news/ellislab_moves_to_mercurial_assembla_bitbucket_codeigniter_2.0_baking/" title="CodeIgniter 2.0 Baking">just announced</a> they have transitioned away from Subversion to Mercurial and are hosting the <a href="http://bitbucket.org/ellislab/codeigniter/" title="CodeIgniter 2.0 on Bitbucket">CodeIgniter 2.0 source on Bitbucket</a>.</p>
<p>I did a quick glance through the source and here are some of the things I immediately noticed in CodeIgniter 2.0 (this isn&#8217;t a comprehensive list, just what I find the most exciting):</p>
<ul>
<li>Scaffolding has finally been completely removed.</li>
<li>The <samp>codeigniter</samp> directory has been renamed to <samp>core</samp> and houses most of the absolute necessities. [<a href="http://bitbucket.org/ellislab/codeigniter/src/tip/system/core/">source</a>]</li>
<li>System-wide plugins are gone (they were mostly worthless to begin with).</li>
<li>There&#8217;s a new Javascript library that features a driver system, similar to the database libraries. <a href="http://www.jquery.com/" title="jQuery">jQuery</a> is currently supported but expect to see more. [<a href="http://bitbucket.org/ellislab/codeigniter/src/tip/system/libraries/Javascript.php">source</a>]</li>
<li>A driver library has been added, to assist developer in creating their own driver-backed libraries. [<a href="http://bitbucket.org/ellislab/codeigniter/src/tip/system/libraries/Driver.php">source</a>]</li>
<li>You can now enable/disable individual sections of the profiler (it&#8217;s also it&#8217;s own class, rather than being part of the output library).[<a href="http://bitbucket.org/ellislab/codeigniter/src/tip/system/libraries/Profiler.php">source</a> | <a href="http://bitbucket.org/ellislab/codeigniter/src/tip/system/application/config/profiler.php">source</a>]</li>
<li>There&#8217;s a new security library that features CSRF protection and becomes the new home for XSS filtering. [<a href="http://bitbucket.org/ellislab/codeigniter/src/tip/system/libraries/Security.php">source</a>]</li>
<li>The Input, Upload and XML-RPC libraries have received new features and make use of the security library.</li>
<li>The Cookie helper now utilizes the Input class. [<a href="http://bitbucket.org/ellislab/codeigniter/src/tip/system/helpers/cookie_helper.php">source</a>]</li>
<li>The application directory now contains a <samp>third_party</samp> directory, I presume would take the place of the old plugins directory. [<a href="http://bitbucket.org/ellislab/codeigniter/src/tip/system/application/third_party/">source</a>]</li>
</ul>
<p>I&#8217;m most excited about the new Security library but can&#8217;t wait to see how this release shapes up! What are you most looking forward to in CodeIgniter 2.0?</p>
<p><strong>Edit:</strong> <a href="http://philsturgeon.co.uk/news/2010/03/codeigniter-2" title="Phil Sturgeon: CodeIgniter 2">Phil Sturgeon</a> and <a href="http://www.haughin.com/2010/03/11/codeigniter-2-critical-changes-implications/" title="Elliot Haughin: CodeIgniter 2 Critical Changes Implications">Elliot Haughin</a> have provided their run-downs of CodeIgniter changes as well. One of the biggest changes I missed was the fact that CodeIgniter 2.0.0 functionality is not guaranteed to work in PHP4 and by CodeIgniter 2.1.0, legacy features will no longer be guaranteed to work in PHP4 either.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelwales.com/2010/03/codeigniter-2-0-and-mercurial-transition/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Protecting Controllers with ErkanaAuth</title>
		<link>http://www.michaelwales.com/2010/02/protecting-controllers-with-erkanaauth/</link>
		<comments>http://www.michaelwales.com/2010/02/protecting-controllers-with-erkanaauth/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 02:37:22 +0000</pubDate>
		<dc:creator>Michael Wales</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[authorization library]]></category>
		<category><![CDATA[ErkanaAuth]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.michaelwales.com/?p=81</guid>
		<description><![CDATA[ErkanaAuth, although in a very alpha form, is simple to use and already extremely powerful. Protecting a portion of your website behind the authentication system is as easy as one-line, a call to the library&#8217;s required() method. In this example, we are protecting an entire controller behind the authentication library: When a method within this [...]]]></description>
			<content:encoded><![CDATA[<p class="aligncenter"><img src="http://www.michaelwales.com/wp-content/uploads/2010/02/erkanaauth-banner.png" alt="ErkanaAuth" title="ErkanaAuth" width="696" height="230" /></p>
<p><a href="http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/" title="ErkanaAuth">ErkanaAuth</a>, although in a very alpha form, is simple to use and already extremely powerful. Protecting a portion of your website behind the authentication system is as easy as one-line, a call to the library&#8217;s <code>required()</code> method.</p>
<p>In this example, we are protecting an entire controller behind the authentication library:</p>
<script type="text/javascript" src="http://gist.github.com/296829.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/protecting-controllers-with-erkanaauth/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<p>When a method within this controller is called, the user&#8217;s session will be validated. If the user has not authenticated they will then be forwarded to your application&#8217;s <code>accounts</code> controller, where your login and user creation methods should reside.</p>
<p>To protect individual methods, just call the <code>required()</code> method in the first line of the method you want to protect.</p>
<script type="text/javascript" src="http://gist.github.com/296834.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/protecting-controllers-with-erkanaauth/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelwales.com/2010/02/protecting-controllers-with-erkanaauth/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Basic Pattern Matching Form Validation in CodeIgniter</title>
		<link>http://www.michaelwales.com/2010/02/basic-pattern-matching-form-validation-in-codeigniter/</link>
		<comments>http://www.michaelwales.com/2010/02/basic-pattern-matching-form-validation-in-codeigniter/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 18:03:21 +0000</pubDate>
		<dc:creator>Michael Wales</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[form validation]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.michaelwales.com/?p=86</guid>
		<description><![CDATA[CodeIgniter comes with an excellent Form Validation library right out of the box. This library features a number of validation and preparation functions that are executed on posted form fields when the run() method is called. If you need additional functionality, it is also very easy to add your own validation/preparation functions to your application, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.michaelwales.com/wp-content/uploads/2010/02/regex.jpg" alt="Regular Expressions" title="Regular Expressions" width="200" height="200" class="alignright" /><a href="http:/www.codeigniter.com/" title="CodeIgniter">CodeIgniter</a> comes with an excellent <a href="http://codeigniter.com/user_guide/libraries/form_validation.html" title="CodeIgniter User Guide: Form Validation">Form Validation</a> library right out of the box. This library features a number of validation and preparation functions that are executed on posted form fields when the <code>run()</code> method is called. If you need additional functionality, it is also very easy to add your own validation/preparation functions to your application, without modifying any of the underlying CodeIgniter codebase.</p>
<p>If you have a decent level of experience with Microsoft&#8217;s Excel, you may have had to develop a custom cell format from time to time. This basic format syntax provides a very loose, but functional, method of defining the format of the input you expect. In this tutorial, we&#8217;ll define a new form field validation rule (called <code>matches_pattern</code>) that excepts one argument that will define the pattern we want the user&#8217;s input to match. Our goal is to make something very simple to use, but moderately powerful, so we&#8217;re going to stay away from having to use regular expressions within our validation rules. Instead, we&#8217;ll create a set of replacement characters to use within our rules instead: <code>#</code> to represent a number, <code>?</code> to represent an alphabetical character and <code>~</code> to represent any character.</p>
<p>These characters will allow us to validate a user&#8217;s input matches specific cases. For instance, phone numbers could be forced to match <code>(###) ###-####</code> or a date field could be forced to match <code>##-##-####</code> (MM-DD-YYYY).</p>
<p>The first step in extending CodeIgniter&#8217;s Form Validation library is to create our own Form Validation class within our applications <samp>libraries/</samp> directory. By default, the prefix for your own extending classes is <samp>MY_</samp>, so we&#8217;ll create <samp>libraries/MY_Form_validation.php</samp> and stub out the following code:</p>
<script type="text/javascript" src="http://gist.github.com/314719.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/basic-pattern-matching-form-validation-in-codeigniter/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<p>We've now extended the default Form Validation library and we have a function, called <code>matches_pattern()</code> that we can call from our <code>set_rules()</code> method. Let's start fleshing out this method and translating our characters into their regular expression equivalents:</p>
<script type="text/javascript" src="http://gist.github.com/314739.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/basic-pattern-matching-form-validation-in-codeigniter/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<p>We're now using <code>str_replace()</code> to translate our special characters into their regular expression equivalents. Finally, we run through <code>preg_match()</code> and return a boolean as to whether the user input (<code>$str</code>) matches. You may wonder why we're just not returning the value of <code>preg_match()</code>. Unfortunately, <code>preg_match()</code> returns a <samp>1</samp> or <samp>0</samp> (at least on my development server) and CodeIgniter expects an explicit boolean, therefore we run it through the conditional really quick.</p>
<p>Our last step is escaping some of the standard regular expression special characters. In regular expressions, characters like <samp>(</samp>, <samp>)</samp>, <samp>[</samp> and many others have special meanings. We don't want to make use of these special meanings within our patterns though; if our patterns contains an <samp>(</samp> we literally want to match on that character (rather than capturing a successful match). We'll implement this by modifying our character arrays and replacing these special characters with their escaped versions:</p>
<script type="text/javascript" src="http://gist.github.com/314747.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/basic-pattern-matching-form-validation-in-codeigniter/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<p>The final step in this process is to define the error message that is reported when our validation function returns <code>FALSE</code>. This is done by defining your own language file within your application at <samp>language/english/form_validation_lang.php</samp>. The content within this file will be appended to CodeIgniter default <samp>form_validation_lang.php</samp> file:</p>
<script type="text/javascript" src="http://gist.github.com/314751.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/basic-pattern-matching-form-validation-in-codeigniter/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<p>The <code>%s</code> within this language definition will be replaced by the field name in which you include this rule. To use our new rule, we just append it to the rule set for any of our fields within our controller:</p>
<script type="text/javascript" src="http://gist.github.com/314757.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/basic-pattern-matching-form-validation-in-codeigniter/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<p>It's very easy to create your own validation rules. If you find yourself writing callback functions to do the same things over and over, consider bringing that function out into your own Form Validation library. The <code>matches_pattern()</code> function we wrote here provides an easy-to-use, yet simple, way to match a specific pattern - just remember to inform your users of what that pattern is! If you wanted, you could an include another <code>%s</code> within your language definition that would insert the specific pattern in the error message.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelwales.com/2010/02/basic-pattern-matching-form-validation-in-codeigniter/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>ErkanaAuth Version 2.0a</title>
		<link>http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/</link>
		<comments>http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 16:57:49 +0000</pubDate>
		<dc:creator>Michael Wales</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[authorization library]]></category>
		<category><![CDATA[BSD license]]></category>
		<category><![CDATA[ErkanaAuth]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://www.michaelwales.com/?p=43</guid>
		<description><![CDATA[In November 2007 I released an authentication library for CodeIgniter named ErkanaAuth. It was very simple to use since it just provided a few methods to make authentication simpler for you &#8211; it didn&#8217;t hijack the entire process. The post announcing that library, and the code, has long since been lost but you can still [...]]]></description>
			<content:encoded><![CDATA[<p class="aligncenter"><img src="http://www.michaelwales.com/wp-content/uploads/2010/02/erkanaauth-banner.png" alt="ErkanaAuth" title="ErkanaAuth" width="696" height="230" /></p>
<p>In November 2007 I released an authentication library for <a href="http://www.codeigniter.com/" title="CodeIgniter">CodeIgniter</a> named ErkanaAuth. It was very simple to use since it just provided a few methods to make authentication simpler for you &#8211; it didn&#8217;t hijack the entire process. The post announcing that library, and the code, has long since been lost but you can still read the original post thanks to <a href="http://web.archive.org/web/20071111145023/http://www.michaelwales.com/2007/10/erkana-codeigniter-authorization-library/" title="Wayback Machine: Michael Wales - Erkana CodeIgniter Authorization Library">Archive.org&#8217;s Wayback machine</a>.</p>
<p>Recently, I&#8217;ve taken on a personal project of a rather grand-scale and have started factoring out the authentication logic into a library of it&#8217;s own, which I am referring to as ErkanaAuth 2.0. I am now releasing the library in its current state which is <strong>vastly unfinished</strong>! Nonetheless, I would love to hear your thoughts on the direction the library is headed and features you would like to see.</p>
<p>I don&#8217;t think I can reiterate this enough at this point in time, this is <strong>hardcore alpha</strong> &#8211; I should have called this <em>ErkanaAuth Version 2.0ha-dont-fucking-use-me-in-production-code</em>. I mean, in theory you could use this, and if its a library you want to use in future applications I strongly encourage you to give it a go. The authentication mechanism is secure but the library as a whole is sorely lacking in features at this point and is pretty hard-coded to a strict environment.</p>
<h4>Features</h4>
<ul>
<li>Authentication via username or email address and password.</li>
<li>Account creation using username or email address as unique identifier.</li>
<li>Locking of controllers/methods to logged-in users in one line.</li>
<li>Passwords are hashed with a salt prior to storing in the database.</li>
<li>User token stored in session is a hashed representation of the user&#8217;s ID and their password hash. Encrypting the session cookie via CodeIgniter&#8217;s <samp>config/config.php</samp> file adds another layer of security against altered session data.</li>
</ul>
<h4>Planned Features</h4>
<ul>
<li>Exponential delay on failed login attempts.</li>
<li>Group-based authorization system.</li>
<li>Require email validation on account creation.</li>
<li>Optional Captcha on account creation.</li>
<li>Linking of Facebook / Twitter authentication to Erkana Auth Account.</li>
<li>Forgotten password resets.</li>
<li>Extensive account API for building of authentication administration panels.</li>
<li>Extensive group API for building of authorization administration panels.</li>
</ul>
<h4>Installation</h4>
<p>The downloadable package includes a number of directories and files within those directories. It is advised to extract the archive in a temporary location, ensure there are no naming conflicts with your current application and then move the directories into your CodeIgniter application&#8217;s directory. The most common naming conflict will be with the <samp>models/account.php</samp> file. The list of files included are:</p>
<ul>
<li><samp>helpers/erkana_auth_helper.php</samp></li>
<li><samp>language/english/erkana_auth_lang.php</samp></li>
<li><samp>libraries/Erkana_auth.php</samp></li>
<li><samp>models/account.php</samp></li>
<li><samp>sql/1-create_accounts_email.sql</samp></li>
<li><samp>sql/1-create_accounts_username.sql</samp></li>
</ul>
<p>After installing the library within your application directory you must decide whether your application will authenticate based on username/password or email/password and run the correct SQL file on your database schema. This file will create a table named <code>accounts</code>, the statement run by <samp>sql/1-create_accounts_email.sql</samp> is:</p>
<script type="text/javascript" src="http://gist.github.com/294774.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<p>If you run <samp>sql/1-create_accounts_username.sql</samp> the following statement will be executed:</p>
<script type="text/javascript" src="http://gist.github.com/294777.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<h4>Usage</h4>
<p>ErkanaAuth aims to be as simple as possible in its usage. As of this version, this is primarily due to the limited scope of its functionality, but the overall feel for the library will differ as little as possible from what can be seen as of now. Many of the limitations on the library (i.e., strict naming of form fields) will be corrected as development continues.</p>
<p>ErkanaAuth does not assist in the creation of any front-end related code (i.e., user registration forms, login forms) at this time. ErkanaAuth simply provides a powerful set of methods to be used within your controllers to assist in getting an authentication system up and running as quickly as possible. Additionally, there is a helper function to display useful error messages to your users for invalid form submissions.</p>
<h5>Creating a User</h5>
<p>The <code>create_account()</code> method accepts a single string parameter of either <code>email</code> (default) or <code>username</code>, which should reflect the authentication mechanism you opted for during the installation and execution of the SQL file earlier. This method will return <code>TRUE</code> or <code>FALSE</code> if the user was created and can be used similarly as to how the standard <code>form_validation</code> library is used.</p>
<p>The library currently requires the following form fields to be present with the corresponding rulesets:</p>
<ul>
<li><code>email</code>: Only if you select the email authentication mechanism (<code>required|max_length[120]|valid_email|trim</code>)</li>
<li><code>username</code>: Only if you select the username authentication mechanism (<code>required|min_length[4]|max_length[20]|trim</code>)</li>
<li><code>password</code>: Always required (<code>required|matches[passwordconf]</code>)</li>
<li><code>passwordconf</code>: Always required (<code>required</code>)</li>
</ul>
<p>The controller method that displays and processes your account creation form should call the <code>create_account()</code> method and redirect on <code>TRUE</code>, otherwise loading the view file that contains your account creation form. In the following example, the user is redirected to <code>accounts/index()</code> which would display our login form.</p>
<script type="text/javascript" src="http://gist.github.com/294795.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<h5>Validating a User&#8217;s Login Credentials</h5>
<p>The <code>validate_login()</code> method accepts a single string parameter of either <code>email</code> (default) or <code>username</code>, which should reflect the authentication mechanism you opted for during the installation and execution of the SQL file earlier. This method will return <code>TRUE</code> or <code>FALSE</code> if the credentials are valid and can be used similarly as to how the standard <code>form_validation</code> library is used.</p>
<p>The library currently requires the following form fields to be present:</p>
<ul>
<li><code>email</code>: Only if you select the email authentication mechanism</li>
<li><code>username</code>: Only if you select the username authentication mechanism</li>
<li><code>password</code>: Always required</li>
</ul>
<p>The controller method that displays and processes your login form should call the <code>validate_login()</code> method and redirect on <code>TRUE</code>, otherwise loading the view file that contains your login form. In the following example, the user is redirected to <code>announcements/index()</code> which would display a &#8220;dashboard&#8221; like page and only be accessible to logged in users.</p>
<script type="text/javascript" src="http://gist.github.com/294803.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<h5>Validating a User&#8217;s Logged-in Status at Page Load</h5>
<p>The <code>required()</code> method provides a simple, one-line, way to validate a user&#8217;s session and ensure the user is logged into a valid account. This line should be placed within the constructor of any controller class you would like to complete protect or as the first line of a method you would like to protect. The following example is a controller named <code>Announcements</code> that currently only has its <code>index()</code> method protected. Any other methods added to this controller would not be protected without either moving the <code>required()</code> method to the constructor or placing a call to the <code>required()</code> method within the controller methods themselves.</p>
<script type="text/javascript" src="http://gist.github.com/294808.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<h5>Displaying Errors on Invalid Form Submissions</h5>
<p>The library includes a helper with the function <code>authentication_errors()</code> to assist in displaying errors upon form submission. This function will return all errors, delimited by a <code><br /></code>. If there are no errors, <code>NULL</code> is returned. In the following example, we are displaying a login form that will display errors at the top of the form if any exist from prior submission attempts:</p>
<script type="text/javascript" src="http://gist.github.com/294816.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<h4>Technical Details</h4>
<p>During account creation an alphanumeric string is randomly generated to serve as the user&#8217;s salt. This salt is then hashed with the user&#8217;s password and the resulting hash is stored in the database to validate against.</p>
<p>On a login attempt, the database is queried for a record based on your authentication mechanism (email or username). That record is then compared against the user submitted data for validation. On a successful validation, session variables are stored consisting of the record&#8217;s <code>id</code> and a hash of the record&#8217;s <code>id</code> field and <code>password_hash</code> field.</p>
<p>When a user visits a protected page the session is first checked for the variables that are set by a successful login. If these session variables exist, the database is queried for the record identified. If this record exists, the session is further validated by comparing the stored hash of the record&#8217;s <code>id</code> and <code>password_hash</code> with the data that is stored in the record.</p>
<h4>Download</h4>
<p><a href="http://www.michaelwales.com/wp-content/uploads/2010/02/erkana_auth-2.0a.zip">Erkana Auth 2.0a is available for download</a>. At this early stage of development a version control repository has not been made publicly available. In the future, Subversion and Git repositories will be made available.</p>
<h4>License</h4>
<p>ErkanaAuth 2.0a is licensed under the BSD License as defined by the <a href="http://creativecommons.org/licenses/BSD/">Human-Readable Creative Commons Deed</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Packt Publishing&#8217;s CodeIgniter 1.7 Review</title>
		<link>http://www.michaelwales.com/2010/02/packt-publishings-codeigniter-1-7-review/</link>
		<comments>http://www.michaelwales.com/2010/02/packt-publishings-codeigniter-1-7-review/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 10:00:45 +0000</pubDate>
		<dc:creator>Michael Wales</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[packt publishing]]></category>

		<guid isPermaLink="false">http://www.michaelwales.com/?p=30</guid>
		<description><![CDATA[In mid-December I was asked by Packt Publishing to read and review their latest CodeIgniter book, ingeniously titled CodeIgniter 1.7, by Jose Argudo and David Upton. As you all know, my blog has been down for quite some time; although, I read the book (and subsequently gave it away to a friend), I am just [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.michaelwales.com/wp-content/uploads/2010/02/packtpub-codeigniter.jpg"><img src="http://www.michaelwales.com/wp-content/uploads/2010/02/packtpub-codeigniter-243x300.jpg" alt="Pack Publishing: CodeIgniter 1.7" title="Packt Publishing: CodeIgniter 1.7" width="122" height="150" class="alignright" /></a>In mid-December I was asked by <a href="http://www.packtpub.com/" title="Packt Publishing">Packt Publishing</a> to read and review their latest CodeIgniter book, ingeniously titled <a href="http://www.packtpub.com/improve-coding-productivity-with-codeigniter-1-7?utm_source=michaelwales.com&#038;utm_medium=bookrev&#038;utm_content=blog&#038;utm_campaign=mdb_001849" title="Packt Publishing: CodeIgniter 1.7"><em>CodeIgniter 1.7</em></a>, by Jose Argudo and David Upton. As you all know, my <a href="http://www.michaelwales.com/2010/02/blog-back-up-and-running/" title="Michael Wales: Blog Back Up and Running">blog has been down</a> for quite some time; although, I read the book (and subsequently gave it away to <a href="http://blog.johnpantoja.com/" title="Web Developer: John Pantoja">a friend</a>), I am just now able to write the promised review.</p>
<p>This book targets the absolute beginner developer and it does an adequate job filling the niche, as previous CodeIgniter books on the market are drastically outdated. Unfortunately, I don&#8217;t feel this book differentiates itself significantly from the well-written <a href="http://www.codeigniter.com/user_guide/" title="CodeIgniter User Guide">CodeIgniter User Guide</a> and many people who buy this book will feel as if they have been cheated out of $36.</p>
<p>Chapters 1-3 explain what frameworks are, what CodeIgniter can do for you, how to get up and running with CodeIgniter and the basics of the MVC development pattern. It&#8217;s not until Chapter 4 that we discover some truly unique CodeIgniter content with the Active Record pattern, but it doesn&#8217;t last as we drop back to some pretty basic HTML material in Chapter 5 as we build out some forms.</p>
<p>The rest of the book does a very good job of reiterating the content outlined in the user guide, ranging from sessions and security to the XML-RPC library. There&#8217;s even a bit of content on the Cart library which is a welcome addition since it&#8217;s relatively new.</p>
<p>The shining star for this book though is Chapter 7, <em>CodeIgniter and Objects</em>. Argudo and Upton do an amazing job describing the CodeIgniter super-global object, as well as explaining copying by reference in plain English. Unfortunately, it just kind of creeps up on you out of nowhere with very little lead in or warning that <strong>shit&#8217;s about to get deep</strong>. It&#8217;s a worthy addition to the book though and serves its purpose in separating the &#8220;restating the easy stuff from the user guide&#8221; from the &#8220;restating the object oriented stuff from the user guide&#8221; sections of the book.</p>
<p>All in all, if you feel as if you need the user guide read off to you in plain English, by all means buy this book. There&#8217;s nothing else on the market today that will explain virtually every aspect of the framework to you as a beginner. If you&#8217;re comfortable in reading and understanding the user guide, possibly with a bit of help from the <a href="http://www.codeigniter.com/forums/" title="CodeIgniter Forums">CodeIgniter Forums</a>, you&#8217;re going to want to pass.</p>
<p>Last but not least, this is one of the few books whose eBook version actually provides a legitimate value (other than just being a good option for the broke audience). If you fall between the two aforementioned groups (i.e., you are comfortable with the user guide but you don&#8217;t quite understand the CodeIgniter object model or how to best write your own libraries) <strong>buy the eBook now</strong>. You&#8217;re going to save some money and Chapters 7-9 and 15 are well worth the $28 price tag.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelwales.com/2010/02/packt-publishings-codeigniter-1-7-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What does HipHop PHP mean for CodeIgniter?</title>
		<link>http://www.michaelwales.com/2010/02/what-does-hiphop-php-mean-for-codeigniter/</link>
		<comments>http://www.michaelwales.com/2010/02/what-does-hiphop-php-mean-for-codeigniter/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 01:51:13 +0000</pubDate>
		<dc:creator>Michael Wales</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[HipHop]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.michaelwales.com/?p=14</guid>
		<description><![CDATA[Facebook announced their open source project HipHop PHP yesterday and the web development community has been in a whirlwind of discussion about what this means, particularly for the PHP community. HipHop PHP is essentially a compiler (although Facebook calls it a transformer) from PHP to C++. Only a subset of PHP functionality is compatible with [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.michaelwales.com/wp-content/uploads/2010/02/HipHop_logo_white.png" alt="HipHop PHP Logo" title="HipHop PHP Logo" width="213" height="278" class="alignright" /><a href="http://www.facebook.com/" title="Facebook">Facebook</a> announced their open source project <a href="http://developers.facebook.com/news.php?blog=1&#038;story=358" title="Facebook Developer Blog: HipHop for PHP">HipHop PHP</a> yesterday and the web development community has been in a whirlwind of discussion about what this means, particularly for the PHP community.</p>
<p>HipHop PHP is essentially a compiler (although Facebook calls it a transformer) from PHP to C++. Only a subset of PHP functionality is compatible with the compiler but the developers say they only omitted some of the lesser used functions like <code>eval()</code>. The C++ code is truly cross-platform and can be compiled and run on virtually any server, the primary benefit being decreased CPU usage and therefore increased speed when delivering content to the end-user.</p>
<p>So, what does this mean for the CodeIgniter community? In short, <strong>absolutely nothing</strong>. Most CodeIgniter developers are building applications that will run on shared hosts, virtual private servers or a cloud-based virtualization system. Of that very large group of our community, an extremely small number have the capability to compile the HipHop binaries or alter their configuration in order to serve HipHop pages.</p>
<p>There are a very small number of CodeIgniter applications that are running on a couple of dedicated servers. Even these developers have no need for HipHop! The performance benefits gained by running HipHop on these server would be marginal at best, if even noticeable. These sites just don&#8217;t have the traffic to see measurable gains in performance by focusing on CPU usage. Their time is much better spent focusing on the standard bottleneck: input/output (database queries and caching of output).</p>
<p class="aligncenter"><a href="http://www.michaelwales.com/wp-content/uploads/2010/02/facebook-com_uv_1y.png"><img src="http://www.michaelwales.com/wp-content/uploads/2010/02/facebook-com_uv_1y.png" alt="Facebook 2009 Growth" title="Facebook 2009 Growth" width="600" height="198" /></a></p>
<p>It wasn&#8217;t until two years ago Facebook had enough traffic to make optimizing CPU usage a worthwhile focus of developer time. <a href="http://www.compete.com/" title="Compete">Compete</a> won&#8217;t let me go back and look at traffic two years ago but I think the graph above speaks for itself: Facebook has more than doubled its monthly unique visitors in the past year. Most of us will be lucky to see .01% of that traffic on our applications (to put it more in perspective, <a href="http://www.codeigniter.com/" title="CodeIgniter">codeigniter.com</a> currently received .03% the traffic Facebook does).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelwales.com/2010/02/what-does-hiphop-php-mean-for-codeigniter/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  www.michaelwales.com/category/codeigniter/feed/ ) in 0.30117 seconds, on Feb 4th, 2012 at 1:54 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 4th, 2012 at 2:54 am UTC -->
