Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to gradually convert a site over to CodeIgniter?

I've been doing a lot of research in regards to OO and MVC for PHP and have nearly made a choice to move to CodeIgniter for an existing large-scale website I manage. I feel that using an OO+MVC environment has a huge organizational and performance advantages and hopefully improved developing speed compared to the existing functional/procedural structure the site uses now.

However, due to the sheer size of the site, I would like to gradually transfer the code over to CodeIgniter's structure thus having a transitional time period where parts of the site are in CI and others are in the old style.

Are there any suggestions on the best way to do this from a code structure point of view while minimizing on the amount of duplicate code? I'm rather new to OO as well, and feel that gradual is the best way to do this due to the learning curve.

like image 599
David Avatar asked Dec 05 '12 13:12

David


2 Answers

You could install CI into a folder and redirect (though .htaccess) only the requests that you want to handle with CI. Other than that, everything should work as usual and you won't need to change much of your current functionality. The more sections work on CI, the more redirect rules you will have.

like image 91
Ranty Avatar answered Oct 22 '22 06:10

Ranty


I think you have to determine the dependent entities in your database (models) and start with them first such as some contacts, users registration and so on.

The most reliable and safe way, you have to copy your current working site to a local machine and start do it bit by bit, till you finish it all, upload it to your public web server.

like image 32
SaidbakR Avatar answered Oct 22 '22 08:10

SaidbakR