upgrade_130.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="utf-8" lang="utf-8">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0" />
  6. <title>从 1.2 升级到 1.3 - CodeIgniter 中文手册|用户手册|用户指南|Wiki文档</title>
  7. <link rel="shortcut icon" href="http://codeigniter.org.cn/user_guide/../images/design/favicon.ico" type="image/x-icon" />
  8. <link rel="stylesheet" type="text/css" media="all" href="../userguide.css" />
  9. <link rel="search" href="http://codeigniter.org.cn/user_guide/../CodeIgniterSearch.xml" type="application/opensearchdescription+xml" title="CodeIgniter 搜索"/>
  10. <link rel="canonical" href="http://codeigniter.org.cn/user_guide/installation/upgrade_130.html" />
  11. <script type="text/javascript" src="../nav/mootools.js-ver=20130324.js"></script>
  12. <script type="text/javascript" src="../nav/mootools-more.js-ver=20130324.js"></script>
  13. <script type="text/javascript" src="../nav/nav.js-ver=20130324.js"></script>
  14. <script type="text/javascript" src="../nav/user_guide_menu.js-ver=20130324.js"></script>
  15. <meta name="robots" content="all" />
  16. <meta name="author" content="ExpressionEngine Dev Team" />
  17. <meta name="description" content="CodeIgniter 中文手册, CodeIgniter 用户指南, CodeIgniter User Guide, Wiki 文档" />
  18. </head>
  19. <body>
  20. <!-- START NAVIGATION -->
  21. <div id="nav">
  22. <div id="nav_inner">
  23. <script type="text/javascript">create_menu('../');</script>
  24. </div>
  25. </div>
  26. <script type="text/javascript">_setNavigation();</script>
  27. <div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="切换目录" alt="切换目录" /></a></div>
  28. <div id="masthead" class="clearfix">
  29. <div class="topbar-hd"><h1>CodeIgniter 用户指南 版本 2.2.0</h1></div>
  30. <div class="topbar-tip">编辑文档、查看近期更改请 <a href="#">登录</a> 或 <a href="#">注册</a>  <a href="#">找回密码</a></div> <div id="breadcrumb_right"><a href="../toc.html">目录页</a></div>
  31. </div>
  32. <!-- END NAVIGATION -->
  33. <!-- START BREADCRUMB -->
  34. <table cellpadding="0" cellspacing="0" border="0" style="width:100%">
  35. <tr>
  36. <td id="breadcrumb">
  37. <a href="#" target="_blank">CodeIgniter 中国首页</a>&nbsp;&#8250;&nbsp;
  38. <a href="../index.html">用户指南首页</a>&nbsp;&#8250;&nbsp;<a href="index.html">安装</a>&nbsp;&#8250;&nbsp;从 1.2 升级到 1.3 </td>
  39. <td id="searchbox">
  40. <form method="get" action="http://www.google.com.hk/search" target="google_window">
  41. <input type="hidden" name="client" value="pub-0176846097796333"></input>
  42. <input type="hidden" name="forid" value="1"></input>
  43. <input type="hidden" name="ie" value="UTF-8"></input>
  44. <input type="hidden" name="oe" value="UTF-8"></input>
  45. <input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.org.cn/user_guide/" />
  46. 搜索用户指南&nbsp;
  47. <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />
  48. &nbsp;
  49. <input type="submit" class="submit" name="sa" value="Go" />
  50. </form>
  51. </td>
  52. </tr>
  53. </table>
  54. <!-- END BREADCRUMB -->
  55. <div style="clear:both;text-align:right;padding: 6px 40px 0 0;">
  56. <a href="#" target="_blank">查看原文</a>
  57. </div>
  58. <!--<br clear="all" />--><!-- START CONTENT -->
  59. <div id="content">
  60. <h1>Upgrading from 1.2 to 1.3</h1>
  61. <p class="important"><strong>Note:</strong> The instructions on this page assume you are running version 1.2. If you
  62. have not upgraded to that version please do so first.</p>
  63. <p>Before performing an update you should take your site offline by replacing the index.php file
  64. with a static one.</p>
  65. <h2>Step 1: Update your CodeIgniter files</h2>
  66. <p>Replace the following directories in your "system" folder with the new versions:</p>
  67. <p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
  68. <ul>
  69. <li>application/<strong>models</strong>/&nbsp;&nbsp; (new for 1.3)</li>
  70. <li>codeigniter&nbsp;&nbsp; (new for 1.3)</li>
  71. <li>drivers</li>
  72. <li>helpers</li>
  73. <li>init</li>
  74. <li>language</li>
  75. <li>libraries</li>
  76. <li>plugins</li>
  77. <li>scaffolding</li>
  78. </ul>
  79. <h2>Step 2: Update your error files</h2>
  80. <p>Version 1.3 contains two new error templates located in <dfn>application/errors</dfn>, and for naming consistency the other error templates have
  81. been renamed.</p>
  82. <p>If you <strong>have not</strong> customized any of the error templates simply
  83. replace this folder:</p>
  84. <ul>
  85. <li>application/errors/</li>
  86. </ul>
  87. <p>If you <strong>have</strong> customized your error templates, rename them as follows:</p>
  88. <ul>
  89. <li>404.php&nbsp;&nbsp; =&nbsp; error_404.php</li>
  90. <li>error.php&nbsp;&nbsp; =&nbsp; error_general.php</li>
  91. <li>error_db.php&nbsp;&nbsp; (new)</li>
  92. <li>error_php.php&nbsp;&nbsp; (new)</li>
  93. </ul>
  94. <h2>Step 3: Update your index.php file</h2>
  95. <p>Please open your main <dfn>index.php</dfn> file &#40;located at your root&#41;. At the very bottom of the file, change this:</p>
  96. <code>require_once BASEPATH.'libraries/Front_controller'.EXT;</code>
  97. <p>To this:</p>
  98. <code>require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;</code>
  99. <h2>Step 4: Update your config.php file</h2>
  100. <p>Open your <dfn>application/config/config.php</dfn> file and add these new items:</p>
  101. <pre>
  102. /*
  103. |------------------------------------------------
  104. | URL suffix
  105. |------------------------------------------------
  106. |
  107. | This option allows you to add a suffix to all URLs.
  108. | For example, if a URL is this:
  109. |
  110. | example.com/index.php/products/view/shoes
  111. |
  112. | You can optionally add a suffix, like ".html",
  113. | making the page appear to be of a certain type:
  114. |
  115. | example.com/index.php/products/view/shoes.html
  116. |
  117. */
  118. $config['url_suffix'] = "";
  119. /*
  120. |------------------------------------------------
  121. | Enable Query Strings
  122. |------------------------------------------------
  123. |
  124. | By default CodeIgniter uses search-engine and
  125. | human-friendly segment based URLs:
  126. |
  127. | example.com/who/what/where/
  128. |
  129. | You can optionally enable standard query string
  130. | based URLs:
  131. |
  132. | example.com?who=me&what;=something&where;=here
  133. |
  134. | Options are: TRUE or FALSE (boolean)
  135. |
  136. | The two other items let you set the query string "words"
  137. | that will invoke your controllers and functions:
  138. | example.com/index.php?c=controller&m;=function
  139. |
  140. */
  141. $config['enable_query_strings'] = FALSE;
  142. $config['controller_trigger'] = 'c';
  143. $config['function_trigger'] = 'm';
  144. </pre>
  145. <h2>Step 5: Update your database.php file</h2>
  146. <p>Open your <dfn>application/config/database.php</dfn> file and add these new items:</p>
  147. <pre>
  148. $db['default']['dbprefix'] = "";
  149. $db['default']['active_r'] = TRUE;
  150. </pre>
  151. <h2>Step 6: Update your user guide</h2>
  152. <p>Please also replace your local copy of the user guide with the new version.</p><p>&nbsp;</p>
  153. <div id="Contributors">
  154. 翻译贡献者:
  155. Hex</div>
  156. <div id="DocDate">
  157. 最后修改: 2009-02-21 23:15:17</div>
  158. </div>
  159. <!-- END CONTENT -->
  160. <div id="footer">
  161. <p>
  162. 上一个主题:&nbsp;&nbsp;<a href="index.html">安装指导</a>&nbsp;&nbsp;&middot;&nbsp;&nbsp;<a href="#top">页首</a>
  163. &nbsp;&middot;&nbsp;&nbsp;<a href="../index.html">用户指南首页</a>&nbsp;&nbsp;&middot;&nbsp;&nbsp;下一个主题:&nbsp;&nbsp;<a href="troubleshooting.html">疑难解答</a> </p>
  164. <p><a href="#">CodeIgniter</a> &nbsp;&middot;&nbsp; 版权所有 &#169; 2006-2013 &nbsp;&middot;&nbsp; <a href="#">Ellislab, Inc.</a></p>
  165. <p>中文化: <a href="#">CodeIgniter 中国</a> &nbsp;&middot;&nbsp; 制作: Hex &nbsp;&middot;&nbsp; 版本: 1.30 &nbsp;&middot;&nbsp; 鸣谢: 子非鱼</p>
  166. </div>
  167. </body>
  168. </html>