codeIgniter from 2.X to 3.0 |
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 Edit: There is a problem with codeigniter2 and earlier version of codeigniter 3 working with sessions on php 7 but it has been fixed now. All you need do is to replace the system folder with the latest version of codeigniter system folder.. Links: https://www.codeigniter.com/userguide3/i...e_300.html /owespeedtest |
Messages In This Thread |
codeIgniter from 2.X to 3.0 - by SonopaalFounik - 05-24-2023, 01:24 AM
|