<?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>Beyond Coding &#187; CodeIgniter</title>
	<atom:link href="http://www.beyondcoding.com/category/php/codeigniter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.beyondcoding.com</link>
	<description>Follow us on Twitter: @fredwu and @scotti3g</description>
	<lastBuildDate>Sun, 08 Aug 2010 23:27:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Choosing a PHP Framework Round 2: Yii vs Kohana vs CodeIgniter</title>
		<link>http://www.beyondcoding.com/2009/03/02/choosing-a-php-framework-round-2-yii-vs-kohana-vs-codeigniter/</link>
		<comments>http://www.beyondcoding.com/2009/03/02/choosing-a-php-framework-round-2-yii-vs-kohana-vs-codeigniter/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 06:09:45 +0000</pubDate>
		<dc:creator>Fred Wu</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Kohana]]></category>
		<category><![CDATA[Yii]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[php framework]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.beyondcoding.com/?p=260</guid>
		<description><![CDATA[It was over a year ago that I wrote the article that compares CodeIgniter and Kohana. Since then both CodeIgniter and Kohana have seen major progress with the release of CodeIgniter 1.7.0 and Kohana 2.3. In December 2008, a new PHP framework called Yii has been released to the public with a stable 1.0. There [...]]]></description>
			<content:encoded><![CDATA[<p>It was over a year ago that I wrote <a href="http://www.beyondcoding.com/2008/02/23/notes-on-choosing-a-php-framework-a-quick-comparison-of-codeigniter-and-kohana/">the article that compares CodeIgniter and Kohana</a>. Since then both CodeIgniter and Kohana have seen major progress with the release of <a href="http://www.derekallard.com/blog/post/codeigniter-170-released/">CodeIgniter 1.7.0</a> and <a href="http://learn.kohanaphp.com/2008/08/09/kohana-22-released/">Kohana 2.3</a>.</p>
<p>In December 2008, a new PHP framework called <a href="http://www.yiiframework.com/">Yii</a> has been released to the public with a stable 1.0. There were a lot of new PHP framework released in 2008, but Yii was one of the more recognised ones because:</p>
<ul>
<li>The author, Qiang Xue, is the author of the well established <a href="http://www.xisc.com/">PRADO framework</a>.</li>
<li>It is a simple to use, well organised, PHP 5 only MVC framework.</li>
<li>It claims to have <a href="http://www.yiiframework.com/performance/">astonishing performance</a>.</li>
</ul>
<p>Before I start this round of comparison, let me briefly list my experience with these frameworks, so you may interpret this article with your own judgement.</p>
<p><strong>CodeIgniter:</strong> I started using CodeIgniter since its version 1.2.x from a few years ago. During the past few years I have worked on projects mainly using version 1.5.x and 1.6.x. I have now stopped using CodeIgniter in favour of using other PHP 5 only frameworks.</p>
<p><strong>Kohana:</strong> I first started using Kohana when it was called BlueFlame back when it was first forked out of CodeIgniter. Since then I have lurked and participated in the Kohana community. All of my recent projects are done in Kohana.</p>
<p><strong>Yii:</strong> The 1.0 release of Yii had my attention, but I didn&#8217;t really dive into it until about now. However, most of my impressions on Yii are based on its <a href="http://www.yiiframework.com/doc/">documentation</a> and <a href="http://daniel.carrera.bz/2009/01/comparison-of-php-frameworks-part-i/">this article by Daniel</a>.</p>
<p>Let&#8217;s see how they compare with each other.</p>
<p><small>Same notes as before: Grading scale: Limited < Fair < Good < Excellent. If a feature is not available in the distributed package, but is available via 3rd party libraries, I will state that in the comparison. If a feature is available both in the distributed package and via 3rd party libraries, only the official one will get assessed.</small></p>
<p><span id="more-260"></span></p>
<p>Software releases used for this comparison are:</p>
<p><a href="http://codeigniter.com/news/codeigniter_1.7.1_released/">CodeIgniter 1.7.1</a><br />
<a href="http://forum.kohanaphp.com/comments.php?DiscussionID=1911">Kohana 2.3.1</a><br />
<a href="http://www.yiiframework.com/forum/index.php/topic,954.msg5506.html">Yii 1.0.3</a></p>
<h3>Licensing</h3>
<p><strong>CodeIgniter</strong> <em>Good</em></p>
<p>CI uses a modified, generally regarded as more restrict, <a href="http://codeigniter.com/user_guide/license.html">BSD/Apache-style license</a>.</p>
<p><strong>Kohana</strong> <em>Excellent</em></p>
<p>Kohana uses a <a href="http://kohanaphp.com/license">new BSD license</a>.</p>
<p><strong>Yii</strong> <em>Excellent</em></p>
<p>Yii uses a <a href="http://www.yiiframework.com/license/">new BSD license</a>.</p>
<h3>PHP Compatibility</h3>
<p><strong>CodeIgniter</strong> <em></em></p>
<p>PHP >= 4.3.2 (including all versions of PHP 5)</p>
<p>At first glance, it seems that CI has the edge because it supports both PHP 4 and PHP 5. However, if you are familiar with OOP then you would know that a lot of compromises had to be made in order to offer PHP 4 support. This is one of the primary reasons some developers including myself avoid to use CodeIgniter.</p>
<p>Even if you decided to use CodeIgniter, I still strongly recommend you build your application using PHP 5 and proper OOP techniques.</p>
<p><strong>Kohana</strong> <em></em></p>
<p>PHP >= 5.2.3</p>
<p><strong>Yii</strong> <em></em></p>
<p>PHP >= 5.1.0</p>
<h3>Supported Databases</h3>
<p><strong>CodeIgniter</strong> <em>Excellent</em></p>
<ul>
<li>MySQL</li>
<li>MySQLi</li>
<li>PostgreSQL</li>
<li>MSSQL</li>
<li>Oracle</li>
<li>SQLite</li>
<li>ODBC</li>
</ul>
<p><strong>Kohana</strong> <em>Good</em></p>
<ul>
<li>MySQL</li>
<li>MySQLi</li>
<li>PostgreSQL</li>
<li>MSSQL</li>
<li>PDOSqlite</li>
</ul>
<p><small>*Note: <a href="http://forumarchive.kohanaphp.com/index.php/topic,392.0.html">Kohana devs have decided long ago NOT to use PDO</a>. <a href="http://github.com/shadowhand/kohana/tree/master">Kohana 3.0</a> is planned to offer support for PDO.</small></p>
<p><strong>Yii</strong> <em>Excellent</em></p>
<p>All the DBMS supported by <a href="http://php.net/manual/en/book.pdo.php">PDO (PHP Data Object)</a>.</p>
<p><small>* Note: Support for <a href="http://www.yiiframework.com/doc/guide/database.ar">Active Record</a> is limited by DBMS. Currently, only the following DBMS are supported:</small></p>
<ul>
<li><small>MySQL 4.1 or later</small></li>
<li><small>PostgreSQL 7.3 or later</small></li>
<li><small>SQLite 2 and 3</small></li>
</ul>
<h3>Community</h3>
<p><strong>CodeIgniter</strong> <em>Excellent</em></p>
<p>CodeIgniter is blessed with a strong, active community that is friendly and helpful. CodeIgniter offers a <a href="http://codeigniter.com/forums/">forum</a>, a <a href="http://codeigniter.com/bug_tracker/">bug tracker</a> and a <a href="http://codeigniter.com/wiki/">wiki</a>.</p>
<p><strong>Kohana</strong> <em>Good</em></p>
<p>Kohana has a small but elite community. It offers a <a href="http://forum.kohanaphp.com/">forum</a>, <a href="http://trac.kohanaphp.com/">Trac</a> and <a href="irc://irc.freenode.net/kohana">IRC</a>.</p>
<p><strong>Yii</strong> <em>Good</em></p>
<p>Yii is the youngest of the three, therefore has the smallest community, it is however growing rapidly as the framework itself gains more attention. Yii offers a <a href="http://www.yiiframework.com/forum/">forum</a>, a <a href="http://code.google.com/p/yii/">project hosted at Google Code</a> and a <a href="http://www.yiiframework.com/doc/">documentation section that supports user comments</a>.</p>
<h3>Documentation / User Guide</h3>
<p><strong>CodeIgniter</strong> <em>Excellent</em></p>
<p>CodeIgniter is known for its excellent documentation. Its user guide is comprehensive, easy to follow and up-to-date. Every release of the framework contains a copy of the user guide too, in case you are maintaining more than one version of CodeIgniter applications.</p>
<p><strong>Kohana</strong> <em>Good</em></p>
<p>Kohana&#8217;s documentation has been improved since my last article. It now has coverage for most aspect of the framework. However, some parts of the documentation are out of date and sometimes incorrect.</p>
<p>I&#8217;ve been using Kohana for a long time now and I found the documentation sufficient and very helpful. It may not have the fine layout found in CodeIgniter&#8217;s user guide, but it certainly helps me track down features and usages.</p>
<p><strong>Yii</strong> <em>Fair</em></p>
<p>The documentation of Yii seems to be fairly well constructed even though I haven&#8217;t started using Yii. All new features or changed features are carefully documented so you know what is going on with the specific version of Yii you use. The API documentation is also very useful thanks to the fully documented code base. However, many features at this stage are not documented in the guide, you need to go through the API or the code base itself.</p>
<h3>Tutorial / Sample Availability</h3>
<p><strong>CodeIgniter</strong> <em>Good</em></p>
<p>CodeIgniter has a dedicated <a href="http://codeigniter.com/wiki/Tutorials/">wiki page</a> for all the tutorials, and you can dig around their forums to find more.</p>
<p><strong>Kohana</strong> <em>Good</em></p>
<p>Kohana has a dedicated <a href="http://kohanaphp.com/tutorials">page</a> for tutorials, but is out-of-date. It also hosts a <a href="http://learn.kohanaphp.com/">learning centre</a> which unfortunately has not been updated since September 2008. You can still head over to their forums to find useful tutorials though.</p>
<p><strong>Yii</strong> <em>Good</em></p>
<p>Yii has a <a href="http://www.yiiframework.com/doc/cookbook/">cookbook</a> section that contains a selection of tutorials. As always, check their forums to find more.</p>
<h3>MVC</h3>
<p>All three frameworks use the <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC</a> (Model-View-Controller) architecture.</p>
<p><strong>CodeIgniter</strong> <em>Yes</em></p>
<p>Apart from the standard MVC architecture, CodeIgniter also offers <a href="http://codeigniter.com/user_guide/general/libraries.html">libraries</a>, <a href="http://codeigniter.com/user_guide/general/plugins.html">plugins</a>, <a href="http://codeigniter.com/user_guide/general/helpers.html">helpers</a> and <a href="http://codeigniter.com/user_guide/general/hooks.html">hooks</a>.</p>
<p><strong>Kohana</strong> <em>Yes</em></p>
<p>Apart from the standard MVC architecture, Kohana also offers <a href="http://docs.kohanaphp.com/general/modules">modules</a>, <a href="http://docs.kohanaphp.com/general/events">events</a>, <a href="http://docs.kohanaphp.com/general/libraries">libraries</a>, <a href="http://docs.kohanaphp.com/general/helpers">helpers</a> and <a href="http://docs.kohanaphp.com/general/hooks">hooks</a>.</p>
<p><strong>Yii</strong> <em>Yes</em></p>
<p>Apart from the standard MVC architecture, Yii also offers <a href="http://www.yiiframework.com/doc/guide/basics.component">components</a>, <a href="http://www.yiiframework.com/doc/guide/basics.module">modules</a>, <a href="http://www.yiiframework.com/doc/guide/extension.overview">extensions</a>, <a href="http://www.yiiframework.com/doc/guide/basics.view#widget">view widgets</a> and helpers *.</p>
<p><small>* Helpers are undocumented but are <a href="http://www.yiiframework.com/search?q=helper&#038;section=guide">referenced in the guide</a> and in the API. All of the helpers can be found in the <em>utils</em> folder under the main <em>framework</em> directory.</small></p>
<h3>Modularity</h3>
<p><strong>CodeIgniter</strong> <em>via 3rd party libraries</em></p>
<p>CodeIgniter does not support modules out-of-box, but you may use 3rd party libraries such as <a href="http://codeigniter.com/wiki/Modular_Extensions_-_HMVC">HMVC</a> or <a href="http://codeigniter.com/forums/viewthread/65749/">Matchbox</a> to achieve similar effect.</p>
<p><strong>Kohana</strong> <em>Excellent</em></p>
<p>Kohana not only offers <a href="http://docs.kohanaphp.com/general/modules">modules</a>, but also has <a href="http://docs.kohanaphp.com/general/filesystem#cascading">cascading file system</a> which takes modularity to a higher level.</p>
<p><strong>Yii</strong> <em>Good</em></p>
<p>Yii 1.0.3 has added support for <a href="http://www.yiiframework.com/doc/guide/basics.module">modules</a>.</p>
<h3>Conventions</h3>
<p>Unlike <a href="http://www.cakephp.org/">CakePHP</a>, all three frameworks offer flexible conventions. There are some defaults but most of them can be overwritten or configured.</p>
<h3>Configuration</h3>
<p><strong>CodeIgniter</strong> <em>Good</em></p>
<p>CodeIgniter has a fairly good <a href="http://codeigniter.com/user_guide/libraries/config.html">configuration system</a>.</p>
<p><strong>Kohana</strong> <em>Excellent</em></p>
<p>Kohana has an exceptionally well <a href="http://docs.kohanaphp.com/general/configuration">configuration system</a>.</p>
<p>Quoted from the guide: The file structure of config files follows Kohana&#8217;s file structure. Meaning that configuration files in the application directory take precedence over those in modules which take precedence over those in the system directory. The one exception is <em>config.php</em> which is hardcoded into the <em>application/config</em> directory and cannot be moved elsewhere. </p>
<p><strong>Yii</strong> <em>Good</em></p>
<p>Yii has a fairly good <a href="http://www.yiiframework.com/doc/guide/basics.application#application-configuration">configuration system</a>.</p>
<h3>Database Abstraction and ORM</h3>
<p>Definitions: <a href="http://en.wikipedia.org/wiki/Database_abstraction_layer">Database Abstraction</a>, <a href="http://en.wikipedia.org/wiki/Object-relational_mapping">ORM</a></p>
<p><strong>CodeIgniter</strong> <em>Good</em></p>
<p>CodeIgniter has a very powerful <a href="http://codeigniter.com/user_guide/database/index.html">database class</a>. It offers query builders as well as database manipulation classes, however it has no built-in ORM support.</p>
<p>One important thing that needs clarification is that even though CodeIgniter has <a href="http://codeigniter.com/user_guide/database/active_record.html">Active Record</a>, it is NOT the same <a href="http://en.wikipedia.org/wiki/Active_record_pattern">Active Record</a> pattern people commonly refer to. CodeIgniter&#8217;s Active Record is merely a collection of query builders.</p>
<p>For ORM, please check out <a href="http://www.assembla.com/wiki/show/IgnitedRecord">IgnitedRecord</a> and <a href="http://stensi.com/datamapper/">DataMapper</a>. Interestingly enough, despite their naming, IgnitedRecord uses the Data Mapper pattern and DataMapper uses the Active Record pattern.</p>
<p><strong>Kohana</strong> <em>Good</em></p>
<p>The most notable time saver during my project development has to be the ORM. Kohana offers a lightweight but useful ORM implementation. It&#8217;s not as sophisticated as the Rails Active Record module, but it does the job quite well. I especially love the <a href="http://docs.kohanaphp.com/libraries/orm/working#adding_and_removing_data_from_many-to-many_relationships">ease of updating many-to-many records</a>.</p>
<p><strong>Yii</strong> <em>Good</em></p>
<p>Yii has a more complex syntax for <a href="http://www.yiiframework.com/doc/guide/database.arr">declaring model relationships</a> than Kohana. However, it also offers more powerful features such as named scope, albeit the syntax is nowhere near as clean as Ruby on Rails&#8217;.</p>
<h3>Auth and ACL</h3>
<p><strong>CodeIgniter</strong> <em>via 3rd party libraries</em></p>
<p>CodeIgniter has a couple of 3rd party Auth and ACL libraries, please head over to their <a href="http://codeigniter.com/forums/">forums</a> to find more.</p>
<p><strong>Kohana</strong> <em>Good</em></p>
<p>Kohana has a built-in <a href="http://docs.kohanaphp.com/addons/auth">Auth module</a> and a number of 3rd party Auth and ACL libraries including my <a href="http://www.beyondcoding.com/2009/01/21/release-kohana-module-authlite-for-user-authentication/">Authlite</a>.</p>
<p><small>* A more complete Auth + ACL solution is being cooked for the 2.4 release. <a href="http://forum.kohanaphp.com/comments.php?DiscussionID=1909&#038;page=1#pgbottom">Check out Samsoir&#8217;s replies in this thread</a>.</small></p>
<p><strong>Yii</strong> <em>Excellent</em></p>
<p>Yii has built-in support for both <a href="http://www.yiiframework.com/doc/guide/topics.auth">authentication and authorisation</a>. As I have no first hand experience with Yii yet, I can only judge this feature from the documentation, by the look of it it&#8217;s fairly easy to use and flexible enough for most systems.</p>
<h3>Validation</h3>
<p><strong>CodeIgniter</strong> <em>Excellent</em></p>
<p>CodeIgniter&#8217;s <a href="http://codeigniter.com/user_guide/libraries/form_validation.html">form validation library</a>.</p>
<p><strong>Kohana</strong> <em>Excellent</em></p>
<p>Kohana&#8217;s <a href="http://docs.kohanaphp.com/libraries/validation">validation library</a>.</p>
<p><strong>Yii</strong> <em>Excellent</em></p>
<p>Yii&#8217;s <a href="http://www.yiiframework.com/doc/guide/form.model#declaring-validation-rules">validation usage</a>. All of the system <a href="http://www.yiiframework.com/doc/api/#system.validators">validators</a> can be found in the <em>validators</em> directory under the main <em>framework</em> directory.</p>
<h3>Caching</h3>
<p><strong>CodeIgniter</strong> <em>Limited</em></p>
<p>CodeIgniter only supports <a href="http://codeigniter.com/user_guide/general/caching.html">basic file system based page caching</a>.</p>
<p><strong>Kohana</strong> <em>Good</em></p>
<p>Kohana offers a slightly more useful <a href="http://docs.kohanaphp.com/libraries/cache">cache library</a> that supports file, SQLite, APC, eAccelerator, memcache, and XCache based caching, with tag support.</p>
<p><strong>Yii</strong> <em>Good</em></p>
<p>Similar to Kohana&#8217;s implementation, Yii supports memcache, APC, XCache and DB based (default to SQLite) page and segment <a href="http://www.yiiframework.com/doc/guide/caching.overview">caching</a>.</p>
<h3>Session</h3>
<p><strong>CodeIgniter</strong> <em>Good</em></p>
<p>CodeIgniter&#8217;s <a href="http://codeigniter.com/user_guide/libraries/sessions.html">session class</a> is fairly good, it supports database storing as well as handling flash data.</p>
<p><strong>Kohana</strong> <em>Good</em></p>
<p>Similarly to CodeIgniter, Kohana also offers a very good <a href="http://docs.kohanaphp.com/libraries/session">session library</a>.</p>
<p><strong>Yii</strong> <em>Excellent</em></p>
<p>Yii provides a much more powerful and flexible <a href="http://www.yiiframework.com/doc/api/CHttpSession">session class</a>. Unfortunately session at this stage is undocumented in the guide. Flash data is not part of the session classes but part of the <a href="http://www.yiiframework.com/doc/api/CWebUser#getFlash">Auth package</a>.</p>
<h3>Logging / Debugging</h3>
<p><strong>CodeIgniter</strong> <em>Good</em></p>
<p>CodeIgniter has a basic <a href="http://codeigniter.com/user_guide/general/errors.html">error handling class</a> and a <a href="http://codeigniter.com/user_guide/general/profiling.html">profiler class</a>.</p>
<p><strong>Kohana</strong> <em>Excellent</em></p>
<p>Kohana has a good <a href="http://docs.kohanaphp.com/general/logging">logging class</a> as well as a <a href="http://docs.kohanaphp.com/libraries/profiler">more flexible profiler</a>.</p>
<p><strong>Yii</strong> <em>Excellent</em></p>
<p>Yii has a <a href="http://www.yiiframework.com/doc/guide/topics.logging">logging/profiling class</a> that is just as powerful and flexible as Kohana&#8217;s.</p>
<h3>Templating</h3>
<p>All three frameworks encourage the use of native PHP for templating.</p>
<p><strong>CodeIgniter</strong> <em>alternative syntax available</em></p>
<p>CodeIgniter also provides an alternative <a href="http://codeigniter.com/user_guide/libraries/parser.html">template parser class</a>.</p>
<p><strong>Kohana</strong> <em>alternative syntax available via 3rd party libraries</em></p>
<p>Kohana has no built-in alternative template syntax support. However, you can find some 3rd party ones such as <a href="http://code.google.com/p/temper/">Temper</a>.</p>
<p><strong>Yii</strong> <em>alternative syntax available</em></p>
<p>Yii also provides an <a href="http://www.yiiframework.com/doc/guide/topics.prado">alternative template syntax</a> borrowed from Prado.</p>
<h3>Helpers</h3>
<p>Helpers are usually libraries that used for simple, repetitive tasks.</p>
<p><strong>CodeIgniter</strong> <em>Excellent</em></p>
<p>CodeIgniter offers 21 built-in helpers.</p>
<p><strong>Kohana</strong> <em>Excellent</em></p>
<p>Kohana offers 19 built-in helpers.</p>
<p><strong>Yii</strong> <em>Limited</em></p>
<p>Yii offers 6 built-in helpers.</p>
<h3>Bundled JavaScript Library</h3>
<p>Bundling JavaScript does NOT mean you have to use the bundled JavaScript. In fact, I encourage the use of <a href="http://en.wikipedia.org/wiki/Unobtrusive_JavaScript">unobtrusive JavaScript</a> than using the bundled classes.</p>
<p><strong>CodeIgniter</strong> <em>None</em></p>
<p>CodeIgniter has no bundled JavaScript library.</p>
<p><strong>Kohana</strong> <em>None</em></p>
<p>Kohana has no bundled JavaScript library.</p>
<p><strong>Yii</strong> <em>jQuery</em></p>
<p>Yii has <a href="http://www.jquery.com/">jQuery</a> bundled, and it provides a number of useful classes such as <a href="http://www.yiiframework.com/doc/api/CAutoComplete">auto-complete</a>.</p>
<h3>Web Services</h3>
<p>I recommend <a href="http://www.beyondcoding.com/2008/11/14/using-zend-framework-with-kohana/">integrating</a> <a href="http://framework.zend.com/manual/en/">Zend Framework</a> for web service uses.</p>
<p><strong>CodeIgniter</strong> <em>Limited</em></p>
<p>CodeIgniter has an <a href="http://codeigniter.com/user_guide/libraries/xmlrpc.html">XML-RPC class</a>.</p>
<p><strong>Kohana</strong> <em>None</em></p>
<p>Kohana has no built-in support for any web services.</p>
<p><strong>Yii</strong> <em>Limited</em></p>
<p>Yii has <a href="http://www.yiiframework.com/doc/guide/topics.webservice">SOAP support</a>.</p>
<h3>Internationalisation</h3>
<p><strong>CodeIgniter</strong> <em>Limited</em></p>
<p>CodeIgniter provides a basic <a href="http://codeigniter.com/user_guide/libraries/language.html">language class</a>.</p>
<p><strong>Kohana</strong> <em>Fair</em></p>
<p>Kohana provides basic <a href="http://docs.kohanaphp.com/general/i18n">locale and language support</a>.</p>
<p><strong>Yii</strong> <em>Good</em></p>
<p>Yii provides a more complete <a href="http://www.yiiframework.com/doc/guide/topics.i18n">i18n class</a>.</p>
<h3>Unit Testing</h3>
<p>I recommend using <a href="http://www.simpletest.org/">SimpleTest</a> or <a href="http://www.phpunit.de/">PHPUnit</a> for your unit test needs.</p>
<p><strong>CodeIgniter</strong> <em>Limited</em></p>
<p>CodeIgniter has a very basic <a href="http://codeigniter.com/user_guide/libraries/unit_testing.html">unit testing class</a>.</p>
<p><strong>Kohana</strong> <em>None</em></p>
<p>Kohana has no built-in unit testing support in the distributed release version (v2.3.1). However, a <a href="http://dev.kohanaphp.com/browser/trunk/modules/unit_test">unit test module</a> can be found in SVN trunk.</p>
<p><strong>Yii</strong> <em>None</em></p>
<p>Yii has no built-in unit testing support.</p>
<h3>The Verdict</h3>
<p>Verdict from round 1: <em>There is no right or wrong in which framework you use, everyone has his own taste. For me, CodeIgniter’s excellent documentation and Kohana’s strict PHP5 + easy to use are the primary reasons to choose them over say, CakePHP and Symfony. That said, CakePHP, Symfony and other frameworks are all excellent choices depending on your taste and experience. On one hand I envy the Ruby community because they obviously have the de facto framework to work with, on another hand, we have more options hey? :)</em></p>
<p>At this stage I can&#8217;t comment on Yii, but I am <em>very</em> tempted to developing at least one project using it. So far I am reasonably impressed by the features it offers. :)</p>
<p>Do you have anything to say about the frameworks? Found mistakes in the article? Start the discussion in the comments! :)</p>
<p><strong>Update log</strong></p>
<p>[2009-03-03]</p>
<p>- Added Kohana Auth/ACL and DB PDO references.</p>
<p>[2009-03-02]</p>
<p>- Kohana unit test module and template parser reference.<br />
- Wording and other minor tweaks.<br />
- Initial post.</p>

	Tags: <a href="http://www.beyondcoding.com/tag/codeigniter/" title="CodeIgniter" rel="tag">CodeIgniter</a>, <a href="http://www.beyondcoding.com/tag/comparison/" title="comparison" rel="tag">comparison</a>, <a href="http://www.beyondcoding.com/tag/frameworks/" title="Frameworks" rel="tag">Frameworks</a>, <a href="http://www.beyondcoding.com/tag/kohana-php/" title="Kohana" rel="tag">Kohana</a>, <a href="http://www.beyondcoding.com/tag/php-framework/" title="php framework" rel="tag">php framework</a>, <a href="http://www.beyondcoding.com/tag/yii/" title="Yii" rel="tag">Yii</a>, <a href="http://www.beyondcoding.com/tag/zend-framework/" title="Zend Framework" rel="tag">Zend Framework</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.beyondcoding.com/2008/02/23/notes-on-choosing-a-php-framework-a-quick-comparison-of-codeigniter-and-kohana/" title="Notes on Choosing a PHP Framework: A Quick Comparison of CodeIgniter and Kohana (February 23, 2008)">Notes on Choosing a PHP Framework: A Quick Comparison of CodeIgniter and Kohana</a> (50)</li>
	<li><a href="http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/" title="Using Zend Framework with CodeIgniter (February 21, 2008)">Using Zend Framework with CodeIgniter</a> (43)</li>
	<li><a href="http://www.beyondcoding.com/2009/03/11/yii-kohana-bridge-updated-full-kohana-flavour-now-added/" title="Yii Kohana Bridge updated: full Kohana flavour now added! (March 11, 2009)">Yii Kohana Bridge updated: full Kohana flavour now added!</a> (2)</li>
	<li><a href="http://www.beyondcoding.com/2008/11/14/using-zend-framework-with-kohana/" title="Using Zend Framework with Kohana (November 14, 2008)">Using Zend Framework with Kohana</a> (9)</li>
	<li><a href="http://www.beyondcoding.com/2009/10/29/using-zend-framework-1-8-with-kohana/" title="Using Zend Framework 1.8+ with Kohana (October 29, 2009)">Using Zend Framework 1.8+ with Kohana</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.beyondcoding.com/2009/03/02/choosing-a-php-framework-round-2-yii-vs-kohana-vs-codeigniter/feed/</wfw:commentRss>
		<slash:comments>50</slash:comments>
		</item>
		<item>
		<title>CodeIgniter &#8211; Loading Models and Database in One Hit</title>
		<link>http://www.beyondcoding.com/2009/02/13/codeigniter-loading-models-and-database-in-one-hit/</link>
		<comments>http://www.beyondcoding.com/2009/02/13/codeigniter-loading-models-and-database-in-one-hit/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 09:39:15 +0000</pubDate>
		<dc:creator>scotti3g</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.beyondcoding.com/?p=91</guid>
		<description><![CDATA[Most models I create need to access the database. You can easily have CI automatically load the database class by setting a 3rd parameter to true when loading your model: $this-&#62;load-&#62;model('your_model', '', true); The 2nd parameter, which in this case was left blank, is used if you want to assign a different object name to [...]]]></description>
			<content:encoded><![CDATA[<p>Most models I create need to access the database. You can easily have CI automatically load the database class by setting a 3rd parameter to true when loading your model:</p>
<pre class="brush: php;">$this-&gt;load-&gt;model('your_model', '', true);</pre>
<p>The 2nd parameter, which in this case was left blank, is used if you want to assign a different object name to the model &#8211; something that I have never used.</p>
<p>Has anyone ever actually used a different object name? The reason I ask is because it&#8217;s so easy to forget about the 2nd parameter, and sometimes I try to put the true parameter to auto-load the database in the 2nd slot like this:</p>
<pre class="brush: php;">$this-&gt;load-&gt;model('my_model', true); // WRONG!</pre>
<p>Of course, the easiest solution is to autoload the database through the config, but that can be a little inefficient for apps that don&#8217;t use the DB on every page.</p>

	Tags: <a href="http://www.beyondcoding.com/tag/codeigniter/" title="CodeIgniter" rel="tag">CodeIgniter</a>, <a href="http://www.beyondcoding.com/tag/frameworks/" title="Frameworks" rel="tag">Frameworks</a>, <a href="http://www.beyondcoding.com/tag/php/" title="PHP" rel="tag">PHP</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.beyondcoding.com/2008/05/26/ruby-on-rails-passenger-modrails-vs-codeigniter-and-kohana/" title="Ruby on Rails, Passenger (ModRails) vs CodeIgniter and Kohana (May 26, 2008)">Ruby on Rails, Passenger (ModRails) vs CodeIgniter and Kohana</a> (15)</li>
	<li><a href="http://www.beyondcoding.com/2009/03/02/choosing-a-php-framework-round-2-yii-vs-kohana-vs-codeigniter/" title="Choosing a PHP Framework Round 2: Yii vs Kohana vs CodeIgniter (March 2, 2009)">Choosing a PHP Framework Round 2: Yii vs Kohana vs CodeIgniter</a> (50)</li>
	<li><a href="http://www.beyondcoding.com/2008/02/26/another-codeigniter-book-coming-soon-ish/" title="Another CodeIgniter book coming soon-ish (February 26, 2008)">Another CodeIgniter book coming soon-ish</a> (3)</li>
	<li><a href="http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/" title="Using Zend Framework with CodeIgniter (February 21, 2008)">Using Zend Framework with CodeIgniter</a> (43)</li>
	<li><a href="http://www.beyondcoding.com/2009/01/21/release-kohana-module-authlite-for-user-authentication/" title="Release: [Kohana Module] Authlite, for User Authentication (January 21, 2009)">Release: [Kohana Module] Authlite, for User Authentication</a> (22)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.beyondcoding.com/2009/02/13/codeigniter-loading-models-and-database-in-one-hit/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails, Passenger (ModRails) vs CodeIgniter and Kohana</title>
		<link>http://www.beyondcoding.com/2008/05/26/ruby-on-rails-passenger-modrails-vs-codeigniter-and-kohana/</link>
		<comments>http://www.beyondcoding.com/2008/05/26/ruby-on-rails-passenger-modrails-vs-codeigniter-and-kohana/#comments</comments>
		<pubDate>Sun, 25 May 2008 14:27:45 +0000</pubDate>
		<dc:creator>Fred Wu</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Kohana]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[ModRails]]></category>
		<category><![CDATA[Passenger]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://thislab.com/?p=38</guid>
		<description><![CDATA[Disclaimer: This is a very simple, &#8216;Hello World&#8217; benchmark which has no impact to any real world applications. A more thorough benchmark test (by building two real world applications) is planned. :) Disclaimer 2:I apologise for posting such a useless benchmark (I certainly didn&#8217;t expect it to hit the DZone front page), but I think [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Disclaimer:</strong> This is a very simple, &#8216;Hello World&#8217; benchmark which has no impact to any real world applications. A more thorough benchmark test (by building two real world applications) is planned. :)</em></p>
<p><em><strong>Disclaimer 2:</strong>I apologise for posting such a useless benchmark (I certainly didn&#8217;t expect it to hit the DZone front page), but I think most of you missed the point. I merely posted this as a result of surprise (to me anyway). At a later stage I will conduct a much more meaningful comparison between some of the frameworks. Until then, please ignore this post. :)</em></p>
<p>Last few days I have been playing with Ruby and Rails, again.</p>
<p>Today, when someone was asking on a forum about the efficiency of web frameworks, I thought I&#8217;d give the few frameworks I work with some more benchmark testing.</p>
<p>So I went ahead and benchmarked CodeIgniter, Kohana and Rails, using a simple &#8216;Hello World!&#8217; page. Now before I post any benchmark results, you should know that I have previously done <a href="http://thislab.com/2008/03/25/kohana-vs-codeigniter-speed-and-memory-usage-performance-benchmark/">a benchmark test on CodeIgniter, Kohana and CakePHP</a>. CodeIgniter and Kohana shared similar results.</p>
<p><span id="more-48"></span></p>
<p>This time though, the benchmark results surprised me. Here they are, in a nutshell:</p>
<p>CodeIgniter: 451.53 [#/sec]<br />
Kohana: 373.05 [#/sec]</p>
<p>Rails: 521.39 [#/sec]<br />
CodeIgniter: 127.23 [#/sec]</p>
<p>Results are presented in requests per seconds, so the higher the better. Now, please let me explain why I have included CodeIgniter twice.</p>
<p>The first two benchmarks were done on MAMP which has Apache 2.0.59 and PHP 5.2.5 with Zend Optimizer and XCache enabled.</p>
<p>The last two benchmarks were done on OS X Leopard&#8217;s default Apache 2.2.8 and PHP 5.2.5 without Zend Optimizer or XCache. Hence the worse result for CodeIgniter.</p>
<p>For the Rails implementation, the benchmark was done on <a href="http://www.modrails.com/">Passenger (aka ModRails)</a>, it is supposedly a more efficient implementation than using Mongrel.</p>
<p>It is very interesting to see that Rails performed faster than two of the most efficient PHP frameworks.</p>
<p>Framework versions used in the benchmark: CodeIgniter 1.6.2, Kohana SVN, Rails 2.0.2.</p>

	Tags: <a href="http://www.beyondcoding.com/tag/apache/" title="Apache" rel="tag">Apache</a>, <a href="http://www.beyondcoding.com/tag/benchmark/" title="benchmark" rel="tag">benchmark</a>, <a href="http://www.beyondcoding.com/tag/codeigniter/" title="CodeIgniter" rel="tag">CodeIgniter</a>, <a href="http://www.beyondcoding.com/tag/framework/" title="framework" rel="tag">framework</a>, <a href="http://www.beyondcoding.com/tag/kohana-php/" title="Kohana" rel="tag">Kohana</a>, <a href="http://www.beyondcoding.com/tag/modrails/" title="ModRails" rel="tag">ModRails</a>, <a href="http://www.beyondcoding.com/tag/passenger/" title="Passenger" rel="tag">Passenger</a>, <a href="http://www.beyondcoding.com/tag/php/" title="PHP" rel="tag">PHP</a>, <a href="http://www.beyondcoding.com/tag/rails/" title="Rails" rel="tag">Rails</a>, <a href="http://www.beyondcoding.com/tag/ruby/" title="Ruby" rel="tag">Ruby</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/" title="Using Zend Framework with CodeIgniter (February 21, 2008)">Using Zend Framework with CodeIgniter</a> (43)</li>
	<li><a href="http://www.beyondcoding.com/2008/02/23/notes-on-choosing-a-php-framework-a-quick-comparison-of-codeigniter-and-kohana/" title="Notes on Choosing a PHP Framework: A Quick Comparison of CodeIgniter and Kohana (February 23, 2008)">Notes on Choosing a PHP Framework: A Quick Comparison of CodeIgniter and Kohana</a> (50)</li>
	<li><a href="http://www.beyondcoding.com/2008/03/25/kohana-vs-codeigniter-speed-and-memory-usage-performance-benchmark/" title="Kohana vs CodeIgniter: Speed and Memory Usage Performance Benchmark (March 25, 2008)">Kohana vs CodeIgniter: Speed and Memory Usage Performance Benchmark</a> (14)</li>
	<li><a href="http://www.beyondcoding.com/2008/12/18/comparison-ruby-vs-php-the-pros/" title="Comparison: Ruby vs PHP, the Pros (December 18, 2008)">Comparison: Ruby vs PHP, the Pros</a> (5)</li>
	<li><a href="http://www.beyondcoding.com/2008/02/25/benchmark-litespeed-vs-apache-php-and-plain-html/" title="Benchmark: LiteSpeed vs Apache (PHP and Plain HTML) (February 25, 2008)">Benchmark: LiteSpeed vs Apache (PHP and Plain HTML)</a> (11)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.beyondcoding.com/2008/05/26/ruby-on-rails-passenger-modrails-vs-codeigniter-and-kohana/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Kohana vs CodeIgniter: Speed and Memory Usage Performance Benchmark</title>
		<link>http://www.beyondcoding.com/2008/03/25/kohana-vs-codeigniter-speed-and-memory-usage-performance-benchmark/</link>
		<comments>http://www.beyondcoding.com/2008/03/25/kohana-vs-codeigniter-speed-and-memory-usage-performance-benchmark/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 15:11:57 +0000</pubDate>
		<dc:creator>Fred Wu</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Kohana]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://thislab.com/?p=33</guid>
		<description><![CDATA[This is just a quick and dirty test, please take it with a grain of salt. We all know that CodeIgniter is a very fast framework, but how about Kohana? Kohana is packed with more features, so does that mean it is slower? Let&#8217;s find out. The following benchmarks are done on my local Macbook [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a quick and dirty test, please take it with a grain of salt.</p>
<p>We all know that CodeIgniter is a <a href="http://www.sellersrank.com/php/cakephp-codeigniter-benchmark/">very fast</a> framework, but how about Kohana? Kohana is packed with more features, so does that mean it is slower? Let&#8217;s find out.</p>
<p>The following benchmarks are done on my local Macbook Pro machine (C2D 2.4GHz + 4GB), Leopard 10.5.2, MAMP without any code optimisers or caches.</p>
<p><span id="more-43"></span></p>
<p>Because I don&#8217;t have *that* much free time, the tests are very simple. I created a simple database with three tables, and the application is going to insert data into the three tables separately, retrieve them in one single query with query binders (or &#8216;active record&#8217; classes per CodeIgniter&#8217;s term) and then clean up the database tables. I&#8217;ve also included use of a text helper method: limit words, which is presented in both Kohana and CodeIgniter. Total number of SQL queries: 2204.</p>
<p>I have benchmarked against three applications: CodeIgniter 1.6.1, Kohana SVN (rev 2328) and Kohana 2.1.1.</p>
<p>First of all, let&#8217;s see what the profilers told us:</p>
<p><strong>Execution time</strong><br />
CI 1.6.1: 0.5657s<br />
K SVN: 0.5718s<br />
K 2.1.1: 0.5787s</p>
<p><strong>Memory usage (pre-controller)</strong><br />
CI 1.6.1: 642,136 bytes<br />
K SVN: 1,097,976 bytes<br />
K 2.1.1: 1,076,972 bytes</p>
<p><strong>Memory usage (post-controller)</strong><br />
CI 1.6.1: 2,354,524 bytes<br />
K SVN: 3,062,376 bytes<br />
K 2.1.1: 3,026,884 bytes</p>
<p>As you can see, Kohana consumes a lot more memory than CodeIgniter, but their execution times are on par.</p>
<p>Let&#8217;s then remove the database functions and just loop through three paragraphs of Loren Iipsum text with the word limiter for 20,000 times, and use <a href="http://httpd.apache.org/docs/2.0/programs/ab.html">ab</a> to test it for 100 times.</p>
<p>Results the lower the better (total time taken).</p>
<p>CI 1.6.1: 110.236098 seconds<br />
K SVN: 130.211059 seconds<br />
K 2.1.1: 130.662462 seconds</p>
<p>Finally, let&#8217;s do a &#8216;hello world&#8217; with <strong>ab -c 10 -t 60</strong> (10 concurrent users for 60 seconds). We assign &#8216;hello world&#8217; to a view variable and pass it onto a blank view page.</p>
<p>Results the higher the better (requests per second).</p>
<p>CI 1.6.1: 122.18 [#/sec]<br />
K SVN: 113.96 [#/sec]<br />
K 2.1.1: 118.54 [#/sec]</p>
<p>As a comparison (just for fun), here are two results for CakePHP:</p>
<p>First run: 18.66 [#/sec]<br />
Second run: 33.47 [#/sec]</p>
<p>The first run was done in default set up whilst the second one was done by using <a href="http://www.sellersrank.com/php/cakephp-codeigniter-benchmark/">suggested tweaks</a>. CakePHP is in a different league to CI and Kohana in my opinion. In both CI and Kohana, models are optional, but CakePHP revolves around models.</p>
<p>Once again, these tests are just for fun. :)</p>

	Tags: <a href="http://www.beyondcoding.com/tag/benchmark/" title="benchmark" rel="tag">benchmark</a>, <a href="http://www.beyondcoding.com/tag/cakephp/" title="CakePHP" rel="tag">CakePHP</a>, <a href="http://www.beyondcoding.com/tag/codeigniter/" title="CodeIgniter" rel="tag">CodeIgniter</a>, <a href="http://www.beyondcoding.com/tag/kohana-php/" title="Kohana" rel="tag">Kohana</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.beyondcoding.com/2008/05/26/ruby-on-rails-passenger-modrails-vs-codeigniter-and-kohana/" title="Ruby on Rails, Passenger (ModRails) vs CodeIgniter and Kohana (May 26, 2008)">Ruby on Rails, Passenger (ModRails) vs CodeIgniter and Kohana</a> (15)</li>
	<li><a href="http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/" title="Using Zend Framework with CodeIgniter (February 21, 2008)">Using Zend Framework with CodeIgniter</a> (43)</li>
	<li><a href="http://www.beyondcoding.com/2008/02/23/notes-on-choosing-a-php-framework-a-quick-comparison-of-codeigniter-and-kohana/" title="Notes on Choosing a PHP Framework: A Quick Comparison of CodeIgniter and Kohana (February 23, 2008)">Notes on Choosing a PHP Framework: A Quick Comparison of CodeIgniter and Kohana</a> (50)</li>
	<li><a href="http://www.beyondcoding.com/2009/03/02/choosing-a-php-framework-round-2-yii-vs-kohana-vs-codeigniter/" title="Choosing a PHP Framework Round 2: Yii vs Kohana vs CodeIgniter (March 2, 2009)">Choosing a PHP Framework Round 2: Yii vs Kohana vs CodeIgniter</a> (50)</li>
	<li><a href="http://www.beyondcoding.com/2009/03/11/yii-kohana-bridge-updated-full-kohana-flavour-now-added/" title="Yii Kohana Bridge updated: full Kohana flavour now added! (March 11, 2009)">Yii Kohana Bridge updated: full Kohana flavour now added!</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.beyondcoding.com/2008/03/25/kohana-vs-codeigniter-speed-and-memory-usage-performance-benchmark/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Another CodeIgniter book coming soon-ish</title>
		<link>http://www.beyondcoding.com/2008/02/26/another-codeigniter-book-coming-soon-ish/</link>
		<comments>http://www.beyondcoding.com/2008/02/26/another-codeigniter-book-coming-soon-ish/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 16:09:50 +0000</pubDate>
		<dc:creator>Fred Wu</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[David Upton]]></category>
		<category><![CDATA[Elliot Haughin]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://thislab.com/2008/02/26/another-codeigniter-book-coming-soon-ish/</guid>
		<description><![CDATA[Elliot Haughin, a fellow CodeIgniter user has started writing a book on CodeIgniter. This is now the second book, after CodeIgniter for Rapid PHP Application Development by David Upton. It is really nice to see the CI community grow. Personally I think the user guide is sufficient for a user to get the feet wet, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.haughin.com/">Elliot Haughin</a>, a fellow CodeIgniter user has started <a href="http://www.haughin.com/2008/02/24/writing-a-codeigniter-book/">writing a book</a> on CodeIgniter. This is now the second book, after <a href="http://www.packtpub.com/codeigniter-php-application-development-mvc/book">CodeIgniter for Rapid PHP Application Development</a> by David Upton.</p>
<p>It is really nice to see the CI community grow. Personally I think the user guide is sufficient for a user to get the feet wet, but I understand some people prefer to have a top-down learning approach.</p>
<p>The book is scheduled to finish by August, according to Elliot.</p>

	Tags: <a href="http://www.beyondcoding.com/tag/book/" title="book" rel="tag">book</a>, <a href="http://www.beyondcoding.com/tag/codeigniter/" title="CodeIgniter" rel="tag">CodeIgniter</a>, <a href="http://www.beyondcoding.com/tag/david-upton/" title="David Upton" rel="tag">David Upton</a>, <a href="http://www.beyondcoding.com/tag/elliot-haughin/" title="Elliot Haughin" rel="tag">Elliot Haughin</a>, <a href="http://www.beyondcoding.com/tag/php/" title="PHP" rel="tag">PHP</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.beyondcoding.com/2008/05/26/ruby-on-rails-passenger-modrails-vs-codeigniter-and-kohana/" title="Ruby on Rails, Passenger (ModRails) vs CodeIgniter and Kohana (May 26, 2008)">Ruby on Rails, Passenger (ModRails) vs CodeIgniter and Kohana</a> (15)</li>
	<li><a href="http://www.beyondcoding.com/2009/02/13/codeigniter-loading-models-and-database-in-one-hit/" title="CodeIgniter &#8211; Loading Models and Database in One Hit (February 13, 2009)">CodeIgniter &#8211; Loading Models and Database in One Hit</a> (4)</li>
	<li><a href="http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/" title="Using Zend Framework with CodeIgniter (February 21, 2008)">Using Zend Framework with CodeIgniter</a> (43)</li>
	<li><a href="http://www.beyondcoding.com/2009/01/21/release-kohana-module-authlite-for-user-authentication/" title="Release: [Kohana Module] Authlite, for User Authentication (January 21, 2009)">Release: [Kohana Module] Authlite, for User Authentication</a> (22)</li>
	<li><a href="http://www.beyondcoding.com/2008/10/29/php-namespace-this-sux/" title="PHP Namespace &#8211; $this->sux (October 29, 2008)">PHP Namespace &#8211; $this->sux</a> (1)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.beyondcoding.com/2008/02/26/another-codeigniter-book-coming-soon-ish/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Notes on Choosing a PHP Framework: A Quick Comparison of CodeIgniter and Kohana</title>
		<link>http://www.beyondcoding.com/2008/02/23/notes-on-choosing-a-php-framework-a-quick-comparison-of-codeigniter-and-kohana/</link>
		<comments>http://www.beyondcoding.com/2008/02/23/notes-on-choosing-a-php-framework-a-quick-comparison-of-codeigniter-and-kohana/#comments</comments>
		<pubDate>Sat, 23 Feb 2008 05:40:54 +0000</pubDate>
		<dc:creator>Fred Wu</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Kohana]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[php framework]]></category>

		<guid isPermaLink="false">http://thislab.com/2008/02/23/notes-on-choosing-a-php-framework-a-quick-comparison-of-codeigniter-and-kohana/</guid>
		<description><![CDATA[Update: There is now a more recent comparison of CodeIgniter 1.7.1, Kohana 2.3.1 and Yii 1.0.3. When I was reading through my subscribed feeds I came across this post: Notes on Choosing a PHP Framework: A Comparison of CakePHP and the Zend Framework by Chad Kieffer. Chad has done a great job comparing the two [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong><a href="http://www.beyondcoding.com/2009/03/02/choosing-a-php-framework-round-2-yii-vs-kohana-vs-codeigniter/">Update: There is now a more recent comparison of CodeIgniter 1.7.1, Kohana 2.3.1 and Yii 1.0.3.</a></strong></em></p>
<p>When I was reading through my subscribed feeds I came across this post: <a href="http://2tbsp.com/node/87">Notes on Choosing a PHP Framework: A Comparison of CakePHP and the Zend Framework</a> by Chad Kieffer.</p>
<p>Chad has done a great job comparing the two frameworks that he&#8217;s interested in. That inspired me to write something up for the frameworks that <em>I</em> prefer and use. :)</p>
<p>I began hunting for PHP frameworks ever since Ruby on Rails hit the street. Coincidentally one of the first PHP frameworks I played with was <a href="http://cakephp.org/">CakePHP</a>. At that time CakePHP&#8217;s documentation was nearly non-existent so I had to seek for an alternative. I did a lot of searches, and researches, and finally I was happy to see <a href="http://codeigniter.com/">CodeIgniter</a>. Its user guide was what impressed me the most, I am sure many of the fellow CI users would agree with me on this one. Because of the excellent documentation, I was able to start working on projects right after I spent a few hours on the user guide! Developing apps on CI was such a breeze! Today, I develop web applications in CodeIgniter, Kohana and <a href="http://framework.zend.com/">Zend Framework</a>. If you want to find out how to use Zend Framework components with CI or Kohana, please read my previous blog entry: <a href="http://thislab.com/2008/02/21/using-zend-framework-with-codeigniter/">Using Zend Framework with CodeIgniter</a>.</p>
<p><span id="more-24"></span></p>
<p>From version 1.2 when I first started coding on CI, to the newly released version 1.6.1 it sure is a long way. CodeIgniter has progressed well and gained many web developers&#8217; trust, despite a few glitches. One of which was the spawn of the fork: <a href="http://kohanaphp.com/">Kohana</a>.</p>
<p>CodeIgniter had some low periods where developers were all focused on pushing out new releases of <a href="http://expressionengine.com/">ExpressionEngine</a>, their commercial blogging/cms product. Some of the users on the CI forum got frustrated because their bug reports and feature requests were ignored. As a result of that, BlueFlame was born, and later renamed to Kohana.</p>
<p>Kohana is relatively unknown to the public. In fact, most of the Kohana users are ex-CI users or users that uses both CI and Kohana (like myself). According to the Kohana homepage and <a href="http://en.wikipedia.org/wiki/KohanaPHP#Differences_Between_Kohana_and_CodeIgniter">Wikipedia</a>, the differences between Kohana and CodeIgniter are:</p>
<ol>
<li><strong>Strict PHP5 OOP.</strong> Offers many benefits: visibility protection, automatic class loading, overloading, interfaces, abstracts, and singletons.</li>
<li>Kohana has joined the GoPHP5 initiative. All releases from 2.2 on will conform with this project.</li>
<li>Continues CodeIgniter design patterns. Anyone who has used CodeIgniter will quickly understand Kohana&#8217;s structure and design patterns.</li>
<li><strong>Community, not company, driven.</strong> Kohana is driven by community discussion, ideas, and code. Kohana developers are from all around the world, each with their own talents. This allows a rapid and flexible development cycle that can respond to bugs and requests within hours, instead of days or months.</li>
<li><strong>GET, POST, COOKIE, and SESSION arrays all work as expected.</strong> Kohana does not limit your access to global data, but offers the same filtering and XSS protection that CodeIgniter does.</li>
<li><strong>Cascading resources, modules, and inheritance.</strong> Controllers, models, libraries, helpers, and views can be loaded from any location within your system, application, or module paths. Configuration options are inherited and can by dynamically overwritten by each application.</li>
<li><strong>No namespace conflicts.</strong> Class suffixes, like _Controller, are used to prevent namespace conflicts. This allows a User&#8217;s controller and Users model to both be loaded at the same time.</li>
<li><strong>True auto-loading of classes.</strong> This includes libraries, controllers, models, and helpers. This is not pre-loading, but true dynamic loading of classes, as they are requested.</li>
<li><strong>Helpers are static classes, not functions.</strong> For example, instead of using form_open(), you would use form::open().</li>
<li><strong>Library drivers and API consistency.</strong> Libraries can use different &#8220;drivers&#8221; to handle different external APIs transparently. For example, multiple session storage options are available (database, cookie, and native), but the same interface is used for all of them. This allows new drivers to be developed for existing libraries, which keeps the API consistent and transparent.</li>
<li><strong>Powerful event handler.</strong> Kohana events can by dynamically added to, replaced, or even removed completely. This allows many changes to Kohana execution process, without modification to existing system code.</li>
</ol>
<p>As you can see, whilst maintaining a certain level of similarity to CodeIgniter, Kohana does offer some advantages (at the same time, some disadvantages). Let&#8217;s take a look at a few quick comparisons. Grading scale: Limited < Fair < Good < Excellent. Please note: if a feature is not available in the distributed package, but is available via 3rd party libraries, I will state that in the comparison. If a feature is available both in the distributed package and via 3rd party libraries, only the official one will get assessed.</p>
<table border="1" cellspacing="0" cellpadding="5">
<caption>Feature Comparison of CodeIgniter and Kohana</caption>
<tr>
<th>Feature</th>
<th>CodeIgniter 1.6.1</th>
<th>Kohana 2.1.1</th>
<th>Notes</th>
</tr>
<tr>
<td>License</td>
<td><a href="http://codeigniter.com/user_guide/license.html">Apache/BSD-style</a></td>
<td><a href="http://kohanaphp.com/license.html">new BSD</a></td>
<td>Licenses are similar, although Kohana uses the new BSD license which is slightly more flexible than CI&#8217;s modified BSD license.</td>
</tr>
<tr>
<td>PHP compatibility</td>
<td>4.3.2+ and 5</td>
<td>5.1.3+</td>
<td>CodeIgniter supports PHP4 whilst Kohana is a stict PHP5 framework. If you are using PHP5 then Kohana offers more OOP and performance advantages. Start from version 2.2 (yet to be released), Kohana will only support PHP 5.2+.</td>
</tr>
<tr>
<td>Supported Databases</td>
<td>MySQL (4.1+)<br />MySQLi<br />MS SQL<br />PostgreSQL<br />SQLite<br />Oracle<br />ODBC</td>
<td>MySQL<br />PostgreSQL<br />SQLite</td>
<td>CodeIgniter&#8217;s longer history ensures us a more widely available database support options than Kohana, although in the future Kohana is likely to support more databases too.</td>
</tr>
<tr>
<td>Community</td>
<td><a href="http://codeigniter.com/forums/">Forum</a><br /><a href="http://codeigniter.com/wiki/">Wiki</a><br /><a href="http://codeigniter.com/bug_tracker/">Bug Tracker</a></td>
<td><a href="http://forum.kohanaphp.com/">Forum</a><br /><a href="http://trac.kohanaphp.com/">Trac</a><br /><a href="irc://irc.freenode.net/kohana">IRC</a></td>
<td>CodeIgniter obviously has a much larger community and offers a wiki for community members to share tutorials and code snippets. Kohana on the other hand, has a smaller community, however the developers are actively online on the forum and IRC.</td>
</tr>
<tr>
<td>Documentation / User Guide</td>
<td>Excellent</td>
<td>Limited</td>
<td>CodeIgniter is known for its excellent user guide. Kohana is in the process of improving its documentation.</td>
</tr>
<tr>
<td>Tutorial / Sample Availability</td>
<td>Good</td>
<td>Fair</td>
<td>Tutorials are available on both of their forums. CodeIgniter has the advantage of having a wiki for easier navigation. Kohana on the other hand, has a dedicated <a href="http://kohanaphp.com/tutorials.html">tutorial page</a> for some of the tutorials.</td>
</tr>
<tr>
<td>MVC</td>
<td>Strict</td>
<td>Strict</td>
<td>Both frameworks use the same MVC approach.</td>
</tr>
<tr>
<td>Modular / HMVC</td>
<td>Via 3rd party libraries</td>
<td>Built in</td>
<td>Kohana is built with HMVC in mind whilst CodeIgniter has some 3rd party libraries such as <a href="http://codeigniter.com/forums/viewthread/65749/">Matchbox</a> and <a href="http://codeigniter.com/forums/viewthread/72123/">Modular HMVC</a> to accomplish the same effect.</td>
</tr>
<tr>
<td>Conventions</td>
<td>Flexible</td>
<td>Flexible</td>
<td>Unlike CakePHP, both of the frameworks offer flexible convensions. There are some defaults but most of them can be overwritten.</td>
</tr>
<tr>
<td>Configuration</td>
<td>PHP files</td>
<td>PHP files</td>
<td>In my opinion Kohana is more configurable than CodeIgniter yet it is simpler (less clustered) to do so! Most of the Kohana configuration files are stored in the system folder, you only copy and paste the ones you actually need to modify, and modify them accordingly. CodeIgniter&#8217;s config files are all stored in the application folder.</td>
</tr>
<tr>
<td>Database Abstraction</td>
<td>Modified ActiveRecord</td>
<td>Modified ActiveRecord<br />ORM (optional)</td>
<td>Both frameworks use the modified ActiveRecord pattern. Kohana has an optional ORM module. CodeIgniter has some ORM and Rails-style ActiveRecord implementation avaliable via 3rd party libraries.</td>
</tr>
<tr>
<td>ACL</td>
<td>Via 3rd party libraries</td>
<td>Auth library (optional)</td>
<td>Neither of the frameworks forces you to use a specific ACL mechanism. CodeIgniter does not have one built in, and Kohana has one available as an optional module.</td>
</tr>
<tr>
<td>Validation</td>
<td>Good</td>
<td>Good</td>
<td>Both frameworks offer a good built in validtion layer. Kohana 2.2 is planned to have some significant improvements for the validation library.</td>
</tr>
<tr>
<td>Caching</td>
<td>Limited</td>
<td>Fair</td>
<td>In my opinion both of the caching features are limited. Kohana offers a slightly more useful cache library that supports file, SQLite, APC, eAccelerator, memcache, and Xcache based caching, with tag support.</td>
</tr>
<tr>
<td>Session</td>
<td>Good</td>
<td>Excellent</td>
<td>CodeIgniter 1.6 has improved its session library, but it&#8217;s still inferior to Kohana&#8217;s implementation. Kohana&#8217;s session library supports both encryption and storing session data in database.</td>
</tr>
<tr>
<td>Logging / Debugging</td>
<td>Good</td>
<td>Excellent</td>
<td>Both frameworks offer very good logging and debugging mechanisms. Kohana is a little bit ahead thanks to PHP5&#8242;s native Exception class and its powerful event handlers.</td>
</tr>
<tr>
<td>Templating</td>
<td>Native PHP</td>
<td>Native PHP</td>
<td>Templating is *very* easy for both frameworks. If you can skin WordPress, then you&#8217;d have no problems at all skinning CI or Kohana. If you want though, you can still incorporate one of the 3rd party templating solutions such as Smarty.</td>
</tr>
<tr>
<td>Helpers</td>
<td>Good</td>
<td>Good</td>
<td>Helpers are usually libraries that used for simple, repetitive tasks. Both frameworks offer a wide range of helpers for handling forms, URLs and dates, etc.</td>
</tr>
<tr>
<td>JavaScript / AJAX</td>
<td>N/A</td>
<td>N/A</td>
<td>Both frameworks respect your choice of JavaScript / AJAX frameworks. Unlike CakePHP and Ruby on Rails, they don&#8217;t have built-in helpers for any of the JavaScript libraries. This offers more flexibility as well as the use of unobtrusive JavaScript.</td>
</tr>
<tr>
<td>Web Services</td>
<td>Fair</td>
<td>Fair</td>
<td>I could be wrong but I don&#8217;t think either framework supports (or at least encourages) RESTful design&#8230;</td>
</tr>
<tr>
<td>Localization</td>
<td>Limited</td>
<td>Good</td>
<td>CodeIgniter has limited i18n support whilst Kohana offers a bit more (timezone / full UTF8 layer, etc).</td>
</tr>
<tr>
<td>Unit Testing</td>
<td>Limited</td>
<td>None *</td>
<td>CodeIgniter&#8217;s built in unit testing class is very limited. * Kohana as of version 2.1.1 does not have a unit testing class, however it is planned for version 2.2.</td>
</tr>
</table>
<h3>The Verdict</h3>
<p>I had a hard time deciding which of these two I use. In the end, I chose to use both. Why? Because they each have its advantages and disadvantages.</p>
<p>CodeIgniter is great for small to medium sized projects, especially good for legacy servers which have PHP4 installed. The fantastic user guide made coding in CI very efficient.</p>
<p>Kohana is probably better for larger sized projects as well as projects that need more flexible extensions. PHP5 offers better (proper) OOP support as the foundation, plus Kohana&#8217;s several better feature implementation make it a strong competitor to its predecessor.</p>
<p>There is no right or wrong for which framework you use, everyone has its own taste. For me, CodeIgniter&#8217;s excellent documentation and Kohana&#8217;s strict PHP5 + easy to use are the primary reasons to choose them over say, CakePHP and Symfony. That said, CakePHP, Symfony and other frameworks are all excellent choices depending on your taste and experience. On one hand I envy the Ruby community because they obviously have the de facto framework to work with, on another hand, we have more options hey? :)</p>
<p>Feel free to share your opinion and experiences!</p>
<p><strong>Update log:</strong></p>
<p>[2008-02-23]<br />
 &#8211; Removed MS SQL support for Kohana (confirmed by <a href="http://forum.kohanaphp.com/account.php?u=1">Shadowhand</a>)<br />
 &#8211; Updated cache driver description for Kohana (confirmed by Shadowhand)<br />
 &#8211; Edited unicode / UTF8 description for Kohana (confirmed by Shadowhand)</p>

	Tags: <a href="http://www.beyondcoding.com/tag/codeigniter/" title="CodeIgniter" rel="tag">CodeIgniter</a>, <a href="http://www.beyondcoding.com/tag/comparison/" title="comparison" rel="tag">comparison</a>, <a href="http://www.beyondcoding.com/tag/framework/" title="framework" rel="tag">framework</a>, <a href="http://www.beyondcoding.com/tag/kohana-php/" title="Kohana" rel="tag">Kohana</a>, <a href="http://www.beyondcoding.com/tag/php-framework/" title="php framework" rel="tag">php framework</a>, <a href="http://www.beyondcoding.com/tag/zend-framework/" title="Zend Framework" rel="tag">Zend Framework</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/" title="Using Zend Framework with CodeIgniter (February 21, 2008)">Using Zend Framework with CodeIgniter</a> (43)</li>
	<li><a href="http://www.beyondcoding.com/2009/03/02/choosing-a-php-framework-round-2-yii-vs-kohana-vs-codeigniter/" title="Choosing a PHP Framework Round 2: Yii vs Kohana vs CodeIgniter (March 2, 2009)">Choosing a PHP Framework Round 2: Yii vs Kohana vs CodeIgniter</a> (50)</li>
	<li><a href="http://www.beyondcoding.com/2008/05/26/ruby-on-rails-passenger-modrails-vs-codeigniter-and-kohana/" title="Ruby on Rails, Passenger (ModRails) vs CodeIgniter and Kohana (May 26, 2008)">Ruby on Rails, Passenger (ModRails) vs CodeIgniter and Kohana</a> (15)</li>
	<li><a href="http://www.beyondcoding.com/2008/03/17/layerful-framework-performance-in-kohana/" title="Layerful Framework Performance in Kohana (March 17, 2008)">Layerful Framework Performance in Kohana</a> (1)</li>
	<li><a href="http://www.beyondcoding.com/2008/03/16/kohana-extended-transparently/" title="Kohana extended, transparently :) (March 16, 2008)">Kohana extended, transparently :)</a> (4)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.beyondcoding.com/2008/02/23/notes-on-choosing-a-php-framework-a-quick-comparison-of-codeigniter-and-kohana/feed/</wfw:commentRss>
		<slash:comments>50</slash:comments>
		</item>
		<item>
		<title>Using Zend Framework with CodeIgniter</title>
		<link>http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/</link>
		<comments>http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 19:43:08 +0000</pubDate>
		<dc:creator>Fred Wu</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Kohana]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[php framework]]></category>

		<guid isPermaLink="false">http://thislab.com/2008/02/21/using-zend-framework-with-codeigniter/</guid>
		<description><![CDATA[If you ever wanted to integrate CodeIgniter and Zend Framework, you might have come across this tutorial by Daniel Vecchiato. Whilst Daniel has done a great job demonstrating the possibility of using the two frameworks together, concerns have been made: do we actually need to use hooks? As I understand it, hooks are used to [...]]]></description>
			<content:encoded><![CDATA[<p>If you ever wanted to integrate CodeIgniter and Zend Framework, you might have come across <a href="http://www.4webby.com/freakauth/tutorials/using-zend-framework-components-in-code-igniter">this tutorial</a> by Daniel Vecchiato.</p>
<p>Whilst Daniel has done a great job demonstrating the possibility of using the two frameworks together, concerns have been made: do we actually need to use hooks?</p>
<p>As I understand it, hooks are used to extend the <strong>core</strong> functionalities of CodeIgniter (as explained in the <a href="http://codeigniter.com/user_guide/general/hooks.html">user guide</a>). Obviously Zend Framework and CodeIgniter are two different systems and there is no intention for us to <strong>extend</strong> CodeIgniter&#8217;s core functionality with Zend Framework.</p>
<p>Using hooks can be dangerous as it&#8217;s system-wide, and it modifies the system behaviour.</p>
<p>What I have done is to simply use CodeIgniter&#8217;s library structure to load the Zend Framework resources. Below is the tutorial.</p>
<p><span id="more-23"></span></p>
<p>Assuming you already have CodeIgniter installed. If not please refer to the <a href="http://codeigniter.com/user_guide/installation/index.html">user guide</a> for installation.</p>
<ol>
<li>Download Zend Framework from the <a href="http://framework.zend.com/">official website</a>.</li>
<li>Unzip the Zend Framework package, and copy the <em>Zend</em> folder (under <em>Library</em>) to your CodeIgniter installation&#8217;s <em>application/libraries/</em>. You can actually place the folder anywhere, but remember to alter the script accordingly (read the comments in the script!).</li>
<li>Place the library script (provided at the end of the post) in <em>application/libraries/</em></li>
<li>Done! That&#8217;s all you need to do. Now, let us see an example of using the library.</li>
</ol>
<h3>Usage Sample</h3>
<pre class="brush: php;">
&lt;?php

class Welcome extends Controller {

	function Welcome()
	{
		parent::Controller();
	}

	function index()
	{
		$this-&gt;load-&gt;library('zend', 'Zend/Service/Flickr');
		// newer versions of CodeIgniter have updated its loader API slightly,
		// we can no longer pass parameters to our library constructors
		// therefore, we should load the library like this:
		// $this-&gt;load-&gt;library('zend');
		// $this-&gt;zend-&gt;load('Zend/Service/Flickr');

		$flickr = new Zend_Service_Flickr('YOUR_FLICKR_API_KEY');

		$results = $flickr-&gt;tagSearch('php');
		foreach ($results as $result)
		{
			echo $result-&gt;title . '&lt;br /&gt;';
		}
		//$this-&gt;load-&gt;view('welcome_message');
	}
}
?&gt;
</pre>
<h3>Library Script</h3>
<p>Copy the code and paste it to a new file called <strong><em>Zend.php</em></strong> in <em>application/libraries/</em>.</p>
<pre class="brush: php;">
&lt;?php if (!defined('BASEPATH')) {exit('No direct script access allowed');}

/**
 * Zend Framework Loader
 *
 * Put the 'Zend' folder (unpacked from the Zend Framework package, under 'Library')
 * in CI installation's 'application/libraries' folder
 * You can put it elsewhere but remember to alter the script accordingly
 *
 * Usage:
 *   1) $this-&gt;load-&gt;library('zend', 'Zend/Package/Name');
 *   or
 *   2) $this-&gt;load-&gt;library('zend');
 *      then $this-&gt;zend-&gt;load('Zend/Package/Name');
 *
 * * the second usage is useful for autoloading the Zend Framework library
 * * Zend/Package/Name does not need the '.php' at the end
 */
class CI_Zend
{
	/**
	 * Constructor
	 *
	 * @param	string $class class name
	 */
	function __construct($class = NULL)
	{
		// include path for Zend Framework
		// alter it accordingly if you have put the 'Zend' folder elsewhere
		ini_set('include_path',
		ini_get('include_path') . PATH_SEPARATOR . APPPATH . 'libraries');

		if ($class)
		{
			require_once (string) $class . EXT;
			log_message('debug', &quot;Zend Class $class Loaded&quot;);
		}
		else
		{
			log_message('debug', &quot;Zend Class Initialized&quot;);
		}
	}

	/**
	 * Zend Class Loader
	 *
	 * @param	string $class class name
	 */
	function load($class)
	{
		require_once (string) $class . EXT;
		log_message('debug', &quot;Zend Class $class Loaded&quot;);
	}
}

?&gt;
</pre>
<p>Happy coding! Oh and don&#8217;t forget, Zend Framework is PHP 5 only, so it won&#8217;t work on your PHP 4 installation.</p>
<h3>Update: Using it with Kohana</h3>
<h4>Update: The following instructions are deprecated, please follow the <a href="http://www.beyondcoding.com/2008/11/14/using-zend-framework-with-kohana/">updated one here</a>.</h4>
<p>Even though <a href="http://www.kohanaphp.com/">Kohana</a> has the <a href="http://doc.kohanaphp.com/general/libraries">ability</a> to load vendor classes, I still find it useful to use the library approach so that loading Zend Framework libraries will be transparent. :)</p>
<p>Usage is exactly the same as in CodeIgniter.</p>
<pre class="brush: php;">
&lt;?php defined('SYSPATH') or die('No direct script access.');

/**
 * Zend Framework Loader
 *
 * Put the 'Zend' folder (unpacked from the Zend Framework package, under 'Library')
 * in CI installation's 'application/libraries' folder
 * You can put it elsewhere but remember to alter the script accordingly
 *
 * Usage:
 *   1) $this-&gt;load-&gt;library('zend', 'Zend/Package/Name');
 *   or
 *   2) $this-&gt;load-&gt;library('zend');
 *      then $this-&gt;zend-&gt;load('Zend/Package/Name');
 *
 * * the second usage is useful for autoloading the Zend Framework library
 * * Zend/Package/Name does not need the '.php' at the end
 */
class Zend
{
	/**
	 * Constructor
	 *
	 * @param	string $class class name
	 */
	function __construct($class = NULL)
	{
		// include path for Zend Framework
		// alter it accordingly if you have put the 'Zend' folder elsewhere
		ini_set('include_path',
		ini_get('include_path') . PATH_SEPARATOR . APPPATH . 'libraries');

		if ($class)
		{
			require_once (string) $class . EXT;
			Log::add('debug', &quot;Zend Class $class Loaded&quot;);
		}
		else
		{
			Log::add('debug', &quot;Zend Class Initialized&quot;);
		}
	}

	/**
	 * Zend Class Loader
	 *
	 * @param	string $class class name
	 */
	function load($class)
	{
		require_once (string) $class . EXT;
		Log::add('debug', &quot;Zend Class $class Loaded&quot;);
	}
}

?&gt;
</pre>

	Tags: <a href="http://www.beyondcoding.com/tag/codeigniter/" title="CodeIgniter" rel="tag">CodeIgniter</a>, <a href="http://www.beyondcoding.com/tag/framework/" title="framework" rel="tag">framework</a>, <a href="http://www.beyondcoding.com/tag/kohana-php/" title="Kohana" rel="tag">Kohana</a>, <a href="http://www.beyondcoding.com/tag/php-framework/" title="php framework" rel="tag">php framework</a>, <a href="http://www.beyondcoding.com/tag/zend-framework/" title="Zend Framework" rel="tag">Zend Framework</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.beyondcoding.com/2008/02/23/notes-on-choosing-a-php-framework-a-quick-comparison-of-codeigniter-and-kohana/" title="Notes on Choosing a PHP Framework: A Quick Comparison of CodeIgniter and Kohana (February 23, 2008)">Notes on Choosing a PHP Framework: A Quick Comparison of CodeIgniter and Kohana</a> (50)</li>
	<li><a href="http://www.beyondcoding.com/2009/03/02/choosing-a-php-framework-round-2-yii-vs-kohana-vs-codeigniter/" title="Choosing a PHP Framework Round 2: Yii vs Kohana vs CodeIgniter (March 2, 2009)">Choosing a PHP Framework Round 2: Yii vs Kohana vs CodeIgniter</a> (50)</li>
	<li><a href="http://www.beyondcoding.com/2008/05/26/ruby-on-rails-passenger-modrails-vs-codeigniter-and-kohana/" title="Ruby on Rails, Passenger (ModRails) vs CodeIgniter and Kohana (May 26, 2008)">Ruby on Rails, Passenger (ModRails) vs CodeIgniter and Kohana</a> (15)</li>
	<li><a href="http://www.beyondcoding.com/2008/03/17/layerful-framework-performance-in-kohana/" title="Layerful Framework Performance in Kohana (March 17, 2008)">Layerful Framework Performance in Kohana</a> (1)</li>
	<li><a href="http://www.beyondcoding.com/2008/03/16/kohana-extended-transparently/" title="Kohana extended, transparently :) (March 16, 2008)">Kohana extended, transparently :)</a> (4)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
	</channel>
</rss>
