?

Log in

No account? Create an account
entries friends calendar profile It's Me Previous Previous Next Next
PHP Framework Review: CodeIgniter v2 - The Autobiography of Russell
Life from a different perspective
zimzat
zimzat
PHP Framework Review: CodeIgniter v2

This weekend I had my first experience with the CodeIgniter v2 framework. I was hoping to be impressed, but as I started digging into it I was severely disappointed. Just from a few hours of peeking into the core system code I noticed a number of things...

  • It doesn't support code completion with the method it uses to load even core libraries. Even Zend Framework has problems with this for extended functionality (easy to work around, though), but at least it provides code-completion support for most of the core functionality.
  • The way it loads libraries/helpers/etc is very manual. No real auto-loading at the time of use.
  • The phpDoc comments are superfluous for PHP 5; It's no longer necessary to state a function is private/protected/public.
    • And comments on other aspects, like the object properties, is completely missing.
  • The index.html files littered in every directory are a 10+ years out-of-date method to manually disable directory browsing.
  • The config files are numerous, and duplicative. Version 2 didn't support multiple environments out of the box, and even now it's hacked in.
    • To create a config for an environment it has to be completely copied, and if any changes are made in one it has to be manually copied to any others.
  • It's not very object-orientated. The objects are more like static singletons hacked on top of the controller/view.
    • It strikes back to the phase of OOP development where objects are thought of as containers for logic rather than discrete actors of functionality on specific data.
  • The objects have a heavy mixing of concerns. For example, the email class contains logic to build an email, and all the methods to send said email. This limits the ability to change the transport layer (to, for example, a file) while still using the same object to build the original message (one has virtually nothing to do with the other).
  • It uses functions and static variables in those functions to bind all the objects together.
    • I would hate to see how they would try to create automated tests for any of this.
  • It attempts to support a 'escape everything' paradigm, which has been shown to be flawed and gives a false sense of security (even PHP is removing and/or disabling that 'feature').

My recommendation for anyone who thinks they have to use CodeIgniter because it's the only framework that works under their hosting solution: Find a better hosting solution. Seriously.

My recommendation for anyone just learning PHP? Don't pick up this framework. You won't be doing yourself any favors in the art of programming. Just dig in and learn something more advanced and polished, like Zend Framework.

Tags:
Current Music: "Firework" by "Katy Perry" on "Teenage Dream" (Music Choice)

Leave a comment