更新 1.2 到 1.3
注意: 本頁的更新步驟,都是假設你目前使用的是 version 1.2。 If you have not upgraded to that version please do so first.
Before performing an update you should take your site offline by replacing the index.php file with a static one.
步驟一: 更新 CodeIgniter 檔案
Replace the following directories in your "system" folder with the new versions:
注意: 如果之前在這些目錄裡頭,有任何你自己所開發的檔案,請記得要複製進去。
- application/models/ (new for 1.3)
- codeigniter (new for 1.3)
- drivers
- helpers
- init
- language
- libraries
- plugins
- scaffolding
步驟二: 更新 error 檔
Version 1.3 contains two new error templates located in application/errors,and for naming consistency the other error templates have been renamed.
If you have not customized any of the error templates simply replace this folder:
- application/errors/
If you have customized your error templates,rename them as follows:
- 404.php = error_404.php
- error.php = error_general.php
- error_db.php (new)
- error_php.php (new)
步驟三: 更新 index.php 檔
Please open your main index.php file (located at your root). At the very bottom of the file,change this:
require_once BASEPATH.'libraries/Front_controller'.EXT;
改成這樣:
require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;
步驟四: 更新 config.php 檔
Open your application/config/config.php file and add these new items:
/* |------------------------------------------------ | URL suffix |------------------------------------------------ | | This option allows you to add a suffix to all URLs. | For example,if a URL is this: | | example.com/index.php/products/view/shoes | | You can optionally add a suffix,like ".html", | making the page appear to be of a certain type: | | example.com/index.php/products/view/shoes.html | */ $config['url_suffix'] = ""; /* |------------------------------------------------ | Enable Query Strings |------------------------------------------------ | | By default CodeIgniter uses search-engine and | human-friendly segment based URLs: | | example.com/who/what/where/ | | You can optionally enable standard query string | based URLs: | | example.com?who=me&what=something&where=here | | Options are: TRUE or FALSE (boolean) | | The two other items let you set the query string "words" | that will invoke your controllers and functions: | example.com/index.php?c=controller&m=function | */ $config['enable_query_strings'] = FALSE; $config['controller_trigger'] = 'c'; $config['function_trigger'] = 'm';
步驟五: 更新 datebase.php 檔
Open your application/config/database.php file and add these new items:
$db['default']['dbprefix'] = ""; $db['default']['active_r'] = TRUE;
步驟六: 更新使用手冊
也請別忘了把 local 的使用手冊換上新的版本。