Home  >  Article  >  Backend Development  >  Some precautions when upgrading the project from Codeigniter 2.2 to Codeigniter 3.0, codeigniter2.2_PHP tutorial

Some precautions when upgrading the project from Codeigniter 2.2 to Codeigniter 3.0, codeigniter2.2_PHP tutorial

WBOY
WBOYOriginal
2016-07-12 09:08:111171browse

Some notes on upgrading the project from Codeigniter 2.2 to Codeigniter 3.0, codeigniter2.2

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1056840.htmlTechArticleSome precautions for upgrading the project from Codeigniter 2.2 to Codeigniter 3.0, codeigniter2.2 1. Replace everything in the system directory files and folders, and replace index.php 2. control...
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