Fuel PHP

I recently started looking into Fuel PHP. As much as I love CodeIgniter, it’s far from perfect. I’m more than curious if Fuel PHP can offer anything new to a glut of PHP frameworks that is already out there. There is Zend, CakePHP, CodeIgniter – which is my current favorite at the moment, and now Fuel. I was introduced to Fuel because some of the main supporters of CodeIgniter are now working with Fuel.

Here are some details from Fuel’s website.

Fuel is a simple, flexible, community driven PHP 5.3 web framework based on the best ideas of other frameworks with a fresh start.

The framework was started in late 2010 by Dan Horrigan then shortly after the team grew to include Phil Sturgeon, Jelmer Schreuder and Harro Verton. The team has decades of PHP experience between them and have all been involved with Open-Source projects such as CodeIgniter, PyroCMS, ExciteCMS and DataMapper ORM to name but a few.

April 1st, 2011 was the date of the first feature frozen Release Candidate, marking Fuel as ready to be used for development of new projects. v1.0 final is not yet ready but the only changes will be bug-fixes.

 

Differences Between CodeIgniter 1.7.2 and 2.0.0

It has been a year since I last touched CodeIgniter. At that time, I was working with version 1.7.2. Wanting to get back into it, I revisited the CodeIgniter website last week, and I learned that there is a new version of CodeIgniter, version 2.0.0. Last year, I created three personal projects that helped me learn how CodeIgniter works, as well as learn how MVC frameworks work in general.

I downloaded the latest version of CodeIgniter hoping that I should be able to move my old projects into the new version of CodeIgniter. Needless to say, the move was unsuccessful. I found out there are some significant changes to how CodeIgniter controllers and models are constructed between version 1.7.2 and 2.0.0. I should mention also, that there was a version in between that was released, version 1.7.3.

Here are the major differences in the way controllers and models are constructed between version 1.7.2 and version 2.0.0. In both cases, I’m using class constructors.

Version 1.7.2

Controllers

class Contact extends Controller {
  function Contact() {
    parent::Controller();
  }
}

Models

class Contact_model extends Model {
  function Contact_model() {
    parent::Model();
  }
}

Version 2.0.0

Controllers

class Contact extends CI_Controller {
  function __construct() {
    parent::__construct();
  }
}

Models

class Contact_model extends CI_Model {
  function __construct() {
    parent::__contruct();
  }
}

I might add, there are other changes I haven’t even mentioned. The biggest change is the removal of PHP 4 support. Version 2.0.0 requires PHP 5.1.6. Scaffolding is deprecated. Plugins have been removed in favor of Helpers, and few more.

Going Back To CodeIgniter

It’s has been months since I played around with CodeIgniter. I say, it’s time to head back into it. Or should I say, jump back head first. I just realized how much easier it is to whip out an application or two, by just piecing together a few lines of code.

The resulting code is light, fast and fairly efficient. I tried other PHP frameworks, like CakePHP, but for some reason I can’t really explain, I just couldn’t latch on to it. It’s a weak try on my part, but I just feel much more comfortable with CodeIgniter. Maybe, it’s the simplicity.

In any case, both CakePHP and CodeIgniter requires some heat, starting a fire, and some baking. But, first off, I need to get reacquainted with CodeIgniter.

I’m back reading The User Guide.