Welcome Guest, Not a member yet? Register   Sign In
Upgrade codeIgniter from 2.X to 3.0
#1

I'm writting there because I'm actually facing a hard problem. Currently, I see that PHP7 was realease ! Oh Nice, I think. So I try as soon as I saw that to push my website under codeigniter 2.X on my new server PHP7. And I see that he will never work at least I upgrade my core to the new one : Code Igniter 3.0.6.

And from there, many problem appear. I solve plenty of them. I change the name of my models, I change some functions because now, some functions are returning "Null" instead of "False", I change the structure of the database for the sessions...And I did many others change, one after the other for making my website come back to life. But now, I'm actually stuck on two problems.

1 -> The first one is about "admin session". I have a page where the admin have to enter his username/password. Everything was working well under code igniter 2 but now, I have a strange bug. If i try to connect, it will not work the first time. Then if i wait 10 min and try again, it's gonna work...:X I dont understand why ?!

The part of the code that create the session is that one. I'm showing you that part because I'm almost sure my error is there :

    // Set the session Data
    $this->CI->adminsession->sess_destroy();
    $this->CI->adminsession->sess_create();

    $this->CI->adminsession->set_userdata('AdminUserID', $model->Item('id') );
    $this->CI->adminsession->set_userdata('AdminUserName', $model->Item('FirstName') );
    $this->CI->adminsession->set_userdata('AdminUserType', $model->Item('Type') );
I change the text in bold by that : $this->CI->adminsession->__construct(); because sess_create does not existe anymore in CI3.

2 -> I have an other bug with the database. A lof part of the website call the database and does not return any result. It's like the database is not read by the code. I cannot figure it out where is the bug and how I can find it. I dont get any error message so it's quite harde to debug. Do you have any idea how I could proceed for that one ?

Thank in advance for the answer
Reply
#2

If you have a CodeIgniter 2.x.x version then don't even try to upgrade to version 3.x.x

You should rewrite your project from scratch in CodeIgniter 4.2.10

To many security problems with the older versions.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB