Today we decided to port CloudIgniter over to CodeIgniter version 2.0beta. Besides a very few ‘gotchas’ we were up and running in about 30-40 minutes.
Phil Sturgeon wrote a guide a little while back, but I thought I’d expand on it just a little bit. Before even touching the core, I did a little bit of house-keeping.
First, we use Doctrine ORM (which we actually regret*), which we had implemented as a plugin, which are now gone in CI 2.0. Initially I tried to rewrite my Doctrine bootstrap file into a static class, but that just ended up in failure. So I had to move it to the helpers folder. This works, but is less than optimal in my personal opinion. In my doctrine_helper.php file there is a line that reads:
// CodeIgniter's Model class needs to be loaded require_once BASEPATH.'/libraries/Model.php';
In CodeIgniter 2.0 most of the libraries have been moved from the ‘libraries’ folder to the ‘core’ folder, so that little change was necessary.
Secondly, we made ‘core’ and ‘third_party’ folders in our application directory. If you extend CodeIgniter core libraries (anything that lives in ‘system/core’) they now need to live in the ‘application/core’ folder, and not the ‘libraries’ folder. The ‘third_party’ folder exists for CodeIgniter 2.0 ‘Packages’. There are a couple of new config files that need to be created. Phil mentions this in his post.
At this point, I just deleted the current system folder** and replaced it with the one in the CodeIgniter 2.0 download package. At this point, we we’re up and running.
I thought the move was going to be slightly more complicated, but it turned out to be quite a breeze.
* More detailed post on that coming soon.
** Our ‘application’ folder already lived outside of our ‘system folder’, so there was no need to move it in our case.