Welcome Guest, Not a member yet? Register   Sign In
Updating from 1.7.2 to 2.1.4
#1

[eluser]Unknown[/eluser]
Hello. The company I work for developed a site for a client using Codeigniter about 3 years ago. The client JUST NOW launched the site and wants the code to be updated to the latest version. I work mainly in Wordpress and have 0 experience with Codeigniter. The update documentation looked fairly complicated so I'm wondering if anyone could help me out. I have FTP credentials and everything I need to update, but really don't understand how to go about it. Could someone walk me through how to update from 1.7.2 to 2.1.4?

Thanks so much!
#2

[eluser]Tpojka[/eluser]
If you can't follow steps for upgrading process detailed descripted on user guide page (should be followed most of processes 1.7.2. - 2.1.4.), company should consider paying someone for that job. With all regards, it is not some grammar spelling or function bug, but hours of work.
For someone who knows what is doing, in case there is no unpredictable moments (such are rewriting some code if needed),
that is about day of work in charge imho.

Before doing anything: backup all files and DB too.
2ยข
#3

[eluser]CroNiX[/eluser]
A lot can be done with search/replace in your IDE or command line.

Controllers:
Search for "extends Controller"
replace with "extends CI_Controller"

Models:
Search for "extends Model"
replace with "extends CI_Model"

All constructors need to be updated to be PHP5 compatable.

Original:
Code:
class Your_class extends Controller {
  //PHP4 construct
  function Your_class()
  {
    parent::Controller();
    //code
  }
}

Using PHP5 Constructs:
Code:
class Your_class extends CI_Controller {
  public function __construct()
  {
    parent::__construct();
    //code
  }
}

The same needs to be done for models, libraries, etc. You'd also need to follow all of the migration steps, but the above search/replace is the bulk of it. For instance, CI 1.72 was structured like:

Code:
/system
  /application
index.php

and CI 2 is structured like:
Code:
/system
/application
index.php
Where the application dir is not within the system dir.




Theme © iAndrew 2016 - Forum software by © MyBB