PageRenderTime 63ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/user_guide/installation/upgrade_300.html

https://bitbucket.org/Naked_Yoshi/sq_kanban
HTML | 1330 lines | 1229 code | 100 blank | 1 comment | 0 complexity | 9062d7fb27ea2fe5bcc96abab6f2ebc2 MD5 | raw file
  1. <!DOCTYPE html>
  2. <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
  3. <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Upgrading from 2.2.x to 3.0.x &mdash; CodeIgniter 3.1.6 documentation</title>
  8. <link rel="shortcut icon" href="../_static/ci-icon.ico"/>
  9. <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
  10. <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" />
  11. <link rel="index" title="Index"
  12. href="../genindex.html"/>
  13. <link rel="search" title="Search" href="../search.html"/>
  14. <link rel="top" title="CodeIgniter 3.1.6 documentation" href="../index.html"/>
  15. <link rel="up" title="Upgrading From a Previous Version" href="upgrading.html"/>
  16. <link rel="next" title="Upgrading from 2.2.2 to 2.2.3" href="upgrade_223.html"/>
  17. <link rel="prev" title="Upgrading from 3.0.0 to 3.0.1" href="upgrade_301.html"/>
  18. <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
  19. </head>
  20. <body class="wy-body-for-nav" role="document">
  21. <div id="nav">
  22. <div id="nav_inner">
  23. <div id="pulldown-menu" class="ciNav">
  24. <ul>
  25. <li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">Welcome to CodeIgniter</a></li>
  26. </ul>
  27. <ul class="current">
  28. <li class="toctree-l1 current"><a class="reference internal" href="index.html">Installation Instructions</a><ul class="current">
  29. <li class="toctree-l2"><a class="reference internal" href="downloads.html">Downloading CodeIgniter</a></li>
  30. <li class="toctree-l2"><a class="reference internal" href="index.html">Installation Instructions</a></li>
  31. <li class="toctree-l2 current"><a class="reference internal" href="upgrading.html">Upgrading From a Previous Version</a></li>
  32. <li class="toctree-l2"><a class="reference internal" href="troubleshooting.html">Troubleshooting</a></li>
  33. </ul>
  34. </li>
  35. </ul>
  36. <ul>
  37. <li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul>
  38. <li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li>
  39. <li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li>
  40. <li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li>
  41. <li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li>
  42. <li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li>
  43. <li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li>
  44. </ul>
  45. </li>
  46. </ul>
  47. <ul>
  48. <li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul>
  49. <li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li>
  50. <li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li>
  51. <li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li>
  52. <li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li>
  53. </ul>
  54. </li>
  55. </ul>
  56. <ul>
  57. <li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul>
  58. <li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li>
  59. <li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developers Certificate of Origin 1.1</a></li>
  60. </ul>
  61. </li>
  62. </ul>
  63. <ul>
  64. <li class="toctree-l1"><a class="reference internal" href="../general/index.html">General Topics</a><ul>
  65. <li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li>
  66. <li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li>
  67. <li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li>
  68. <li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li>
  69. <li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li>
  70. <li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li>
  71. <li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li>
  72. <li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li>
  73. <li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li>
  74. <li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li>
  75. <li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li>
  76. <li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li>
  77. <li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li>
  78. <li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li>
  79. <li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li>
  80. <li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li>
  81. <li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li>
  82. <li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li>
  83. <li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li>
  84. <li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li>
  85. <li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li>
  86. <li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li>
  87. <li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li>
  88. <li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li>
  89. <li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li>
  90. <li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP Style Guide</a></li>
  91. </ul>
  92. </li>
  93. </ul>
  94. <ul>
  95. <li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul>
  96. <li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li>
  97. <li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li>
  98. <li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li>
  99. <li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li>
  100. <li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li>
  101. <li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li>
  102. <li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li>
  103. <li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li>
  104. <li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li>
  105. <li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li>
  106. <li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li>
  107. <li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li>
  108. <li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li>
  109. <li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li>
  110. <li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li>
  111. <li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li>
  112. <li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li>
  113. <li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li>
  114. <li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li>
  115. <li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li>
  116. <li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li>
  117. <li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li>
  118. <li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li>
  119. <li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li>
  120. <li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li>
  121. <li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li>
  122. <li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li>
  123. <li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li>
  124. <li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li>
  125. <li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li>
  126. </ul>
  127. </li>
  128. </ul>
  129. <ul>
  130. <li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul>
  131. <li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li>
  132. <li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li>
  133. <li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li>
  134. <li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li>
  135. <li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li>
  136. <li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li>
  137. <li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li>
  138. <li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li>
  139. <li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li>
  140. <li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li>
  141. <li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li>
  142. <li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li>
  143. <li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li>
  144. <li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li>
  145. </ul>
  146. </li>
  147. </ul>
  148. <ul>
  149. <li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul>
  150. <li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li>
  151. <li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li>
  152. <li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li>
  153. <li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li>
  154. <li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li>
  155. <li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li>
  156. <li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li>
  157. <li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li>
  158. <li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li>
  159. <li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li>
  160. <li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li>
  161. <li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li>
  162. <li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li>
  163. <li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li>
  164. <li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li>
  165. <li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li>
  166. <li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li>
  167. <li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li>
  168. <li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li>
  169. <li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li>
  170. <li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li>
  171. </ul>
  172. </li>
  173. </ul>
  174. </div>
  175. </div>
  176. </div>
  177. <div id="nav2">
  178. <a href="#" id="openToc">
  179. <img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAAAf/bAIQABAMDAwMDBAMDBAYEAwQGBwUEBAUHCAYGBwYGCAoICQkJCQgKCgwMDAwMCgwMDQ0MDBERERERFBQUFBQUFBQUFAEEBQUIBwgPCgoPFA4ODhQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgAKwCaAwERAAIRAQMRAf/EAHsAAQAABwEBAAAAAAAAAAAAAAABAwQFBgcIAgkBAQAAAAAAAAAAAAAAAAAAAAAQAAEDAwICBwYEAgsAAAAAAAIBAwQAEQUSBiEHkROTVNQWGDFBUVIUCHEiMtOUFWGBobHRQlMkZIRVEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwDSC+ygkOOaUoKigUCgUCgUCgUCgUCgUCgUCgkuGguIP9FBMFb0Hqg7We+3jlmIqqYFf4ub+/QYlnOR/LqIBKGFUbf8qWv971BytQXXE7Y3Lnm3HsFhp2TaZJAdchRXpIgSpdEJWxJEW3xoKV7F5OMy7JkQn2o7D6w33XGjEAkoiqrJEqIiOIiKuhePCgqp22dyYyS3CyWHnQ5joG61HkRnmnTbaFSMhExRVQRRVJU9iUHjE7ez+fJ0MFipmUNhBV8YUd2SoIV9KkjQla9ltegttBdPLW4/qocL+UTfrMiHW4+P9M71shuyrqaHTcxsl7jegpsji8nh5ZwMvDfgTm0RTjSmjYdFCS6KoOIipdFunCgmNYTMv457MMY6U7iI6oMieDDhRm1VbIhuoOkbqtuK0Hpzb+eZcYZexUxt6UyUqK2cd0SdjtgrhOgijcgERUlJOCIl6CpgbP3blRI8XgMjNARAyKNDfeRBdFDBVUAXgQrqH4pxoJTu2NysY97LP4ac1io5q1InHFeGO24LnVKJuKOkSQ/yKir+rh7aCLG1dzypZQI2FnvTgccYOM3FeN0XWERXAUEFVQgQkUktdLpegm+Td3/Xli/L+S/mYNJIOF9G/wBeLKrZHFb0akG6W1WtQWSg3Dyg5e7V3fipE3O4/wCrktyzYA+ufas2LbZIlmnAT2kvuoN1wft95augilglX/tzP3qCu9O3LL/wV/i5v79BvmTADq14UGu91467Z6U9y0HzH/ncj/U/sT/CgynZG7I2NezpZGUjIycJkYkZSG+uQ81pbBNKLxJfjwoMqZ3/ALYHl35AJ7/cuwHcu5k7r1Q5pHetBjquqVVJWGxj9Zrtcl/Ggy3dHMvauR3HFZj5nHNxSyW5JISYDMoIwx8tFIGHZhPNaykGapr6rUAiicEoMG21lMRj8buPAz8xhJrr7uOeiPTCyAwXUaGR1mgozbTusOsFLEiJ7fbQa/h7gcjy2H3V6xppwDNtUSxCJIqp7valBuWVzJ22xuCROXNNZiJkMtms0DbjUkAZjzoDrTMd9dDRI44ZC2YsrYdKWP2WDT2S3N9dNdlRYrGMYc06IURXSYb0igrpWS485xVNS6nF4rwslkoMwnbpgZLB7bmt5uMweAhDEl4B5uSLzzqTnnyVpW2jaJHRMSIjdDiiotvy3DOE5rYTEbkl5yFn28k7JyG4c7AU2HtLH1uKfaiMPI40CdYbpNtmLdwTSn5rewLNld+7TLdeal4WarWBkbVKBjgdElMJJwAAY5fl4kB3b1fp4XvagsGS3FjJfLzDNtS8aeXx7LzT7TyzByQE5PccRGRC0ZRUDRV6y62vbjagzLmJzS2vuPK43JY6aP1TW6Jz+RIWyFtyC06y3EkiiinAo7YCqfq1AqqnGgsOH3lhZO8d1pmcpB8j5XIm9OYlBJSQ/FSS4427DKO0RC8AlcEMhFdViRR1WDWR5t3WXVuL1d106kG9vdeye2g60+1FDyW0shIcXVpyroXt8I8dfd+NB1vioAdWnD3UF1+gD4UFc6CEKpagxXN43rwJLUHz7yX2c8zokt9uHlsPIhA4aRnnHJTLptIS6CNsY7iASpxUUMkReGpfbQW0vtN5pitvrsN28rwtBD0nc0+/Yft5XhaB6TuaXfsP28rwtA9J3NPv2H7eV4Wgek7mn37D9vK8LQPSdzT79h+3leFoHpO5pd+w/byvC0D0nc0u/Yft5XhaB6TuaXfsP28rwtA9J3NLv2H7eV4Wgek7ml37D9vK8LQPSdzS79h+3leFoHpO5p9+w/byvC0E9r7Reazy2HIYVPxkS/CUHVn26cosxyv2g7h89LYmZSXOenvLEQ1YaQ222RATcQCP8rSGqqA8S02W2pQ6FhMoAIlqCtsnwoCpdKClejI4i3Sgtb+GBxVuNBSFt1pV/RQefLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8utJ/koJ7WCbBU/LQXOPAFq1koK8B0pag90CggtBBf6qB0UDooHRQOigdFA6KB0UDooHRQOigdFA6KB0UDooI0EaBQf//Z" title="Toggle Table of Contents" alt="Toggle Table of Contents" />
  180. </a>
  181. </div>
  182. <div class="wy-grid-for-nav">
  183. <nav data-toggle="wy-nav-shift" class="wy-nav-side">
  184. <div class="wy-side-nav-search">
  185. <a href="../index.html" class="fa fa-home"> CodeIgniter</a>
  186. <div role="search">
  187. <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
  188. <input type="text" name="q" placeholder="Search docs" />
  189. <input type="hidden" name="check_keywords" value="yes" />
  190. <input type="hidden" name="area" value="default" />
  191. </form>
  192. </div>
  193. </div>
  194. <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
  195. <ul>
  196. <li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">Welcome to CodeIgniter</a></li>
  197. </ul>
  198. <ul class="current">
  199. <li class="toctree-l1 current"><a class="reference internal" href="index.html">Installation Instructions</a><ul class="current">
  200. <li class="toctree-l2"><a class="reference internal" href="downloads.html">Downloading CodeIgniter</a></li>
  201. <li class="toctree-l2"><a class="reference internal" href="index.html">Installation Instructions</a></li>
  202. <li class="toctree-l2 current"><a class="reference internal" href="upgrading.html">Upgrading From a Previous Version</a></li>
  203. <li class="toctree-l2"><a class="reference internal" href="troubleshooting.html">Troubleshooting</a></li>
  204. </ul>
  205. </li>
  206. </ul>
  207. <ul>
  208. <li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul>
  209. <li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li>
  210. <li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li>
  211. <li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li>
  212. <li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li>
  213. <li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li>
  214. <li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li>
  215. </ul>
  216. </li>
  217. </ul>
  218. <ul>
  219. <li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul>
  220. <li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li>
  221. <li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li>
  222. <li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li>
  223. <li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li>
  224. </ul>
  225. </li>
  226. </ul>
  227. <ul>
  228. <li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul>
  229. <li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li>
  230. <li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developers Certificate of Origin 1.1</a></li>
  231. </ul>
  232. </li>
  233. </ul>
  234. <ul>
  235. <li class="toctree-l1"><a class="reference internal" href="../general/index.html">General Topics</a><ul>
  236. <li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li>
  237. <li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li>
  238. <li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li>
  239. <li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li>
  240. <li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li>
  241. <li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li>
  242. <li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li>
  243. <li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li>
  244. <li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li>
  245. <li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li>
  246. <li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li>
  247. <li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li>
  248. <li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li>
  249. <li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li>
  250. <li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li>
  251. <li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li>
  252. <li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li>
  253. <li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li>
  254. <li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li>
  255. <li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li>
  256. <li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li>
  257. <li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li>
  258. <li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li>
  259. <li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li>
  260. <li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li>
  261. <li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP Style Guide</a></li>
  262. </ul>
  263. </li>
  264. </ul>
  265. <ul>
  266. <li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul>
  267. <li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li>
  268. <li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li>
  269. <li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li>
  270. <li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li>
  271. <li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li>
  272. <li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li>
  273. <li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li>
  274. <li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li>
  275. <li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li>
  276. <li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li>
  277. <li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li>
  278. <li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li>
  279. <li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li>
  280. <li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li>
  281. <li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li>
  282. <li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li>
  283. <li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li>
  284. <li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li>
  285. <li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li>
  286. <li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li>
  287. <li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li>
  288. <li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li>
  289. <li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li>
  290. <li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li>
  291. <li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li>
  292. <li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li>
  293. <li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li>
  294. <li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li>
  295. <li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li>
  296. <li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li>
  297. </ul>
  298. </li>
  299. </ul>
  300. <ul>
  301. <li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul>
  302. <li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li>
  303. <li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li>
  304. <li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li>
  305. <li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li>
  306. <li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li>
  307. <li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li>
  308. <li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li>
  309. <li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li>
  310. <li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li>
  311. <li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li>
  312. <li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li>
  313. <li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li>
  314. <li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li>
  315. <li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li>
  316. </ul>
  317. </li>
  318. </ul>
  319. <ul>
  320. <li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul>
  321. <li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li>
  322. <li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li>
  323. <li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li>
  324. <li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li>
  325. <li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li>
  326. <li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li>
  327. <li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li>
  328. <li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li>
  329. <li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li>
  330. <li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li>
  331. <li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li>
  332. <li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li>
  333. <li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li>
  334. <li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li>
  335. <li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li>
  336. <li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li>
  337. <li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li>
  338. <li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li>
  339. <li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li>
  340. <li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li>
  341. <li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li>
  342. </ul>
  343. </li>
  344. </ul>
  345. </div>
  346. &nbsp;
  347. </nav>
  348. <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
  349. <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
  350. <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
  351. <a href="../index.html">CodeIgniter</a>
  352. </nav>
  353. <div class="wy-nav-content">
  354. <div class="rst-content">
  355. <div role="navigation" aria-label="breadcrumbs navigation">
  356. <ul class="wy-breadcrumbs">
  357. <li><a href="../index.html">Docs</a> &raquo;</li>
  358. <li><a href="index.html">Installation Instructions</a> &raquo;</li>
  359. <li><a href="upgrading.html">Upgrading From a Previous Version</a> &raquo;</li>
  360. <li>Upgrading from 2.2.x to 3.0.x</li>
  361. <li class="wy-breadcrumbs-aside">
  362. </li>
  363. <div style="float:right;margin-left:5px;" id="closeMe">
  364. <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" />
  365. </div>
  366. </ul>
  367. <hr/>
  368. </div>
  369. <div role="main" class="document">
  370. <div class="section" id="upgrading-from-2-2-x-to-3-0-x">
  371. <h1>Upgrading from 2.2.x to 3.0.x<a class="headerlink" href="#upgrading-from-2-2-x-to-3-0-x" title="Permalink to this headline"></a></h1>
  372. <p>Before performing an update you should take your site offline by replacing the index.php file with a static one.</p>
  373. <div class="section" id="step-1-update-your-codeigniter-files">
  374. <h2>Step 1: Update your CodeIgniter files<a class="headerlink" href="#step-1-update-your-codeigniter-files" title="Permalink to this headline"></a></h2>
  375. <p><strong>Replace</strong> all files and directories in your <em>system/</em> directory and
  376. replace your index.php file. If any modifications were made to your
  377. index.php they will need to be made fresh in this new one.</p>
  378. <div class="admonition important">
  379. <p class="first admonition-title">Important</p>
  380. <p class="last">You have to delete the old <em>system/</em> directory first and
  381. then put the new one in its place. A simple copy-paste may cause
  382. issues.</p>
  383. </div>
  384. <div class="admonition note">
  385. <p class="first admonition-title">Note</p>
  386. <p class="last">If you have any custom developed files in these folders please
  387. make copies of them first.</p>
  388. </div>
  389. </div>
  390. <div class="section" id="step-2-update-your-classes-file-names">
  391. <h2>Step 2: Update your classes file names<a class="headerlink" href="#step-2-update-your-classes-file-names" title="Permalink to this headline"></a></h2>
  392. <p>Starting with CodeIgniter 3.0, all class filenames (libraries, drivers, controllers
  393. and models) must be named in a Ucfirst-like manner or in other words - they must
  394. start with a capital letter.</p>
  395. <p>For example, if you have the following library file:</p>
  396. <blockquote>
  397. <div>application/libraries/mylibrary.php</div></blockquote>
  398. <p> then youll have to rename it to:</p>
  399. <blockquote>
  400. <div>application/libraries/Mylibrary.php</div></blockquote>
  401. <p>The same goes for driver libraries and extensions and/or overrides of CodeIgniters
  402. own libraries and core classes.</p>
  403. <blockquote>
  404. <div>application/libraries/MY_email.php
  405. application/core/MY_log.php</div></blockquote>
  406. <p>The above files should respectively be renamed to the following:</p>
  407. <blockquote>
  408. <div>application/libraries/MY_Email.php
  409. application/core/MY_Log.php</div></blockquote>
  410. <p>Controllers:</p>
  411. <blockquote>
  412. <div>application/controllers/welcome.php -&gt; application/controllers/Welcome.php</div></blockquote>
  413. <p>Models:</p>
  414. <blockquote>
  415. <div>application/models/misc_model.php -&gt; application/models/Misc_model.php</div></blockquote>
  416. <p>Please note that this DOES NOT affect directories, configuration files, views,
  417. helpers, hooks and anything else - it is only applied to classes.</p>
  418. <p>You must now follow just one simple rule - class names in Ucfirst and everything else
  419. in lowercase.</p>
  420. </div>
  421. <div class="section" id="step-3-replace-config-mimes-php">
  422. <h2>Step 3: Replace config/mimes.php<a class="headerlink" href="#step-3-replace-config-mimes-php" title="Permalink to this headline"></a></h2>
  423. <p>This config file has been updated to contain more user mime-types, please copy
  424. it to <em>application/config/mimes.php</em>.</p>
  425. </div>
  426. <div class="section" id="step-4-remove-autoload-core-from-your-config-autoload-php">
  427. <h2>Step 4: Remove $autoload[core] from your config/autoload.php<a class="headerlink" href="#step-4-remove-autoload-core-from-your-config-autoload-php" title="Permalink to this headline"></a></h2>
  428. <p>Use of the <code class="docutils literal"><span class="pre">$autoload['core']</span></code> config array has been deprecated as of CodeIgniter 1.4.1 and is now removed.
  429. Move any entries that you might have listed there to <code class="docutils literal"><span class="pre">$autoload['libraries']</span></code> instead.</p>
  430. </div>
  431. <div class="section" id="step-5-move-your-log-class-overrides-or-extensions">
  432. <h2>Step 5: Move your Log class overrides or extensions<a class="headerlink" href="#step-5-move-your-log-class-overrides-or-extensions" title="Permalink to this headline"></a></h2>
  433. <p>The Log Class is considered as a core class and is now located in the
  434. <strong>system/core/</strong> directory. Therefore, in order for your Log class overrides
  435. or extensions to work, you need to move them to <strong>application/core/</strong>:</p>
  436. <blockquote>
  437. <div>application/libraries/Log.php -&gt; application/core/Log.php
  438. application/libraries/MY_Log.php -&gt; application/core/MY_Log.php</div></blockquote>
  439. </div>
  440. <div class="section" id="step-6-update-your-session-library-usage">
  441. <h2>Step 6: Update your Session library usage<a class="headerlink" href="#step-6-update-your-session-library-usage" title="Permalink to this headline"></a></h2>
  442. <p>The <a class="reference internal" href="../libraries/sessions.html"><span class="doc">Session Library</span></a> has been completely
  443. re-written in CodeIgniter 3 and now comes with a bunch of new features,
  444. but that also means that there are changes that you should make </p>
  445. <p>Most notably, the library now uses separate storage drivers instead of
  446. always relying on (encrypted) cookies.
  447. In fact, cookies as storage have now been removed and you must always use
  448. some kind of server-side storage engine, with the file-system being the
  449. default option.</p>
  450. <p>The Session Class now utilizes PHPs own mechanisms for building custom
  451. session handlers, which also means that your session data is now
  452. accessible via the <code class="docutils literal"><span class="pre">$_SESSION</span></code> superglobal (though, weve kept the
  453. possibility to use it as userdata, like youve done until now).</p>
  454. <p>A few configuration options have been removed and a few have been added.
  455. You should really read the whole <a class="reference internal" href="../libraries/sessions.html"><span class="doc">Session library manual</span></a> for the details, but heres a short list of changes
  456. that you should make:</p>
  457. <blockquote>
  458. <div><ul>
  459. <li><p class="first">Set your <code class="docutils literal"><span class="pre">$config['sess_driver']</span></code> value</p>
  460. <p>It will default to files, unless youve previously used
  461. <code class="docutils literal"><span class="pre">$config['sess_use_database']</span></code>, in which case it will be set to
  462. database.</p>
  463. </li>
  464. <li><p class="first">Set a <code class="docutils literal"><span class="pre">$config['sess_save_path']</span></code> value</p>
  465. <p>For the database driver, a fallback to <code class="docutils literal"><span class="pre">$config['sess_table_name']</span></code>
  466. is in place, but otherwise requires you to read the manual for the
  467. specific driver of your choice.</p>
  468. </li>
  469. <li><p class="first">Update your <code class="docutils literal"><span class="pre">ci_sessions</span></code> table (database driver only)</p>
  470. <p>The table structure has changed a bit, and more specifically:</p>
  471. <blockquote>
  472. <div><ul class="simple">
  473. <li><code class="docutils literal"><span class="pre">session_id</span></code> field is renamed to <code class="docutils literal"><span class="pre">id</span></code></li>
  474. <li><code class="docutils literal"><span class="pre">user_agent</span></code> field is dropped</li>
  475. <li><code class="docutils literal"><span class="pre">user_data</span></code> field is renamed to <code class="docutils literal"><span class="pre">data</span></code> and under MySQL is now of type BLOB</li>
  476. <li><code class="docutils literal"><span class="pre">last_activity</span></code> field is renamed to <code class="docutils literal"><span class="pre">timestamp</span></code></li>
  477. </ul>
  478. </div></blockquote>
  479. <p>This is accompanied by a slight change in the table indexes too, so
  480. please read the manual about the <a class="reference external" href="../libraries/sessions.html#database-driver">Session Database Driver</a> for more information.</p>
  481. <div class="admonition important">
  482. <p class="first admonition-title">Important</p>
  483. <p class="last">Only MySQL and PostgreSQL are officially supported
  484. now. Other databases may still work, but due to lack of advisory
  485. locking features, they are unsafe for concurrent requests and
  486. you should consider using another driver instead.</p>
  487. </div>
  488. </li>
  489. <li><p class="first">Remove <code class="docutils literal"><span class="pre">$config['sess_match_useragent']</span></code></p>
  490. <p>The user-agent string is input supplied by the users browser, or in
  491. other words: client side input. As such, it is an ineffective feature
  492. and hence why it has been removed.</p>
  493. </li>
  494. <li><p class="first">Remove <code class="docutils literal"><span class="pre">$config['sess_encrypt_cookie']</span></code></p>
  495. <p>As already noted, the library no longer uses cookies as a storage
  496. mechanism, which renders this option useless.</p>
  497. </li>
  498. <li><p class="first">Remove <code class="docutils literal"><span class="pre">$config['sess_expire_on_close']</span></code></p>
  499. <p>This option is still usable, but only for backwards compatibility
  500. purposes and it should be otherwise removed. The same effect is
  501. achieved by setting <code class="docutils literal"><span class="pre">$config['sess_expiration']</span></code> to 0.</p>
  502. </li>
  503. <li><p class="first">Check flashdata for collisions with userdata</p>
  504. <p>Flashdata is now just regular userdata, only marked for deletion on
  505. the next request. In other words: you cant have both userdata and
  506. flashdata with the same name, because its the same thing.</p>
  507. </li>
  508. <li><p class="first">Check usage of session metadata</p>
  509. <p>Previously, you could access the session_id, ip_address,
  510. user_agent and last_activity metadata items as userdata.
  511. This is no longer possible, and you should read the notes about
  512. <a class="reference external" href="../libraries/sessions.html#accessing-session-metadata">Session Metadata</a>
  513. if your application relies on those values.</p>
  514. </li>
  515. <li><p class="first">Check <code class="docutils literal"><span class="pre">unset_userdata()</span></code> usage</p>
  516. <p>Previously, this method used to accept an associative array of
  517. <code class="docutils literal"><span class="pre">'key'</span> <span class="pre">=&gt;</span> <span class="pre">'dummy</span> <span class="pre">value'</span></code> pairs for unsetting multiple keys. That
  518. however makes no sense and you now have to pass <em>only</em> the keys, as
  519. the elements of an array.</p>
  520. <div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// Old</span>
  521. <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">session</span><span class="o">-&gt;</span><span class="na">unset_userdata</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s1">&#39;item&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="s1">&#39;item2&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;&#39;</span><span class="p">));</span>
  522. <span class="c1">// New</span>
  523. <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">session</span><span class="o">-&gt;</span><span class="na">unset_userdata</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s1">&#39;item&#39;</span><span class="p">,</span> <span class="s1">&#39;item2&#39;</span><span class="p">));</span>
  524. </pre></div>
  525. </div>
  526. </li>
  527. </ul>
  528. </div></blockquote>
  529. <p>Finally, if you have written a Session extension, you must now move it to
  530. the <em>application/libraries/Session/</em> directory, although chances are that
  531. it will now also have to be re-factored.</p>
  532. </div>
  533. <div class="section" id="step-7-update-your-config-database-php">
  534. <h2>Step 7: Update your config/database.php<a class="headerlink" href="#step-7-update-your-config-database-php" title="Permalink to this headline"></a></h2>
  535. <p>Due to 3.0.0s renaming of Active Record to Query Builder, inside your
  536. <strong>config/database.php</strong>, you will need to rename the <code class="docutils literal"><span class="pre">$active_record</span></code>
  537. variable to <code class="docutils literal"><span class="pre">$query_builder</span></code>:</p>
  538. <div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$active_group</span> <span class="o">=</span> <span class="s1">&#39;default&#39;</span><span class="p">;</span>
  539. <span class="c1">// $active_record = TRUE;</span>
  540. <span class="nv">$query_builder</span> <span class="o">=</span> <span class="k">TRUE</span><span class="p">;</span>
  541. </pre></div>
  542. </div>
  543. </div>
  544. <div class="section" id="step-8-replace-your-error-templates">
  545. <h2>Step 8: Replace your error templates<a class="headerlink" href="#step-8-replace-your-error-templates" title="Permalink to this headline"></a></h2>
  546. <p>In CodeIgniter 3.0, the error templates are now considered as views and have been moved to the
  547. <em>application/views/errors</em> directory.</p>
  548. <p>Furthermore, weve added support for CLI error templates in plain-text format that unlike HTML,
  549. is suitable for the command line. This of course requires another level of separation.</p>
  550. <p>It is safe to move your old templates from <em>application/errors</em> to <em>application/views/errors/html</em>,
  551. but youll have to copy the new <em>application/views/errors/cli</em> directory from the CodeIgniter archive.</p>
  552. </div>
  553. <div class="section" id="step-9-update-your-config-routes-php-file">
  554. <h2>Step 9: Update your config/routes.php file<a class="headerlink" href="#step-9-update-your-config-routes-php-file" title="Permalink to this headline"></a></h2>
  555. <div class="section" id="routes-containing-any">
  556. <h3>Routes containing :any<a class="headerlink" href="#routes-containing-any" title="Permalink to this headline"></a></h3>
  557. <p>Historically, CodeIgniter has always provided the <strong>:any</strong> wildcard in
  558. routing, with the intention of providing a way to match any character
  559. <strong>within</strong> an URI segment.</p>
  560. <p>However, the <strong>:any</strong> wildcard is actually just an alias for a regular
  561. expression and used to be executed in that manner as <strong>.+</strong>. This is
  562. considered a bug, as it also matches the / (forward slash) character, which
  563. is the URI segment delimiter and that was never the intention.</p>
  564. <p>In CodeIgniter 3, the <strong>:any</strong> wildcard will now represent <strong>[^/]+</strong>, so
  565. that it will not match a forward slash.</p>
  566. <p>There are certainly many developers that have utilized this bug as an actual
  567. feature. If youre one of them and want to match a forward slash, please use
  568. the <strong>.+</strong> regular expression:</p>
  569. <div class="highlight-ci"><div class="highlight"><pre><span></span><span class="p">(</span><span class="o">.+</span><span class="p">)</span> <span class="c1">// matches ANYTHING</span>
  570. <span class="p">(</span><span class="o">:</span><span class="nx">any</span><span class="p">)</span> <span class="c1">// matches any character, except for &#39;/&#39;</span>
  571. </pre></div>
  572. </div>
  573. </div>
  574. <div class="section" id="directories-and-default-controller-404-override">
  575. <h3>Directories and default_controller, 404_override<a class="headerlink" href="#directories-and-default-controller-404-override" title="Permalink to this headline"></a></h3>
  576. <p>As you should know, the <code class="docutils literal"><span class="pre">$route['default_controller']</span></code> and
  577. <code class="docutils literal"><span class="pre">$route['404_override']</span></code> settings accept not only a controller name, but
  578. also <em>controller/method</em> pairs. However, a bug in the routing logic has
  579. made it possible for some users to use that as <em>directory/controller</em>
  580. instead.</p>
  581. <p>As already said, this behavior was incidental and was never intended, nor
  582. documented. If youve relied on it, your application will break with
  583. CodeIgniter 3.0.</p>
  584. <p>Another notable change in version 3 is that default_controller and
  585. 404_override are now applied <em>per directory</em>. To explain what this means,
  586. lets take the following example:</p>
  587. <div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$route</span><span class="p">[</span><span class="s1">&#39;default_controller&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;main&#39;</span><span class="p">;</span>
  588. </pre></div>
  589. </div>
  590. <p>Now, assuming that your website is located at <em>example.com</em>, you already
  591. know that if a user visits <code class="docutils literal"><span class="pre">http://example.com/</span></code>, the above setting will
  592. cause your Main controller to be loaded.</p>
  593. <p>However, what happens if you have an <em>application/controllers/admin/</em>
  594. directory and the user visits <code class="docutils literal"><span class="pre">http://example.com/admin/</span></code>?
  595. In CodeIgniter 3, the router will look for a Main controller under the
  596. admin/ directory as well. If not found, a Not Found (404) will be triggered.</p>
  597. <p>The same rule applies to the 404_override setting.</p>
  598. </div>
  599. </div>
  600. <div class="section" id="step-10-many-functions-now-return-null-instead-of-false-on-missing-items">
  601. <h2>Step 10: Many functions now return NULL instead of FALSE on missing items<a class="headerlink" href="#step-10-many-functions-now-return-null-instead-of-false-on-missing-items" title="Permalink to this headline"></a></h2>
  602. <p>Many methods and functions now return NULL instead of FALSE when the required items dont exist:</p>
  603. <blockquote>
  604. <div><ul class="simple">
  605. <li><a class="reference internal" href="../general/common_functions.html"><span class="doc">Common functions</span></a><ul>
  606. <li>config_item()</li>
  607. </ul>
  608. </li>
  609. <li><a class="reference internal" href="../libraries/config.html"><span class="doc">Config Class</span></a><ul>
  610. <li>config-&gt;item()</li>
  611. <li>config-&gt;slash_item()</li>
  612. </ul>
  613. </li>
  614. <li><a class="reference internal" href="../libraries/input.html"><span class="doc">Input Class</span></a><ul>
  615. <li>input-&gt;get()</li>
  616. <li>input-&gt;post()</li>
  617. <li>input-&gt;get_post()</li>
  618. <li>input-&gt;cookie()</li>
  619. <li>input-&gt;server()</li>
  620. <li>input-&gt;input_stream()</li>
  621. <li>input-&gt;get_request_header()</li>
  622. </ul>
  623. </li>
  624. <li><a class="reference internal" href="../libraries/sessions.html"><span class="doc">Session Class</span></a><ul>
  625. <li>session-&gt;userdata()</li>
  626. <li>session-&gt;flashdata()</li>
  627. </ul>
  628. </li>
  629. <li><a class="reference internal" href="../libraries/uri.html"><span class="doc">URI Class</span></a><ul>
  630. <li>uri-&gt;segment()</li>
  631. <li>uri-&gt;rsegment()</li>
  632. </ul>
  633. </li>
  634. <li><a class="reference internal" href="../helpers/array_helper.html"><span class="doc">Array Helper</span></a><ul>
  635. <li>element()</li>
  636. <li>elements()</li>
  637. </ul>
  638. </li>
  639. </ul>
  640. </div></blockquote>
  641. </div>
  642. <div class="section" id="step-11-usage-of-xss-filtering">
  643. <h2>Step 11: Usage of XSS filtering<a class="headerlink" href="#step-11-usage-of-xss-filtering" title="Permalink to this headline"></a></h2>
  644. <p>Many functions in CodeIgniter allow you to use its XSS filtering feature
  645. on demand by passing a boolean parameter. The default value of that
  646. parameter used to be boolean FALSE, but it is now changed to NULL and it
  647. will be dynamically determined by your <code class="docutils literal"><span class="pre">$config['global_xss_filtering']</span></code>
  648. value.</p>
  649. <p>If you used to manually pass a boolean value for the <code class="docutils literal"><span class="pre">$xss_filter</span></code>
  650. parameter or if youve always had <code class="docutils literal"><span class="pre">$config['global_xss_filtering']</span></code> set
  651. to FALSE, then this change doesnt concern you.</p>
  652. <p>Otherwise however, please review your usage of the following functions:</p>
  653. <blockquote>
  654. <div><ul class="simple">
  655. <li><a class="reference internal" href="../libraries/input.html"><span class="doc">Input Library</span></a><ul>
  656. <li>input-&gt;get()</li>
  657. <li>input-&gt;post()</li>
  658. <li>input-&gt;get_post()</li>
  659. <li>input-&gt;cookie()</li>
  660. <li>input-&gt;server()</li>
  661. <li>input-&gt;input_stream()</li>
  662. </ul>
  663. </li>
  664. <li><a class="reference internal" href="../helpers/cookie_helper.html"><span class="doc">Cookie Helper</span></a> <a class="reference internal" href="../helpers/cookie_helper.html#get_cookie" title="get_cookie"><code class="xref php php-func docutils literal"><span class="pre">get_cookie()</span></code></a></li>
  665. </ul>
  666. </div></blockquote>
  667. <div class="admonition important">
  668. <p class="first admonition-title">Important</p>
  669. <p class="last">Another related change is that the <code class="docutils literal"><span class="pre">$_GET</span></code>, <code class="docutils literal"><span class="pre">$_POST</span></code>,
  670. <code class="docutils literal"><span class="pre">$_COOKIE</span></code> and <code class="docutils literal"><span class="pre">$_SERVER</span></code> superglobals are no longer
  671. automatically overwritten when global XSS filtering is turned on.</p>
  672. </div>
  673. </div>
  674. <div class="section" id="step-12-check-for-potential-xss-issues-with-uris">
  675. <h2>Step 12: Check for potential XSS issues with URIs<a class="headerlink" href="#step-12-check-for-potential-xss-issues-with-uris" title="Permalink to this headline"></a></h2>
  676. <p>The <a class="reference internal" href="../libraries/uri.html"><span class="doc">URI Library</span></a> used to automatically convert
  677. a certain set of programmatic characters to HTML entities when they
  678. are encountered in a URI segment.</p>
  679. <p>This was aimed at providing some automatic XSS protection, in addition
  680. to the <code class="docutils literal"><span class="pre">$config['permitted_uri_chars']</span></code> setting, but has proven to be
  681. problematic and is now removed in CodeIgniter 3.0.</p>
  682. <p>If your application has relied on this feature, you should update it to
  683. filter URI segments through <code class="docutils literal"><span class="pre">$this-&gt;security-&gt;xss_clean()</span></code> whenever you
  684. output them.</p>
  685. </div>
  686. <div class="section" id="step-13-check-for-usage-of-the-xss-clean-form-validation-rule">
  687. <h2>Step 13: Check for usage of the xss_clean Form validation rule<a class="headerlink" href="#step-13-check-for-usage-of-the-xss-clean-form-validation-rule" title="Permalink to this headline"></a></h2>
  688. <p>A largely unknown rule about XSS cleaning is that it should <em>only be
  689. applied to output</em>, as opposed to input data.</p>
  690. <p>Weve made that mistake ourselves with our automatic and global XSS cleaning
  691. feature (see previous step about XSS above), so now in an effort to discourage that
  692. practice, were also removing xss_clean from the officially supported
  693. list of <a class="reference internal" href="../libraries/form_validation.html"><span class="doc">form validation</span></a> rules.</p>
  694. <p>Because the <a class="reference internal" href="../libraries/form_validation.html"><span class="doc">Form Validation library</span></a>
  695. generally validates <em>input</em> data, the xss_clean rule simply doesnt
  696. belong in it.</p>
  697. <p>If you really, really need to apply that rule, you should now also load the
  698. <a class="reference internal" href="../helpers/security_helper.html"><span class="doc">Security Helper</span></a>, which contains
  699. <code class="docutils literal"><span class="pre">xss_clean()</span></code> as a regular function and therefore can be also used as
  700. a validation rule.</p>
  701. </div>
  702. <div class="section" id="step-14-update-usage-of-input-class-s-get-post-method">
  703. <h2>Step 14: Update usage of Input Classs get_post() method<a class="headerlink" href="#step-14-update-usage-of-input-class-s-get-post-method" title="Permalink to this headline"></a></h2>
  704. <p>Previously, the <a class="reference internal" href="../libraries/input.html"><span class="doc">Input Class</span></a> method <code class="docutils literal"><span class="pre">get_post()</span></code>
  705. was searching first in POST data, then in GET data. This method has been
  706. modified so that it searches in GET then in POST, as its name suggests.</p>
  707. <p>A method has been added, <code class="docutils literal"><span class="pre">post_get()</span></code>, which searches in POST then in GET, as
  708. <code class="docutils literal"><span class="pre">get_post()</span></code> was doing before.</p>
  709. </div>
  710. <div class="section" id="step-15-update-usage-of-directory-helper-s-directory-map-function">
  711. <h2>Step 15: Update usage of Directory Helpers directory_map() function<a class="headerlink" href="#step-15-update-usage-of-directory-helper-s-directory-map-function" title="Permalink to this headline"></a></h2>
  712. <p>In the resulting array, directories now end with a trailing directory
  713. separator (i.e. a slash, usually).</p>
  714. </div>
  715. <div class="section" id="step-16-update-usage-of-database-forge-s-drop-table-method">
  716. <h2>Step 16: Update usage of Database Forges drop_table() method<a class="headerlink" href="#step-16-update-usage-of-database-forge-s-drop-table-method" title="Permalink to this headline"></a></h2>
  717. <p>Up until now, <code class="docutils literal"><span class="pre">drop_table()</span></code> added an IF EXISTS clause by default or it didnt work
  718. at all with some drivers. In CodeIgniter 3.0, the IF EXISTS condition is no longer added
  719. by default and has an optional second parameter that allows that instead and is set to
  720. FALSE by default.</p>
  721. <p>If your application relies on IF EXISTS, youll have to change its usage.</p>
  722. <div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// Now produces just DROP TABLE `table_name`</span>
  723. <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">dbforge</span><span class="o">-&gt;</span><span class="na">drop_table</span><span class="p">(</span><span class="s1">&#39;table_name&#39;</span><span class="p">);</span>
  724. <span class="c1">// Produces DROP TABLE IF EXISTS `table_name`</span>
  725. <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">dbforge</span><span class="o">-&gt;</span><span class="na">drop_table</span><span class="p">(</span><span class="s1">&#39;table_name&#39;</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">);</span>
  726. </pre></div>
  727. </div>
  728. <div class="admonition note">
  729. <p class="first admonition-title">Note</p>
  730. <p class="last">The given example uses MySQL-specific syntax, but it should work across
  731. all drivers with the exception of ODBC.</p>
  732. </div>
  733. </div>
  734. <div class="section" id="step-17-change-usage-of-email-library-with-multiple-emails">
  735. <h2>Step 17: Change usage of Email library with multiple emails<a class="headerlink" href="#step-17-change-usage-of-email-library-with-multiple-emails" title="Permalink to this headline"></a></h2>
  736. <p>The <a class="reference internal" href="../libraries/email.html"><span class="doc">Email Library</span></a> will automatically clear the
  737. set parameters after successfully sending emails. To override this behaviour,
  738. pass FALSE as the first parameter in the <code class="docutils literal"><span class="pre">send()</span></code> method:</p>
  739. <div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">(</span><span class="k">FALSE</span><span class="p">))</span>
  740. <span class="p">{</span>
  741. <span class="c1">// Parameters won&#39;t be cleared</span>
  742. <span class="p">}</span>
  743. </pre></div>
  744. </div>
  745. </div>
  746. <div class="section" id="step-18-update-your-form-validation-language-lines">
  747. <h2>Step 18: Update your Form_validation language lines<a class="headerlink" href="#step-18-update-your-form-validation-language-lines" title="Permalink to this headline"></a></h2>
  748. <p>Two improvements have been made to the <a class="reference internal" href="../libraries/form_validation.html"><span class="doc">Form Validation Library</span></a>s <a class="reference internal" href="../libraries/language.html"><span class="doc">language</span></a>
  749. files and error messages format:</p>
  750. <blockquote>
  751. <div><ul>
  752. <li><p class="first"><a class="reference internal" href="../libraries/language.html"><span class="doc">Language Library</span></a> line keys now must be
  753. prefixed with <strong>form_validation_</strong> in order to avoid collisions:</p>
  754. <div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// Old</span>
  755. <span class="nv">$lang</span><span class="p">[</span><span class="s1">&#39;rule&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="o">...</span>
  756. <span class="c1">// New</span>
  757. <span class="nv">$lang</span><span class="p">[</span><span class="s1">&#39;form_validation_rule&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="o">...</span>
  758. </pre></div>
  759. </div>
  760. </li>
  761. <li><p class="first">The error messages format has been changed to use named parameters, to
  762. allow more flexibility than what <cite>sprintf()</cite> offers:</p>
  763. <div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// Old</span>
  764. <span class="s1">&#39;The %s field does not match the %s field.&#39;</span>
  765. <span class="c1">// New</span>
  766. <span class="s1">&#39;The {field} field does not match the {param} field.&#39;</span>
  767. </pre></div>
  768. </div>
  769. </li>
  770. </ul>
  771. </div></blockquote>
  772. <div class="admonition note">
  773. <p class="first admonition-title">Note</p>
  774. <p class="last">The old formatting still works, but the non-prefixed line keys
  775. are DEPRECATED and scheduled for removal in CodeIgniter 3.1+.
  776. Therefore youre encouraged to update its usage sooner rather than
  777. later.</p>
  778. </div>
  779. </div>
  780. <div class="section" id="step-19-make-sure-your-base-url-config-value-is-not-empty">
  781. <h2>Step 19: Make sure your base_url config value is not empty<a class="headerlink" href="#step-19-make-sure-your-base-url-config-value-is-not-empty" title="Permalink to this headline"></a></h2>
  782. <p>When <code class="docutils literal"><span class="pre">$config['base_url']</span></code> is not set, CodeIgniter tries to automatically
  783. detect what your websites base URL is. This is done purely for convenience
  784. when you are starting development of a new application.</p>
  785. <p>Auto-detection is never reliable and also has security implications, which
  786. is why you should <strong>always</strong> have it manually configured!</p>
  787. <p>One of the changes in CodeIgniter 3.0.3 is how this auto-detection works,
  788. and more specifically it now falls back to the servers IP address instead
  789. of the hostname requested by the client. Therefore, if youve ever relied
  790. on auto-detection, it will change how your website works now.</p>
  791. <p>In case you need to allow e.g. multiple domains, or both <a class="reference external" href="http://">http://</a> and
  792. <a class="reference external" href="https://">https://</a> prefixes to be dynamically used depending on the request,
  793. remember that <em>application/config/config.php</em> is still a PHP script, in
  794. which you can create this logic with a few lines of code. For example:</p>
  795. <div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$allowed_domains</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span><span class="s1">&#39;domain1.tld&#39;</span><span class="p">,</span> <span class="s1">&#39;domain2.tld&#39;</span><span class="p">);</span>
  796. <span class="nv">$default_domain</span> <span class="o">=</span> <span class="s1">&#39;domain1.tld&#39;</span><span class="p">;</span>
  797. <span class="k">if</span> <span class="p">(</span><span class="nb">in_array</span><span class="p">(</span><span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">&#39;HTTP_HOST&#39;</span><span class="p">],</span> <span class="nv">$allowed_domains</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">))</span>
  798. <span class="p">{</span>
  799. <span class="nv">$domain</span> <span class="o">=</span> <span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">&#39;HTTP_HOST&#39;</span><span class="p">];</span>
  800. <span class="p">}</span>
  801. <span class="k">else</span>
  802. <span class="p">{</span>
  803. <span class="nv">$domain</span> <span class="o">=</span> <span class="nv">$default_domain</span><span class="p">;</span>
  804. <span class="p">}</span>
  805. <span class="k">if</span> <span class="p">(</span> <span class="o">!</span> <span class="k">empty</span><span class="p">(</span><span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">&#39;HTTPS&#39;</span><span class="p">]))</span>
  806. <span class="p">{</span>
  807. <span class="nv">$config</span><span class="p">[</span><span class="s1">&#39;base_url&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;https://&#39;</span><span class="o">.</span><span class="nv">$domain</span><span class="p">;</span>
  808. <span class="p">}</span>
  809. <span class="k">else</span>
  810. <span class="p">{</span>
  811. <span class="nv">$config</span><span class="p">[</span><span class="s1">&#39;base_url&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;http://&#39;</span><span class="o">.</span><span class="nv">$domain</span><span class="p">;</span>
  812. <span class="p">}</span>
  813. </pre></div>
  814. </div>
  815. </div>
  816. <div class="section" id="step-20-remove-usage-of-previously-deprecated-functionalities">
  817. <h2>Step 20: Remove usage of (previously) deprecated functionalities<a class="headerlink" href="#step-20-remove-usage-of-previously-deprecated-functionalities" title="Permalink to this headline"></a></h2>
  818. <p>In addition to the <code class="docutils literal"><span class="pre">$autoload['core']</span></code> configuration setting, theres a
  819. number of other functionalities that have been removed in CodeIgniter 3.0.0:</p>
  820. <div class="section" id="the-sha1-library">
  821. <h3>The SHA1 library<a class="headerlink" href="#the-sha1-library" title="Permalink to this headline"></a></h3>
  822. <p>The previously deprecated SHA1 library has been removed, alter your code to use PHPs native
  823. <code class="docutils literal"><span class="pre">sha1()</span></code> function to generate a SHA1 hash.</p>
  824. <p>Additionally, the <code class="docutils literal"><span class="pre">sha1()</span></code> method in the <a class="reference internal" href="../libraries/encrypt.html"><span class="doc">Encrypt Library</span></a> has been removed.</p>
  825. </div>
  826. <div class="section" id="the-ext-constant">
  827. <h3>The EXT constant<a class="headerlink" href="#the-ext-constant" title="Permalink to this headline"></a></h3>
  828. <p>Usage of the <code class="docutils literal"><span class="pre">EXT</span></code> constant has been deprecated since dropping support for PHP 4. Theres no
  829. longer a need to maintain different filename extensions and in this new CodeIgniter version,
  830. the <code class="docutils literal"><span class="pre">EXT</span></code> constant has been removed. Use just .php instead.</p>
  831. </div>
  832. <div class="section" id="smiley-helper">
  833. <h3>Smiley helper<a class="headerlink" href="#smiley-helper" title="Permalink to this headline"></a></h3>
  834. <p>The <a class="reference internal" href="../helpers/smiley_helper.html"><span class="doc">Smiley Helper</span></a> is a legacy feature from EllisLabs
  835. ExpressionEngine product. However, it is too specific for a general purpose framework like
  836. CodeIgniter and as such it is now deprecated.</p>
  837. <p>Also, the previously deprecated <code class="docutils literal"><span class="pre">js_insert_smiley()</span></code> (since version 1.7.2) is now removed.</p>
  838. </div>
  839. <div class="section" id="the-encrypt-library">
  840. <h3>The Encrypt library<a class="headerlink" href="#the-encrypt-library" title="Permalink to this headline"></a></h3>
  841. <p>Following numerous vulnerability reports, the <a class="reference internal" href="../libraries/encrypt.html"><span class="doc">Encrypt Library</span></a> has
  842. been deprecated and a new, <a class="reference internal" href="../libraries/encryption.html"><span class="doc">Encryption Library</span></a> is added to take
  843. its place.</p>
  844. <p>The new library requires either the <a class="reference external" href="http://php.net/mcrypt">MCrypt extension</a> (and /dev/urandom
  845. availability) or PHP 5.3.3 and the <a class="reference external" href="http://php.net/openssl">OpenSSL extension</a>.
  846. While this might be rather inconvenient, it is a requirement that allows us to have properly
  847. implemented cryptographic functions.</p>
  848. <div class="admonition note">
  849. <p class="first admonition-title">Note</p>
  850. <p class="last">The <a class="reference internal" href="../libraries/encrypt.html"><span class="doc">Encrypt Library</span></a> is still available for the purpose
  851. of keeping backwards compatibility.</p>
  852. </div>
  853. <div class="admonition important">
  854. <p class="first admonition-title">Important</p>
  855. <p class="last">You are strongly encouraged to switch to the new <a class="reference internal" href="../libraries/encryption.html"><span class="doc">Encryption Library</span></a> as soon as possible!</p>
  856. </div>
  857. </div>
  858. <div class="section" id="the-cart-library">
  859. <h3>The Cart library<a class="headerlink" href="#the-cart-library" title="Permalink to this headline"></a></h3>
  860. <p>The <a class="reference internal" href="../libraries/cart.html"><span class="doc">Cart Library</span></a>, similarly to the <a class="reference internal" href="../helpers/smiley_helper.html"><span class="doc">Smiley Helper</span></a> is too specific for CodeIgniter. It is now deprecated
  861. and scheduled for removal in CodeIgniter 3.1+.</p>
  862. <div class="admonition note">
  863. <p class="first admonition-title">Note</p>
  864. <p class="last">The library is still available, but youre strongly encouraged to remove its usage sooner
  865. rather than later.</p>
  866. </div>
  867. </div>
  868. <div class="section" id="database-drivers-mysql-sqlite-mssql-pdo-dblib">
  869. <h3>Database drivers mysql, sqlite, mssql, pdo/dblib<a class="headerlink" href="#database-drivers-mysql-sqlite-mssql-pdo-dblib" title="Permalink to this headline"></a></h3>
  870. <p>The <strong>mysql</strong> driver utilizes the old mysql PHP extension, known for its aging code base and
  871. many low-level problems. The extension is deprecated as of PHP 5.5 and CodeIgniter deprecates
  872. it in version 3.0, switching the default configured MySQL driver to <strong>mysqli</strong>.</p>
  873. <p>Please use either the mysqli or pdo/mysql drivers for MySQL. The old mysql driver will be
  874. removed at some point in the future.</p>
  875. <p>The <strong>sqlite</strong>, <strong>mssql</strong> and <strong>pdo/dblib</strong> (also known as pdo/mssql or pdo/sybase) drivers
  876. all depend on PHP extensions that for different reasons no longer exist since PHP 5.3.</p>
  877. <p>Therefore we are now deprecating these drivers as we will have to remove them in one of the next
  878. CodeIgniter versions. You should use the more advanced, <strong>sqlite3</strong>, <strong>sqlsrv</strong> or <strong>pdo/sqlsrv</strong>
  879. drivers respectively.</p>
  880. <div class="admonition note">
  881. <p class="first admonition-title">Note</p>
  882. <p class="last">These drivers are still available, but youre strongly encouraged to switch to other ones
  883. sooner rather than later.</p>
  884. </div>
  885. </div>
  886. <div class="section" id="security-helper-do-hash">
  887. <h3>Security helper do_hash()<a class="headerlink" href="#security-helper-do-hash" title="Permalink to this headline"></a></h3>
  888. <p><a class="reference internal" href="../helpers/security_helper.html"><span class="doc">Security Helper</span></a> function <code class="docutils literal"><span class="pre">do_hash()</span></code> is now just an alias for
  889. PHPs native <code class="docutils literal"><span class="pre">hash()</span></code> function. It is deprecated and scheduled for removal in CodeIgniter 3.1+.</p>
  890. <div class="admonition note">
  891. <p class="first admonition-title">Note</p>
  892. <p class="last">This function is still available, but youre strongly encouraged to remove its usage sooner
  893. rather than later.</p>
  894. </div>
  895. </div>
  896. <div class="section" id="the-config-global-xss-filtering-setting">
  897. <h3>The $config[global_xss_filtering] setting<a class="headerlink" href="#the-config-global-xss-filtering-setting" title="Permalink to this headline"></a></h3>
  898. <p>As already explained above, XSS filtering should not be done on input data,
  899. but on output instead. Therefore, the <code class="docutils literal"><span class="pre">$config['global_xss_filtering']</span></code>,
  900. which automatically filters <em>input</em> data, is considered a bad practice and
  901. is now deprecated.</p>
  902. <p>Instead, you should manually escape any user-provided data via the
  903. <a class="reference internal" href="../helpers/security_helper.html#xss_clean" title="xss_clean"><code class="xref php php-func docutils literal"><span class="pre">xss_clean()</span></code></a> function when you need to output it, or use a
  904. library like <a class="reference external" href="http://htmlpurifier.org/">HTML Purifier</a> that does that
  905. for you.</p>
  906. <div class="admonition note">
  907. <p class="first admonition-title">Note</p>
  908. <p class="last">The setting is still available, but youre strongly encouraged to
  909. remove its usage sooner rather than later.</p>
  910. </div>
  911. </div>
  912. <div class="section" id="file-helper-read-file">
  913. <h3>File helper read_file()<a class="headerlink" href="#file-helper-read-file" title="Permalink to this headline"></a></h3>
  914. <p><a class="reference internal" href="../helpers/file_helper.html"><span class="doc">File Helper</span></a> function <code class="docutils literal"><span class="pre">read_file()</span></code> is now just an alias for
  915. PHPs native <code class="docutils literal"><span class="pre">file_get_contents()</span></code> function. It is deprecated and scheduled for removal in
  916. CodeIgniter 3.1+.</p>
  917. <div class="admonition note">
  918. <p class="first admonition-title">Note</p>
  919. <p class="last">This function is still available, but youre strongly encouraged to remove its usage sooner
  920. rather than later.</p>
  921. </div>
  922. </div>
  923. <div class="section" id="string-helper-repeater">
  924. <h3>String helper repeater()<a class="headerlink" href="#string-helper-repeater" title="Permalink to this headline"></a></h3>
  925. <p><a class="reference internal" href="../helpers/string_helper.html"><span class="doc">String Helper</span></a> function <a class="reference internal" href="../helpers/string_helper.html#repeater" title="repeater"><code class="xref php php-func docutils literal"><span class="pre">repeater()</span></code></a> is now just an alias for
  926. PHPs native <code class="docutils literal"><span class="pre">str_repeat()</span></code> function. It is deprecated and scheduled for removal in CodeIgniter 3.1+.</p>
  927. <div class="admonition note">
  928. <p class="first admonition-title">Note</p>
  929. <p class="last">This function is still available, but youre strongly encouraged to remove its usage sooner
  930. rather than later.</p>
  931. </div>
  932. </div>
  933. <div class="section" id="string-helper-trim-slashes">
  934. <h3>String helper trim_slashes()<a class="headerlink" href="#string-helper-trim-slashes" title="Permalink to this headline"></a></h3>
  935. <p><a class="reference internal" href="../helpers/string_helper.html"><span class="doc">String Helper</span></a> function <a class="reference internal" href="../helpers/string_helper.html#trim_slashes" title="trim_slashes"><code class="xref php php-func docutils literal"><span class="pre">trim_slashes()</span></code></a> is now just an alias
  936. for PHPs native <code class="docutils literal"><span class="pre">trim()</span></code> function (with a slash passed as its second argument). It is deprecated and
  937. scheduled for removal in CodeIgniter 3.1+.</p>
  938. <div class="admonition note">
  939. <p class="first admonition-title">Note</p>
  940. <p class="last">This function is still available, but youre strongly encouraged to remove its usage sooner
  941. rather than later.</p>
  942. </div>
  943. </div>
  944. <div class="section" id="form-helper-form-prep">
  945. <h3>Form helper form_prep()<a class="headerlink" href="#form-helper-form-prep" title="Permalink to this headline"></a></h3>
  946. <p><a class="reference internal" href="../helpers/form_helper.html"><span class="doc">Form Helper</span></a> function <a class="reference internal" href="../helpers/form_helper.html#form_prep" title="form_prep"><code class="xref php php-func docutils literal"><span class="pre">form_prep()</span></code></a>
  947. is now just an alias for <a class="reference internal" href="../general/common_functions.html"><span class="doc">common function</span></a>
  948. <code class="xref py py-func docutils literal"><span class="pre">html_escape()</span></code>. It is deprecated and will be removed in the future.</p>
  949. <p>Please use <a class="reference internal" href="../general/common_functions.html#html_escape" title="html_escape"><code class="xref php php-func docutils literal"><span class="pre">html_escape()</span></code></a> instead.</p>
  950. <div class="admonition note">
  951. <p class="first admonition-title">Note</p>
  952. <p class="last">This function is still available, but youre strongly encouraged
  953. to remove its usage sooner rather than later.</p>
  954. </div>
  955. </div>
  956. <div class="section" id="email-helper-functions">
  957. <h3>Email helper functions<a class="headerlink" href="#email-helper-functions" title="Permalink to this headline"></a></h3>
  958. <p><a class="reference internal" href="../helpers/email_helper.html"><span class="doc">Email Helper</span></a> only has two functions</p>
  959. <blockquote>
  960. <div><ul class="simple">
  961. <li><a class="reference internal" href="../helpers/email_helper.html#valid_email" title="valid_email"><code class="xref php php-func docutils literal"><span class="pre">valid_email()</span></code></a></li>
  962. <li><a class="reference internal" href="../helpers/email_helper.html#send_email" title="send_email"><code class="xref php php-func docutils literal"><span class="pre">send_email()</span></code></a></li>
  963. </ul>
  964. </div></blockquote>
  965. <p>Both of them are now aliases for PHPs native <code class="docutils literal"><span class="pre">filter_var()</span></code> and <code class="docutils literal"><span class="pre">mail()</span></code> functions, respectively.
  966. Therefore the <a class="reference internal" href="../helpers/email_helper.html"><span class="doc">Email Helper</span></a> altogether is being deprecated and
  967. is scheduled for removal in CodeIgniter 3.1+.</p>
  968. <div class="admonition note">
  969. <p class="first admonition-title">Note</p>
  970. <p class="last">These functions are still available, but youre strongly encouraged to remove their usage
  971. sooner rather than later.</p>
  972. </div>
  973. </div>
  974. <div class="section" id="date-helper-standard-date">
  975. <h3>Date helper standard_date()<a class="headerlink" href="#date-helper-standard-date" title="Permalink to this headline"></a></h3>
  976. <p><a class="reference internal" href="../helpers/date_helper.html"><span class="doc">Date Helper</span></a> function <code class="docutils literal"><span class="pre">standard_date()</span></code> is being deprecated due
  977. to the availability of native PHP <a class="reference external" href="http://php.net/manual/en/class.datetime.php#datetime.constants.types">constants</a>,
  978. which when combined with <code class="docutils literal"><span class="pre">date()</span></code> provide the same functionality. Furthermore, they have the
  979. exact same names as the ones supported by <code class="docutils literal"><span class="pre">standard_date()</span></code>. Here are examples of how to replace
  980. its usage:</p>
  981. <div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// Old way</span>
  982. <span class="nx">standard_date</span><span class="p">();</span> <span class="c1">// defaults to standard_date(&#39;DATE_RFC822&#39;, now());</span>
  983. <span class="c1">// Replacement</span>
  984. <span class="nb">date</span><span class="p">(</span><span class="nx">DATE_RFC822</span><span class="p">,</span> <span class="nx">now</span><span class="p">());</span>
  985. <span class="c1">// Old way</span>
  986. <span class="nx">standard_date</span><span class="p">(</span><span class="s1">&#39;DATE_ATOM&#39;</span><span class="p">,</span> <span class="nv">$time</span><span class="p">);</span>
  987. <span class="c1">// Replacement</span>
  988. <span class="nb">date</span><span class="p">(</span><span class="nx">DATE_ATOM</span><span class="p">,</span> <span class="nv">$time</span><span class="p">);</span>
  989. </pre></div>
  990. </div>
  991. <div class="admonition note">
  992. <p class="first admonition-title">Note</p>
  993. <p class="last">This function is still available, but youre strongly encouraged to remove its usage sooner
  994. rather than later as it is scheduled for removal in CodeIgniter 3.1+.</p>
  995. </div>
  996. </div>
  997. <div class="section" id="html-helpers-nbs-br">
  998. <h3>HTML helpers nbs(), br()<a class="headerlink" href="#html-helpers-nbs-br" title="Permalink to this headline"></a></h3>
  999. <p><a class="reference internal" href="../helpers/html_helper.html"><span class="doc">HTML Helper</span></a> functions <code class="docutils literal"><span class="pre">nbs()</span></code> and <code class="docutils literal"><span class="pre">br()</span></code> are just aliases
  1000. for the native <code class="docutils literal"><span class="pre">str_repeat()</span></code> function used with <code class="docutils literal"><span class="pre">&amp;nbsp;</span></code> and <code class="docutils literal"><span class="pre">&lt;br</span> <span class="pre">&gt;</span></code> respectively.</p>
  1001. <p>Because theres no point in just aliasing native PHP functions, they are now deprecated and
  1002. scheduled for removal in CodeIgniter 3.1+.</p>
  1003. <div class="admonition note">
  1004. <p class="first admonition-title">Note</p>
  1005. <p class="last">These functions are still available, but youre strongly encouraged to remove their usage
  1006. sooner rather than later.</p>
  1007. </div>
  1008. </div>
  1009. <div class="section" id="pagination-library-anchor-class-setting">
  1010. <h3>Pagination library anchor_class setting<a class="headerlink" href="#pagination-library-anchor-class-setting" title="Permalink to this headline"></a></h3>
  1011. <p>The <a class="reference internal" href="../libraries/pagination.html"><span class="doc">Pagination Library</span></a> now supports adding pretty much any HTML
  1012. attribute to your anchors via the attributes configuration setting. This includes passing the
  1013. class attribute and using the separate anchor_class setting no longer makes sense.
  1014. As a result of that, the anchor_class setting is now deprecated and scheduled for removal in
  1015. CodeIgniter 3.1+.</p>
  1016. <div class="admonition note">
  1017. <p class="first admonition-title">Note</p>
  1018. <p class="last">This setting is still available, but youre strongly encouraged to remove its usage sooner
  1019. rather than later.</p>
  1020. </div>
  1021. </div>
  1022. <div class="section" id="string-helper-random-string-types-unique-and-encrypt">
  1023. <h3>String helper random_string() types unique and encrypt<a class="headerlink" href="#string-helper-random-string-types-unique-and-encrypt" title="Permalink to this headline"></a></h3>
  1024. <p>When using the <a class="reference internal" href="../helpers/string_helper.html"><span class="doc">String Helper</span></a> function <a class="reference internal" href="../helpers/string_helper.html#random_string" title="random_string"><code class="xref php php-func docutils literal"><span class="pre">random_string()</span></code></a>,
  1025. you should no longer pass the <strong>unique</strong> and <strong>encrypt</strong> randomization types. They are only
  1026. aliases for <strong>md5</strong> and <strong>sha1</strong> respectively and are now deprecated and scheduled for removal
  1027. in CodeIgniter 3.1+.</p>
  1028. <div class="admonition note">
  1029. <p class="first admonition-title">Note</p>
  1030. <p class="last">These options are still available, but youre strongly encouraged to remove their usage
  1031. sooner rather than later.</p>
  1032. </div>
  1033. </div>
  1034. <div class="section" id="url-helper-url-title-separators-dash-and-underscore">
  1035. <h3>URL helper url_title() separators dash and underscore<a class="headerlink" href="#url-helper-url-title-separators-dash-and-underscore" title="Permalink to this headline"></a></h3>
  1036. <p>When using the <a class="reference internal" href="../helpers/url_helper.html"><span class="doc">URL Helper</span></a> function <a class="reference internal" href="../helpers/url_helper.html#url_title" title="url_title"><code class="xref php php-func docutils literal"><span class="pre">url_title()</span></code></a>, you
  1037. should no longer pass <strong>dash</strong> or <strong>underscore</strong> as the word separator. This function will
  1038. now accept any character and you should just pass the chosen character directly, so you
  1039. should write - instead of dash and _ instead of underscore.</p>
  1040. <p><strong>dash</strong> and <strong>underscore</strong> now act as aliases and are deprecated and scheduled for removal
  1041. in CodeIgniter 3.1+.</p>
  1042. <div class="admonition note">
  1043. <p class="first admonition-title">Note</p>
  1044. <p class="last">These options are still available, but youre strongly encouraged to remove their usage
  1045. sooner rather than later.</p>
  1046. </div>
  1047. </div>
  1048. <div class="section" id="session-library-method-all-userdata">
  1049. <h3>Session Library method all_userdata()<a class="headerlink" href="#session-library-method-all-userdata" title="Permalink to this headline"></a></h3>
  1050. <p>As seen in the <a class="reference internal" href="../changelog.html"><span class="doc">Change Log</span></a>, <a class="reference internal" href="../libraries/sessions.html"><span class="doc">Session Library</span></a>
  1051. method <code class="docutils literal"><span class="pre">userdata()</span></code> now allows you to fetch all userdata by simply omitting its parameter:</p>
  1052. <div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">session</span><span class="o">-&gt;</span><span class="na">userdata</span><span class="p">();</span>
  1053. </pre></div>
  1054. </div>
  1055. <p>This makes the <code class="docutils literal"><span class="pre">all_userdata()</span></code> method redudant and therefore it is now just an alias for
  1056. <code class="docutils literal"><span class="pre">userdata()</span></code> with the above shown usage and is being deprecated and scheduled for removal
  1057. in CodeIgniter 3.1+.</p>
  1058. <div class="admonition note">
  1059. <p class="first admonition-title">Note</p>
  1060. <p class="last">This method is still available, but youre strongly encouraged to remove its usage
  1061. sooner rather than later.</p>
  1062. </div>
  1063. </div>
  1064. <div class="section" id="database-forge-method-add-column-with-an-after-clause">
  1065. <h3>Database Forge method add_column() with an AFTER clause<a class="headerlink" href="#database-forge-method-add-column-with-an-after-clause" title="Permalink to this headline"></a></h3>
  1066. <p>If you have used the <strong>third parameter</strong> for <a class="reference internal" href="../database/forge.html"><span class="doc">Database Forge</span></a> method
  1067. <code class="docutils literal"><span class="pre">add_column()</span></code> to add a field for an AFTER clause, then you should change its usage.</p>
  1068. <p>That third parameter has been deprecated and scheduled for removal in CodeIgniter 3.1+.</p>
  1069. <p>You should now put AFTER clause field names in the field definition array instead:</p>
  1070. <div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// Old usage:</span>
  1071. <span class="nv">$field</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
  1072. <span class="s1">&#39;new_field&#39;</span> <span class="o">=&gt;</span> <span class="k">array</span><span class="p">(</span><span class="s1">&#39;type&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;TEXT&#39;</span><span class="p">)</span>
  1073. <span class="p">);</span>
  1074. <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">dbforge</span><span class="o">-&gt;</span><span class="na">add_column</span><span class="p">(</span><span class="s1">&#39;table_name&#39;</span><span class="p">,</span> <span class="nv">$field</span><span class="p">,</span> <span class="s1">&#39;another_field&#39;</span><span class="p">);</span>
  1075. <span class="c1">// New usage:</span>
  1076. <span class="nv">$field</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
  1077. <span class="s1">&#39;new_field&#39;</span> <span class="o">=&gt;</span> <span class="k">array</span><span class="p">(</span><span class="s1">&#39;type&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;TEXT&#39;</span><span class="p">,</span> <span class="s1">&#39;after&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;another_field&#39;</span><span class="p">)</span>
  1078. <span class="p">);</span>
  1079. <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">dbforge</span><span class="o">-&gt;</span><span class="na">add_column</span><span class="p">(</span><span class="s1">&#39;table_name&#39;</span><span class="p">,</span> <span class="nv">$field</span><span class="p">);</span>
  1080. </pre></div>
  1081. </div>
  1082. <div class="admonition note">
  1083. <p class="first admonition-title">Note</p>
  1084. <p class="last">The parameter is still available, but youre strongly encouraged to remove its usage
  1085. sooner rather than later.</p>
  1086. </div>
  1087. <div class="admonition note">
  1088. <p class="first admonition-title">Note</p>
  1089. <p class="last">This is for MySQL and CUBRID databases only! Other drivers dont support this
  1090. clause and will silently ignore it.</p>
  1091. </div>
  1092. </div>
  1093. <div class="section" id="uri-routing-methods-fetch-directory-fetch-class-fetch-method">
  1094. <h3>URI Routing methods fetch_directory(), fetch_class(), fetch_method()<a class="headerlink" href="#uri-routing-methods-fetch-directory-fetch-class-fetch-method" title="Permalink to this headline"></a></h3>
  1095. <p>With properties <code class="docutils literal"><span class="pre">CI_Router::$directory</span></code>, <code class="docutils literal"><span class="pre">CI_Router::$class</span></code> and <code class="docutils literal"><span class="pre">CI_Router::$method</span></code>
  1096. being public and their respective <code class="docutils literal"><span class="pre">fetch_*()</span></code> no longer doing anything else to just return
  1097. the properties - it doesnt make sense to keep them.</p>
  1098. <p>Those are all internal, undocumented methods, but weve opted to deprecate them for now
  1099. in order to maintain backwards-compatibility just in case. If some of you have utilized them,
  1100. then you can now just access the properties instead:</p>
  1101. <div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">router</span><span class="o">-&gt;</span><span class="na">directory</span><span class="p">;</span>
  1102. <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">router</span><span class="o">-&gt;</span><span class="na">class</span><span class="p">;</span>
  1103. <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">router</span><span class="o">-&gt;</span><span class="na">method</span><span class="p">;</span>
  1104. </pre></div>
  1105. </div>
  1106. <div class="admonition note">
  1107. <p class="first admonition-title">Note</p>
  1108. <p class="last">Those methods are still available, but youre strongly encouraged to remove their usage
  1109. sooner rather than later.</p>
  1110. </div>
  1111. </div>
  1112. <div class="section" id="input-library-method-is-cli-request">
  1113. <h3>Input library method is_cli_request()<a class="headerlink" href="#input-library-method-is-cli-request" title="Permalink to this headline"></a></h3>
  1114. <p>Calls to the <code class="docutils literal"><span class="pre">CI_Input::is_cli_request()</span></code> method are necessary at many places
  1115. in the CodeIgniter internals and this is often before the <a class="reference internal" href="../libraries/input.html"><span class="doc">Input Library</span></a> is loaded. Because of that, it is being replaced by a common
  1116. function named <a class="reference internal" href="../general/common_functions.html#is_cli" title="is_cli"><code class="xref php php-func docutils literal"><span class="pre">is_cli()</span></code></a> and this method is now just an alias.</p>
  1117. <p>The new function is both available at all times for you to use and shorter to type.</p>
  1118. <div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// Old</span>
  1119. <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">input</span><span class="o">-&gt;</span><span class="na">is_cli_request</span><span class="p">();</span>
  1120. <span class="c1">// New</span>
  1121. <span class="nx">is_cli</span><span class="p">();</span>
  1122. </pre></div>
  1123. </div>
  1124. <p><code class="docutils literal"><span class="pre">CI_Input::is_cli_request()</span></code> is now now deprecated and scheduled for removal in
  1125. CodeIgniter 3.1+.</p>
  1126. <div class="admonition note">
  1127. <p class="first admonition-title">Note</p>
  1128. <p class="last">This method is still available, but youre strongly encouraged to remove its usage
  1129. sooner rather than later.</p>
  1130. </div>
  1131. </div>
  1132. <div class="section" id="config-library-method-system-url">
  1133. <h3>Config library method system_url()<a class="headerlink" href="#config-library-method-system-url" title="Permalink to this headline"></a></h3>
  1134. <p>Usage of <code class="docutils literal"><span class="pre">CI_Config::system_url()</span></code> encourages insecure coding practices.
  1135. Namely, your CodeIgniter <em>system/</em> directory shouldnt be publicly accessible
  1136. from a security point of view.</p>
  1137. <p>Because of this, this method is now deprecated and scheduled for removal in
  1138. CodeIgniter 3.1+.</p>
  1139. <div class="admonition note">
  1140. <p class="first admonition-title">Note</p>
  1141. <p class="last">This method is still available, but youre strongly encouraged to remove its usage
  1142. sooner rather than later.</p>
  1143. </div>
  1144. </div>
  1145. <div class="section" id="the-javascript-library">
  1146. <h3>The Javascript library<a class="headerlink" href="#the-javascript-library" title="Permalink to this headline"></a></h3>
  1147. <p>The <a class="reference internal" href="../libraries/javascript.html"><span class="doc">Javascript Library</span></a> has always had an
  1148. experimental status and was never really useful, nor a proper solution.</p>
  1149. <p>It is now deprecated and scheduled for removal in CodeIgniter 3.1+.</p>
  1150. <div class="admonition note">
  1151. <p class="first admonition-title">Note</p>
  1152. <p class="last">This library is still available, but youre strongly encouraged to remove its usage
  1153. sooner rather than later.</p>
  1154. </div>
  1155. </div>
  1156. <div class="section" id="form-validation-method-prep-for-form">
  1157. <h3>Form Validation method prep_for_form()<a class="headerlink" href="#form-validation-method-prep-for-form" title="Permalink to this headline"></a></h3>
  1158. <p>The <a class="reference internal" href="../libraries/form_validation.html"><span class="doc">Form Validation Library</span></a> has a
  1159. <code class="docutils literal"><span class="pre">prep_for_form()</span></code> method, which is/can also be used as a rule in
  1160. <code class="docutils literal"><span class="pre">set_rules()</span></code> to automatically perform HTML encoding on input data.</p>
  1161. <p>Automatically encoding input (instead of output) data is a bad practice in
  1162. the first place, and CodeIgniter and PHP itself offer other alternatives
  1163. to this method anyway.
  1164. For example, <a class="reference internal" href="../helpers/form_helper.html"><span class="doc">Form Helper</span></a> functions will
  1165. automatically perform HTML escaping when necessary.</p>
  1166. <p>Therefore, the <em>prep_for_form</em> method/rule is pretty much useless and is now
  1167. deprecated and scheduled for removal in 3.1+.</p>
  1168. <div class="admonition note">
  1169. <p class="first admonition-title">Note</p>
  1170. <p class="last">The method is still available, but youre strongly encouraged to
  1171. remove its usage sooner rather than later.</p>
  1172. </div>
  1173. </div>
  1174. </div>
  1175. <div class="section" id="step-21-check-your-usage-of-text-helper-highlight-phrase">
  1176. <h2>Step 21: Check your usage of Text helper highlight_phrase()<a class="headerlink" href="#step-21-check-your-usage-of-text-helper-highlight-phrase" title="Permalink to this headline"></a></h2>
  1177. <p>The default HTML tag used by <a class="reference internal" href="../helpers/text_helper.html"><span class="doc">Text Helper</span></a> function
  1178. <code class="xref py py-func docutils literal"><span class="pre">highlight_phrase()</span></code> has been changed from <code class="docutils literal"><span class="pre">&lt;strong&gt;</span></code> to the new HTML5
  1179. tag <code class="docutils literal"><span class="pre">&lt;mark&gt;</span></code>.</p>
  1180. <p>Unless youve used your own highlighting tags, this might cause trouble
  1181. for your visitors who use older web browsers such as Internet Explorer 8.
  1182. We therefore suggest that you add the following code to your CSS files
  1183. in order to avoid backwards compatibility with old browsers:</p>
  1184. <div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">mark</span> <span class="p">{</span>
  1185. <span class="nx">background</span><span class="o">:</span> <span class="c1">#ff0;</span>
  1186. <span class="nx">color</span><span class="o">:</span> <span class="c1">#000;</span>
  1187. <span class="p">};</span>
  1188. </pre></div>
  1189. </div>
  1190. </div>
  1191. </div>
  1192. </div>
  1193. <footer>
  1194. <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
  1195. <a href="upgrade_223.html" class="btn btn-neutral float-right" title="Upgrading from 2.2.2 to 2.2.3">Next <span class="fa fa-arrow-circle-right"></span></a>
  1196. <a href="upgrade_301.html" class="btn btn-neutral" title="Upgrading from 3.0.0 to 3.0.1"><span class="fa fa-arrow-circle-left"></span> Previous</a>
  1197. </div>
  1198. <hr/>
  1199. <div role="contentinfo">
  1200. <p>
  1201. &copy; Copyright 2014 - 2017, British Columbia Institute of Technology.
  1202. Last updated on Sep 25, 2017.
  1203. </p>
  1204. </div>
  1205. Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
  1206. </footer>
  1207. </div>
  1208. </div>
  1209. </section>
  1210. </div>
  1211. <script type="text/javascript">
  1212. var DOCUMENTATION_OPTIONS = {
  1213. URL_ROOT:'../',
  1214. VERSION:'3.1.6',
  1215. COLLAPSE_INDEX:false,
  1216. FILE_SUFFIX:'.html',
  1217. HAS_SOURCE: false
  1218. };
  1219. </script>
  1220. <script type="text/javascript" src="../_static/jquery.js"></script>
  1221. <script type="text/javascript" src="../_static/underscore.js"></script>
  1222. <script type="text/javascript" src="../_static/doctools.js"></script>
  1223. <script type="text/javascript" src="../_static/js/theme.js"></script>
  1224. <script type="text/javascript">
  1225. jQuery(function () {
  1226. SphinxRtdTheme.StickyNav.enable();
  1227. });
  1228. </script>
  1229. </body>
  1230. </html>