Framework

I’ve blogged in the past about building my own PHP framework. I’ve found (or perhaps made) little time to further this goal in recent months and so, with a couple of small projects to work on, I started looking around for a good foundation to work from. I’ve used Code Igniter in the past (though not for a few years), but it’s lesser known, PHP5-only, strict OOP fork, Kohana seems a better fit with my tastes.

Calling Kohana a Code Igniter fork now is perhaps a little unfair, though there are still similarities in terms on overall structure, and it does “feel” a little like CI did to work with.

So far I’m enjoying it, and it has impressed me. Kohana is an MVC-based system, designed to be simple and fast, loading and using only the resources it needs. Check out this overview of their approach. There is no installation to speak of; an example application folder comes with the package which you copy to wherever you like. Your app folder contains all site-specific configuration files and can be placed anywhere in relation to the Kohana core, making it easy to have a central core running multiple sites. A path setting in the index.php file points in the right direction. The core configuration files, which cover everything from database settings and sessions to locale and URL routing, any of which can be overriden and brought into play in your app by simply copying it into your app’s config folder and customizing to taste. It’s modular, allowing plug-ins to be easily included to extend functionality. There are even some useful modules available for download with Kohana, including a not-too-shabby auth module with user models. The documentation isn’t quite what CI’s is but it’s getting there, and it’s wiki delivery makes it easy to improve if you care to contribute.

I always liked Code Igniter and it’s only the fact that I tend to work exclusively with PHP 5 these days that made me tip towards Kohana instead. There’s a lot to explore in more detail and I’ll be blogging about the specifics as a get further into it so, if you’re interested, keep an eye out. Not literally, of course.