Home >Backend Development >PHP Tutorial >Some considerations when upgrading projects from Codeigniter 22 to Codeigniter 30

Some considerations when upgrading projects from Codeigniter 22 to Codeigniter 30

WBOY
WBOYOriginal
2016-07-29 09:14:55865browse

1. Replace all files and folders in the system directory, and replace 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 purpose of 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. Change the CI3.0 views folder Copy the errors folder under the project 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

The above introduces some precautions for upgrading the project from Codeigniter 22 to Codeigniter 30, including aspects of the project. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn