Kohana PHP Framework: First impressions

I've been working with the Kohana PHP Framework at my full-time job lately. I'd really love to bash Kohana since I'm a loyal CakePHP fan but frankly, I'm pretty impressed with Kohana. Here are some things I've noticed while using Kohana and how it compares to CakePHP.

Kohana is lighter

The first thing you notice when downloading Kohana is how much smaller the framework is. Uncompressed, Kohana weighs in at 1.6MB on disk and CakePHP weighs in at 8.9MB. (At least those are the numbers that Snow Leopard is reporting)

Kohana is full of features

Just because its lighter doesn't mean that Kohana doesn't come with solid set of features. The core functionality, included helpers and libraries should be enough to get any site off the ground relatively quickly and rival some of Cake's core functionality and methodology.

Kohana is faster, but...

In regard to speed, Kohana wins out over CakePHP. I've done some testing on my server and I can squeeze out many more requests per second using Kohana. Although this doesn't mean much. In my experience, the database has always been the bottleneck for my applications and CakePHP has performed well also.

Some of the perks

Below are some of the perks that I have found while working with Kohana in this short time:

  • Strict PHP5 OOP.
  • Class auto-loading
  • A sweet validation class
  • The query builder is pretty cool and intuitive.
  • Kohana's form helper only outputs the form element itself. As opposed to CakePHP, where it outputs a bunch of additional html by default (kind of annoying).
  • In a related note to the point above, Kohana doesn't assume that you want a lot of "auto-magic-ness" by default. I like this minimalistic approach much better.

So far so good

I've so far enjoyed working with Kohana but there are still some areas in which I still prefer CakePHP. There's no doubt that CakePHP is a more robust framework and I'll try to point out where Kohana is lacking and what can be improved.

Kohana's weaknesses: Things I've noticed in this short time using Kohana

  • Small community.
  • Common complaint: Upgrading to newer versions will almost always break existing code.
  • Not the "popular kid" on Google. Searching for Kohana related info is limited as opposed to CakePHP.
  • The CakePHP paginator is much more robust, allowing for built-in column sorting which saves a lot of time.
  • Named parameters in CakePHP rule. IE: /my/url/name:dan - No such luck in Kohana, although you could parse out the url to get the same effect.
  • CakePHP shells are awesome. Kohana has limited support for writing command line programs.
  • Kohana needs a "bakery"

The verdict (So far)

I can appreciate Kohana for its flexible and minimalistic approach. I've only been using it for about a month but I have grown to like its "style". That being said, CakePHP still has my heart. Who knows, that may change after a few more months of using Kohana but as of now, I'm still a baker.

Comments (2)

I really love Kohana, and I must insist on version 3. It's true that upgrading from 2.x to 3.x will be a headache, but version 3 is a total re-write of the core, and offers some great features and advantages such as HMVC and a very cool Routes system. I love Kohana because it's really light, "doesn't do everything for you", gives you very strong tools to build your application exactly how you want it to be. Check out the Modules section at: http://dev.kohanaphp.com/projects/

Good luck!
Kohana v3 does look great. A developer at work raves about it. I'm going to wait until it matures a bit and the documentation comes around but I'm definitely excited about where Kohana is headed.

Leave a comment

Name (Required)
Email (Required)
Url (Optional)
Comment (Required)