Home > Article > Backend Development > Some precautions when upgrading the project from Codeigniter 2.2 to Codeigniter 3.0, codeigniter2.2_PHP tutorial
1. Replace all files and folders in the system directory, and replace the index. php
2. The first letters of the files in controllers and models need to be changed to uppercase: application.php -> Application.php, m_application.php -> M_application.php
3. Replace config/mimes.php
4. Remove $auto_load['core'] from config/autoload.php
5. The use of the session library has undergone major changes: the main thing in the project is to modify the unset_user_data function
<span>//</span><span> Old</span> <span>$this</span>->session->unset_userdata(<span>array</span>('item' => '', 'item2' => ''<span>)); </span><span>//</span><span> New</span> <span>$this</span>->session->unset_userdata(<span>array</span>('item', 'item2'));
6. Update the config/database.php file
<span>$active_group</span> = 'default'<span>; </span><span>//</span><span> $active_record = TRUE;</span> <span>$query_builder</span> = <span>TRUE</span><span>; </span><span>//</span><span>$db['default']['dbdriver'] = 'mysql';</span> <span>$db</span>['default']['dbdriver'] = 'mysqli';
7. Copy the errors folder under the CI3.0 views folder to the views folder of the project
8. Update the config/routes.php file, CI3.0 (:any) does not include '/'
(.+) <span>//</span><span> matches ANYTHING</span> (:any) <span>//</span><span> matches any character, except for '/'</span>
For more information, please see: http://codeigniter.org.cn/user_guide/installation/upgrade_300.html