Skip to content
Browse files

Merge branch 'develop' of https://github.com/bcit-ci/CodeIgniter into…

… develop
  • Loading branch information...
2 parents a483ef3 + b76fa12 commit 8ec62ed3b06aa6779daf526a4cba67cf0e67b624 Dionysis Arvanitis committed May 22, 2016
Showing with 2,416 additions and 1,522 deletions.
  1. +1 −8 .travis.yml
  2. +6 −0 application/config/autoload.php
  3. +8 −4 application/config/config.php
  4. +1 −1 application/config/constants.php
  5. +1 −1 application/config/hooks.php
  6. +1 −1 application/config/memcached.php
  7. +1 −1 application/config/mimes.php
  8. +1 −1 application/config/profiler.php
  9. +1 −1 application/config/routes.php
  10. +1 −1 application/config/smileys.php
  11. +1 −1 application/controllers/Welcome.php
  12. +4 −1 composer.json
  13. +2 −2 contributing.md
  14. +78 −55 index.php
  15. +1 −1 license.txt
  16. +4 −4 readme.rst
  17. +5 −5 system/core/Benchmark.php
  18. +7 −7 system/core/CodeIgniter.php
  19. +5 −5 system/core/Common.php
  20. +6 −6 system/core/Config.php
  21. +5 −5 system/core/Controller.php
  22. +5 −5 system/core/Exceptions.php
  23. +5 −5 system/core/Hooks.php
  24. +6 −6 system/core/Input.php
  25. +5 −5 system/core/Lang.php
  26. +56 −14 system/core/Loader.php
  27. +27 −10 system/core/Log.php
  28. +5 −5 system/core/Model.php
  29. +9 −9 system/core/Output.php
  30. +5 −5 system/core/Router.php
  31. +13 −6 system/core/Security.php
  32. +75 −57 system/core/URI.php
  33. +7 −7 system/core/Utf8.php
  34. +5 −5 system/core/compat/hash.php
  35. +5 −5 system/core/compat/mbstring.php
  36. +5 −5 system/core/compat/password.php
  37. +6 −6 system/core/compat/standard.php
  38. +5 −5 system/database/DB.php
  39. +5 −5 system/database/DB_cache.php
  40. +16 −20 system/database/DB_driver.php
  41. +5 −5 system/database/DB_forge.php
  42. +96 −62 system/database/DB_query_builder.php
  43. +5 −5 system/database/DB_result.php
  44. +5 −5 system/database/DB_utility.php
  45. +5 −5 system/database/drivers/cubrid/cubrid_driver.php
  46. +5 −5 system/database/drivers/cubrid/cubrid_forge.php
  47. +5 −5 system/database/drivers/cubrid/cubrid_result.php
  48. +5 −5 system/database/drivers/cubrid/cubrid_utility.php
  49. +6 −6 system/database/drivers/ibase/ibase_driver.php
  50. +5 −5 system/database/drivers/ibase/ibase_forge.php
  51. +5 −5 system/database/drivers/ibase/ibase_result.php
  52. +5 −5 system/database/drivers/ibase/ibase_utility.php
  53. +5 −5 system/database/drivers/mssql/mssql_driver.php
  54. +5 −5 system/database/drivers/mssql/mssql_forge.php
  55. +5 −5 system/database/drivers/mssql/mssql_result.php
  56. +5 −5 system/database/drivers/mssql/mssql_utility.php
  57. +25 −8 system/database/drivers/mysql/mysql_driver.php
  58. +5 −5 system/database/drivers/mysql/mysql_forge.php
  59. +5 −5 system/database/drivers/mysql/mysql_result.php
  60. +5 −5 system/database/drivers/mysql/mysql_utility.php
  61. +64 −23 system/database/drivers/mysqli/mysqli_driver.php
  62. +5 −5 system/database/drivers/mysqli/mysqli_forge.php
  63. +5 −5 system/database/drivers/mysqli/mysqli_result.php
  64. +5 −5 system/database/drivers/mysqli/mysqli_utility.php
  65. +13 −5 system/database/drivers/oci8/oci8_driver.php
  66. +5 −5 system/database/drivers/oci8/oci8_forge.php
  67. +5 −5 system/database/drivers/oci8/oci8_result.php
  68. +5 −5 system/database/drivers/oci8/oci8_utility.php
  69. +23 −5 system/database/drivers/odbc/odbc_driver.php
  70. +5 −5 system/database/drivers/odbc/odbc_forge.php
  71. +5 −5 system/database/drivers/odbc/odbc_result.php
  72. +5 −5 system/database/drivers/odbc/odbc_utility.php
  73. +5 −5 system/database/drivers/pdo/pdo_driver.php
  74. +5 −5 system/database/drivers/pdo/pdo_forge.php
  75. +5 −5 system/database/drivers/pdo/pdo_result.php
  76. +5 −5 system/database/drivers/pdo/pdo_utility.php
  77. +5 −5 system/database/drivers/pdo/subdrivers/pdo_4d_driver.php
  78. +5 −5 system/database/drivers/pdo/subdrivers/pdo_4d_forge.php
  79. +5 −5 system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php
  80. +5 −5 system/database/drivers/pdo/subdrivers/pdo_cubrid_forge.php
  81. +5 −5 system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
  82. +5 −5 system/database/drivers/pdo/subdrivers/pdo_dblib_forge.php
  83. +5 −5 system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
  84. +5 −5 system/database/drivers/pdo/subdrivers/pdo_firebird_forge.php
  85. +5 −5 system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php
  86. +5 −5 system/database/drivers/pdo/subdrivers/pdo_ibm_forge.php
  87. +5 −5 system/database/drivers/pdo/subdrivers/pdo_informix_driver.php
  88. +5 −5 system/database/drivers/pdo/subdrivers/pdo_informix_forge.php
  89. +29 −10 system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php
  90. +5 −5 system/database/drivers/pdo/subdrivers/pdo_mysql_forge.php
  91. +13 −5 system/database/drivers/pdo/subdrivers/pdo_oci_driver.php
  92. +5 −5 system/database/drivers/pdo/subdrivers/pdo_oci_forge.php
  93. +23 −5 system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php
  94. +5 −5 system/database/drivers/pdo/subdrivers/pdo_odbc_forge.php
  95. +11 −6 system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
  96. +5 −5 system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php
  97. +5 −5 system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php
  98. +5 −5 system/database/drivers/pdo/subdrivers/pdo_sqlite_forge.php
  99. +5 −5 system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
  100. +5 −5 system/database/drivers/pdo/subdrivers/pdo_sqlsrv_forge.php
  101. +11 −6 system/database/drivers/postgre/postgre_driver.php
  102. +5 −5 system/database/drivers/postgre/postgre_forge.php
  103. +5 −5 system/database/drivers/postgre/postgre_result.php
  104. +5 −5 system/database/drivers/postgre/postgre_utility.php
  105. +5 −5 system/database/drivers/sqlite/sqlite_driver.php
  106. +5 −5 system/database/drivers/sqlite/sqlite_forge.php
  107. +5 −5 system/database/drivers/sqlite/sqlite_result.php
  108. +5 −5 system/database/drivers/sqlite/sqlite_utility.php
  109. +5 −5 system/database/drivers/sqlite3/sqlite3_driver.php
  110. +5 −5 system/database/drivers/sqlite3/sqlite3_forge.php
  111. +5 −5 system/database/drivers/sqlite3/sqlite3_result.php
  112. +5 −5 system/database/drivers/sqlite3/sqlite3_utility.php
  113. +5 −5 system/database/drivers/sqlsrv/sqlsrv_driver.php
  114. +5 −5 system/database/drivers/sqlsrv/sqlsrv_forge.php
  115. +5 −5 system/database/drivers/sqlsrv/sqlsrv_result.php
  116. +5 −5 system/database/drivers/sqlsrv/sqlsrv_utility.php
  117. +5 −5 system/helpers/array_helper.php
  118. +28 −27 system/helpers/captcha_helper.php
  119. +5 −5 system/helpers/cookie_helper.php
  120. +5 −5 system/helpers/date_helper.php
  121. +5 −5 system/helpers/directory_helper.php
  122. +5 −5 system/helpers/download_helper.php
  123. +5 −5 system/helpers/email_helper.php
  124. +5 −5 system/helpers/file_helper.php
  125. +8 −8 system/helpers/form_helper.php
  126. +26 −11 system/helpers/html_helper.php
  127. +6 −6 system/helpers/inflector_helper.php
  128. +5 −5 system/helpers/language_helper.php
  129. +5 −5 system/helpers/number_helper.php
  130. +5 −5 system/helpers/path_helper.php
  131. +5 −5 system/helpers/security_helper.php
  132. +5 −5 system/helpers/smiley_helper.php
  133. +5 −5 system/helpers/string_helper.php
  134. +23 −8 system/helpers/text_helper.php
  135. +5 −5 system/helpers/typography_helper.php
  136. +5 −5 system/helpers/url_helper.php
  137. +5 −5 system/helpers/xml_helper.php
  138. +4 −4 system/language/english/calendar_lang.php
  139. +4 −4 system/language/english/date_lang.php
  140. +4 −4 system/language/english/db_lang.php
  141. +4 −4 system/language/english/email_lang.php
  142. +4 −4 system/language/english/form_validation_lang.php
  143. +4 −4 system/language/english/ftp_lang.php
  144. +4 −4 system/language/english/imglib_lang.php
  145. +4 −4 system/language/english/migration_lang.php
  146. +4 −4 system/language/english/number_lang.php
  147. +4 −4 system/language/english/pagination_lang.php
  148. +4 −4 system/language/english/profiler_lang.php
  149. +4 −4 system/language/english/unit_test_lang.php
  150. +4 −4 system/language/english/upload_lang.php
  151. +4 −4 system/libraries/Cache/Cache.php
  152. +24 −13 system/libraries/Cache/drivers/Cache_apc.php
  153. +4 −4 system/libraries/Cache/drivers/Cache_dummy.php
  154. +4 −4 system/libraries/Cache/drivers/Cache_file.php
  155. +50 −24 system/libraries/Cache/drivers/Cache_memcached.php
  156. +65 −63 system/libraries/Cache/drivers/Cache_redis.php
  157. +23 −12 system/libraries/Cache/drivers/Cache_wincache.php
  158. +5 −5 system/libraries/Calendar.php
  159. +5 −5 system/libraries/Cart.php
  160. +4 −4 system/libraries/Driver.php
  161. +17 −14 system/libraries/Email.php
  162. +6 −6 system/libraries/Encrypt.php
  163. +5 −5 system/libraries/Encryption.php
  164. +63 −61 system/libraries/Form_validation.php
  165. +5 −5 system/libraries/Ftp.php
  166. +5 −5 system/libraries/Image_lib.php
  167. +5 −5 system/libraries/Javascript.php
  168. +5 −5 system/libraries/Javascript/Jquery.php
  169. +70 −36 system/libraries/Migration.php
  170. +10 −6 system/libraries/Pagination.php
  171. +5 −5 system/libraries/Parser.php
  172. +23 −31 system/libraries/Profiler.php
  173. +25 −7 system/libraries/Session/Session.php
  174. +5 −5 system/libraries/Session/SessionHandlerInterface.php
  175. +25 −5 system/libraries/Session/Session_driver.php
  176. +28 −17 system/libraries/Session/drivers/Session_database_driver.php
  177. +8 −8 system/libraries/Session/drivers/Session_files_driver.php
  178. +43 −29 system/libraries/Session/drivers/Session_memcached_driver.php
  179. +37 −21 system/libraries/Session/drivers/Session_redis_driver.php
  180. +5 −5 system/libraries/Table.php
  181. +5 −5 system/libraries/Trackback.php
  182. +5 −5 system/libraries/Typography.php
  183. +5 −5 system/libraries/Unit_test.php
  184. +12 −6 system/libraries/Upload.php
  185. +5 −5 system/libraries/User_agent.php
  186. +9 −9 system/libraries/Xmlrpc.php
  187. +5 −5 system/libraries/Xmlrpcs.php
  188. +5 −5 system/libraries/Zip.php
  189. +73 −0 tests/codeigniter/core/Log_test.php
  190. +4 −2 tests/codeigniter/core/Security_test.php
  191. +43 −0 tests/codeigniter/database/query_builder/join_test.php
  192. +19 −7 tests/codeigniter/helpers/html_helper_test.php
  193. +18 −1 tests/codeigniter/libraries/Form_validation_test.php
  194. +0 −1 tests/mocks/database/drivers/mysql.php
  195. +0 −1 tests/mocks/database/drivers/mysqli.php
  196. +0 −1 tests/mocks/database/drivers/pdo.php
  197. +0 −1 tests/mocks/database/drivers/postgre.php
  198. +0 −1 tests/mocks/database/drivers/sqlite.php
  199. +4 −4 user_guide_src/cilexer/cilexer/cilexer.py
  200. BIN user_guide_src/source/_themes/sphinx_rtd_theme/static/images/ci-icon.ico
  201. +111 −6 user_guide_src/source/changelog.rst
  202. +2 −2 user_guide_src/source/conf.py
  203. +3 −3 user_guide_src/source/contributing/index.rst
  204. +7 −0 user_guide_src/source/database/db_driver_reference.rst
  205. +6 −4 user_guide_src/source/database/forge.rst
  206. +7 −1 user_guide_src/source/database/queries.rst
  207. +14 −4 user_guide_src/source/database/query_builder.rst
  208. +2 −2 user_guide_src/source/helpers/form_helper.rst
  209. +14 −8 user_guide_src/source/helpers/html_helper.rst
  210. +1 −1 user_guide_src/source/helpers/inflector_helper.rst
  211. +2 −2 user_guide_src/source/helpers/typography_helper.rst
  212. +5 −5 user_guide_src/source/helpers/url_helper.rst
  213. +4 −2 user_guide_src/source/installation/downloads.rst
  214. +9 −9 user_guide_src/source/installation/index.rst
  215. +2 −2 user_guide_src/source/installation/troubleshooting.rst
  216. +2 −2 user_guide_src/source/installation/upgrade_150.rst
  217. +4 −4 user_guide_src/source/installation/upgrade_300.rst
  218. +14 −0 user_guide_src/source/installation/upgrade_305.rst
  219. +48 −0 user_guide_src/source/installation/upgrade_306.rst
  220. +14 −0 user_guide_src/source/installation/upgrade_307.rst
  221. +53 −0 user_guide_src/source/installation/upgrade_310.rst
  222. +3 −0 user_guide_src/source/installation/upgrading.rst
  223. +0 −2 user_guide_src/source/libraries/caching.rst
  224. +4 −4 user_guide_src/source/libraries/calendar.rst
  225. +1 −1 user_guide_src/source/libraries/email.rst
  226. +4 −4 user_guide_src/source/libraries/form_validation.rst
  227. +2 −1 user_guide_src/source/libraries/image_lib.rst
  228. +2 −2 user_guide_src/source/libraries/output.rst
  229. +1 −1 user_guide_src/source/libraries/zip.rst
  230. +1 −1 user_guide_src/source/license.rst
  231. +2 −2 user_guide_src/source/overview/at_a_glance.rst
  232. +8 −8 user_guide_src/source/tutorial/create_news_items.rst
  233. +2 −2 user_guide_src/source/tutorial/static_pages.rst
View
9 .travis.yml
@@ -1,8 +1,6 @@
language: php
php:
- - 5.2
- - 5.3.3
- 5.4
- 5.5
- 5.6
@@ -21,7 +19,7 @@ env:
sudo: false
before_script:
- - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then pear channel-discover pear.bovigo.org && pear install bovigo/vfsStream-beta; else composer install --dev --no-progress; fi"
+ - sh -c "composer install --dev --no-progress"
- sh -c "if [ '$DB' = 'pgsql' ] || [ '$DB' = 'pdo/pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS ci_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'pgsql' ] || [ '$DB' = 'pdo/pgsql' ]; then psql -c 'create database ci_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ] || [ '$DB' = 'mysqli' ] || [ '$DB' = 'pdo/mysql' ]; then mysql -e 'create database IF NOT EXISTS ci_test;'; fi"
@@ -30,7 +28,6 @@ script: phpunit -d zend.enable_gc=0 -d date.timezone=UTC --coverage-text --confi
matrix:
allow_failures:
- - php: 5.2
- php: hhvm
exclude:
- php: hhvm
@@ -39,10 +36,6 @@ matrix:
env: DB=pdo/pgsql
- php: 7
env: DB=mysql
- - php: 5.2
- env: DB=sqlite
- - php: 5.2
- env: DB=pdo/sqlite
branches:
only:
View
6 application/config/autoload.php
@@ -72,6 +72,12 @@
| Prototype:
|
| $autoload['drivers'] = array('cache');
+|
+| You can also supply an alternative property name to be assigned in
+| the controller:
+|
+| $autoload['drivers'] = array('cache' => 'cch');
+|
*/
$autoload['drivers'] = array();
View
12 application/config/config.php
@@ -62,7 +62,9 @@
| This option allows you to add a suffix to all URLs generated by CodeIgniter.
| For more information please see the user guide:
|
-| http://codeigniter.com/user_guide/general/urls.html
+| https://codeigniter.com/user_guide/general/urls.html
+|
+| Note: This option is ignored for CLI requests.
*/
$config['url_suffix'] = '';
@@ -110,8 +112,8 @@
| This item allows you to set the filename/classname prefix when extending
| native libraries. For more information please see the user guide:
|
-| http://codeigniter.com/user_guide/general/core_classes.html
-| http://codeigniter.com/user_guide/general/creating_libraries.html
+| https://codeigniter.com/user_guide/general/core_classes.html
+| https://codeigniter.com/user_guide/general/creating_libraries.html
|
*/
$config['subclass_prefix'] = 'MY_';
@@ -157,6 +159,8 @@
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
+| Note: This option is ignored for CLI requests.
+|
*/
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
@@ -311,7 +315,7 @@
| If you use the Encryption class, you must set an encryption key.
| See the user guide for more info.
|
-| http://codeigniter.com/user_guide/libraries/encryption.html
+| https://codeigniter.com/user_guide/libraries/encryption.html
|
*/
$config['encryption_key'] = '';
View
2 application/config/constants.php
@@ -42,7 +42,7 @@
defined('FOPEN_READ') OR define('FOPEN_READ', 'rb');
defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b');
defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
-defined('FOPEN_READ_WRITE_CREATE_DESCTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
+defined('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab');
defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b');
defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb');
View
2 application/config/hooks.php
@@ -8,6 +8,6 @@
| This file lets you define "hooks" to extend CI without hacking the core
| files. Please see the user guide for info:
|
-| http://codeigniter.com/user_guide/general/hooks.html
+| https://codeigniter.com/user_guide/general/hooks.html
|
*/
View
2 application/config/memcached.php
@@ -7,7 +7,7 @@
| -------------------------------------------------------------------------
| Your Memcached servers can be specified below.
|
-| See: http://codeigniter.com/user_guide/libraries/caching.html#memcached
+| See: https://codeigniter.com/user_guide/libraries/caching.html#memcached
|
*/
$config = array(
View
2 application/config/mimes.php
@@ -149,7 +149,7 @@
'au' => 'audio/x-au',
'ac3' => 'audio/ac3',
'flac' => 'audio/x-flac',
- 'ogg' => 'audio/ogg',
+ 'ogg' => array('audio/ogg', 'video/ogg', 'application/ogg'),
'kmz' => array('application/vnd.google-earth.kmz', 'application/zip', 'application/x-zip'),
'kml' => array('application/vnd.google-earth.kml+xml', 'application/xml', 'text/xml'),
'ics' => 'text/calendar',
View
2 application/config/profiler.php
@@ -9,6 +9,6 @@
| data are displayed when the Profiler is enabled.
| Please see the user guide for info:
|
-| http://codeigniter.com/user_guide/general/profiling.html
+| https://codeigniter.com/user_guide/general/profiling.html
|
*/
View
2 application/config/routes.php
@@ -19,7 +19,7 @@
|
| Please see the user guide for complete details:
|
-| http://codeigniter.com/user_guide/general/routing.html
+| https://codeigniter.com/user_guide/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
View
2 application/config/smileys.php
@@ -10,7 +10,7 @@
| :-) and :) use the same image replacement.
|
| Please see user guide for more info:
-| http://codeigniter.com/user_guide/helpers/smiley_helper.html
+| https://codeigniter.com/user_guide/helpers/smiley_helper.html
|
*/
$smileys = array(
View
2 application/controllers/Welcome.php
@@ -16,7 +16,7 @@ class Welcome extends CI_Controller {
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
- * @see http://codeigniter.com/user_guide/general/urls.html
+ * @see https://codeigniter.com/user_guide/general/urls.html
*/
public function index()
{
View
5 composer.json
@@ -2,7 +2,7 @@
"description": "The CodeIgniter framework",
"name": "codeigniter/framework",
"type": "project",
- "homepage": "http://codeigniter.com",
+ "homepage": "https://codeigniter.com",
"license": "MIT",
"support": {
"forum": "http://forum.codeigniter.com/",
@@ -13,6 +13,9 @@
"require": {
"php": ">=5.2.4"
},
+ "suggest": {
+ "paragonie/random_compat": "Provides better randomness in PHP 5.x"
+ },
"require-dev": {
"mikey179/vfsStream": "1.1.*"
}
View
4 contributing.md
@@ -20,8 +20,8 @@ for us to maintain quality of the code-base.
### PHP Style
-All code must meet the [Style Guide](http://codeigniter.com/user_guide/general/styleguide.html), which is
-essentially the [Allman indent style](http://en.wikipedia.org/wiki/Indent_style#Allman_style), underscores and readable operators. This makes certain that all code is the same format as the existing code and means it will be as readable as possible.
+All code must meet the [Style Guide](https://codeigniter.com/user_guide/general/styleguide.html), which is
+essentially the [Allman indent style](https://en.wikipedia.org/wiki/Indent_style#Allman_style), underscores and readable operators. This makes certain that all code is the same format as the existing code and means it will be as readable as possible.
### Documentation
View
133 index.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,10 +28,10 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
- * @link http://codeigniter.com
+ * @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
@@ -91,40 +91,41 @@
/*
*---------------------------------------------------------------
- * SYSTEM FOLDER NAME
+ * SYSTEM DIRECTORY NAME
*---------------------------------------------------------------
*
- * This variable must contain the name of your "system" folder.
- * Include the path if the folder is not in the same directory
- * as this file.
+ * This variable must contain the name of your "system" directory.
+ * Set the path if it is not in the same directory as this file.
*/
$system_path = 'system';
/*
*---------------------------------------------------------------
- * APPLICATION FOLDER NAME
+ * APPLICATION DIRECTORY NAME
*---------------------------------------------------------------
*
* If you want this front controller to use a different "application"
- * folder than the default one you can set its name here. The folder
- * can also be renamed or relocated anywhere on your server. If
- * you do, use a full server path. For more info please see the user guide:
- * http://codeigniter.com/user_guide/general/managing_apps.html
+ * directory than the default one you can set its name here. The directory
+ * can also be renamed or relocated anywhere on your server. If you do,
+ * use an absolute (full) server path.
+ * For more info please see the user guide:
+ *
+ * https://codeigniter.com/user_guide/general/managing_apps.html
*
* NO TRAILING SLASH!
*/
$application_folder = 'application';
/*
*---------------------------------------------------------------
- * VIEW FOLDER NAME
+ * VIEW DIRECTORY NAME
*---------------------------------------------------------------
*
- * If you want to move the view folder out of the application
- * folder set the path to the folder here. The folder can be renamed
+ * If you want to move the view directory out of the application
+ * directory, set the path to it here. The directory can be renamed
* and relocated anywhere on your server. If blank, it will default
- * to the standard location inside your application folder. If you
- * do move this, use the full server path to this folder.
+ * to the standard location inside your application directory.
+ * If you do move this, use an absolute (full) server path.
*
* NO TRAILING SLASH!
*/
@@ -150,8 +151,8 @@
*
* Un-comment the $routing array below to use this feature
*/
- // The directory name, relative to the "controllers" folder. Leave blank
- // if your controller is not in a sub-folder within the "controllers" folder
+ // The directory name, relative to the "controllers" directory. Leave blank
+ // if your controller is not in a sub-directory within the "controllers" one
// $routing['directory'] = '';
// The controller class file name. Example: mycontroller
@@ -197,12 +198,16 @@
if (($_temp = realpath($system_path)) !== FALSE)
{
- $system_path = $_temp.'/';
+ $system_path = $_temp.DIRECTORY_SEPARATOR;
}
else
{
// Ensure there's a trailing slash
- $system_path = rtrim($system_path, '/').'/';
+ $system_path = strtr(
+ rtrim($system_path, '/\\'),
+ '/\\',
+ DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
+ ).DIRECTORY_SEPARATOR;
}
// Is the system path correct?
@@ -221,66 +226,84 @@
// The name of THIS file
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
- // Path to the system folder
- define('BASEPATH', str_replace('\\', '/', $system_path));
+ // Path to the system directory
+ define('BASEPATH', $system_path);
- // Path to the front controller (this file)
- define('FCPATH', dirname(__FILE__).'/');
+ // Path to the front controller (this file) directory
+ define('FCPATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
- // Name of the "system folder"
- define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
+ // Name of the "system" directory
+ define('SYSDIR', basename(BASEPATH));
- // The path to the "application" folder
+ // The path to the "application" directory
if (is_dir($application_folder))
{
if (($_temp = realpath($application_folder)) !== FALSE)
{
$application_folder = $_temp;
}
-
- define('APPPATH', $application_folder.DIRECTORY_SEPARATOR);
+ else
+ {
+ $application_folder = strtr(
+ rtrim($application_folder, '/\\'),
+ '/\\',
+ DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
+ );
+ }
+ }
+ elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
+ {
+ $application_folder = BASEPATH.strtr(
+ trim($application_folder, '/\\'),
+ '/\\',
+ DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
+ );
}
else
{
- if ( ! is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
- {
- header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
- echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
- exit(3); // EXIT_CONFIG
- }
-
- define('APPPATH', BASEPATH.$application_folder.DIRECTORY_SEPARATOR);
+ header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
+ echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
+ exit(3); // EXIT_CONFIG
}
- // The path to the "views" folder
- if ( ! is_dir($view_folder))
+ define('APPPATH', $application_folder.DIRECTORY_SEPARATOR);
+
+ // The path to the "views" directory
+ if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
{
- if ( ! empty($view_folder) && is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
- {
- $view_folder = APPPATH.$view_folder;
- }
- elseif ( ! is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
+ $view_folder = APPPATH.'views';
+ }
+ elseif (is_dir($view_folder))
+ {
+ if (($_temp = realpath($view_folder)) !== FALSE)
{
- header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
- echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
- exit(3); // EXIT_CONFIG
+ $view_folder = $_temp;
}
else
{
- $view_folder = APPPATH.'views';
+ $view_folder = strtr(
+ rtrim($view_folder, '/\\'),
+ '/\\',
+ DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
+ );
}
}
-
- if (($_temp = realpath($view_folder)) !== FALSE)
+ elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
{
- $view_folder = $_temp.DIRECTORY_SEPARATOR;
+ $view_folder = APPPATH.strtr(
+ trim($view_folder, '/\\'),
+ '/\\',
+ DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
+ );
}
else
{
- $view_folder = rtrim($view_folder, '/\\').DIRECTORY_SEPARATOR;
+ header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
+ echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
+ exit(3); // EXIT_CONFIG
}
- define('VIEWPATH', $view_folder);
+ define('VIEWPATH', $view_folder.DIRECTORY_SEPARATOR);
/*
* --------------------------------------------------------------------
View
2 license.txt
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+Copyright (c) 2014 - 2016, British Columbia Institute of Technology
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
8 readme.rst
@@ -16,7 +16,7 @@ Release Information
This repo contains in-development code for future releases. To download the
latest stable release please visit the `CodeIgniter Downloads
-<http://www.codeigniter.com/download>`_ page.
+<https://codeigniter.com/download>`_ page.
**************************
Changelog and New Features
@@ -39,7 +39,7 @@ issues, as well as missing features.
Installation
************
-Please see the `installation section <http://www.codeigniter.com/user_guide/installation/index.html>`_
+Please see the `installation section <https://codeigniter.com/user_guide/installation/index.html>`_
of the CodeIgniter User Guide.
*******
@@ -53,11 +53,11 @@ agreement <https://github.com/bcit-ci/CodeIgniter/blob/develop/user_guide_src/so
Resources
*********
-- `User Guide <http://www.codeigniter.com/docs>`_
+- `User Guide <https://codeigniter.com/docs>`_
- `Language File Translations <https://github.com/bcit-ci/codeigniter3-translations>`_
- `Community Forums <http://forum.codeigniter.com/>`_
- `Community Wiki <https://github.com/bcit-ci/CodeIgniter/wiki>`_
-- `Community IRC <http://www.codeigniter.com/irc>`_
+- `Community IRC <https://webchat.freenode.net/?channels=%23codeigniter>`_
Report security issues to our `Security Panel <mailto:security@codeigniter.com>`_
or via our `page on HackerOne <https://hackerone.com/codeigniter>`_, thank you.
View
10 system/core/Benchmark.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,10 +28,10 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
- * @link http://codeigniter.com
+ * @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
@@ -47,7 +47,7 @@
* @subpackage Libraries
* @category Libraries
* @author EllisLab Dev Team
- * @link http://codeigniter.com/user_guide/libraries/benchmark.html
+ * @link https://codeigniter.com/user_guide/libraries/benchmark.html
*/
class CI_Benchmark {
View
14 system/core/CodeIgniter.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,10 +28,10 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
- * @link http://codeigniter.com
+ * @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
@@ -46,7 +46,7 @@
* @subpackage CodeIgniter
* @category Front-controller
* @author EllisLab Dev Team
- * @link http://codeigniter.com/user_guide/
+ * @link https://codeigniter.com/user_guide/
*/
/**
@@ -298,7 +298,7 @@
* Instantiate the URI class
* ------------------------------------------------------
*/
- $URI =& load_class('URI', 'core');
+ $URI =& load_class('URI', 'core', $CFG);
/*
* ------------------------------------------------------
@@ -359,7 +359,7 @@
*
* Returns current CI instance object
*
- * @return object
+ * @return CI_Controller
*/
function &get_instance()
{
View
10 system/core/Common.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,10 +28,10 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
- * @link http://codeigniter.com
+ * @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
@@ -46,7 +46,7 @@
* @subpackage CodeIgniter
* @category Common Functions
* @author EllisLab Dev Team
- * @link http://codeigniter.com/user_guide/
+ * @link https://codeigniter.com/user_guide/
*/
// ------------------------------------------------------------------------
View
12 system/core/Config.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,10 +28,10 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
- * @link http://codeigniter.com
+ * @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
@@ -46,7 +46,7 @@
* @subpackage Libraries
* @category Libraries
* @author EllisLab Dev Team
- * @link http://codeigniter.com/user_guide/libraries/config.html
+ * @link https://codeigniter.com/user_guide/libraries/config.html
*/
class CI_Config {
@@ -169,7 +169,7 @@ public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE
$this->is_loaded[] = $file_path;
$config = NULL;
$loaded = TRUE;
- log_message('debug', 'Config file loaded: '.$file_path);
+ log_message('info', 'Config file loaded: '.$file_path);
}
}
View
10 system/core/Controller.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,10 +28,10 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
- * @link http://codeigniter.com
+ * @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
@@ -47,7 +47,7 @@
* @subpackage Libraries
* @category Libraries
* @author EllisLab Dev Team
- * @link http://codeigniter.com/user_guide/general/controllers.html
+ * @link https://codeigniter.com/user_guide/general/controllers.html
*/
class CI_Controller {
View
10 system/core/Exceptions.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,10 +28,10 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
- * @link http://codeigniter.com
+ * @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
@@ -44,7 +44,7 @@
* @subpackage Libraries
* @category Exceptions
* @author EllisLab Dev Team
- * @link http://codeigniter.com/user_guide/libraries/exceptions.html
+ * @link https://codeigniter.com/user_guide/libraries/exceptions.html
*/
class CI_Exceptions {
View
10 system/core/Hooks.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,10 +28,10 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
- * @link http://codeigniter.com
+ * @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
@@ -46,7 +46,7 @@
* @subpackage Libraries
* @category Libraries
* @author EllisLab Dev Team
- * @link http://codeigniter.com/user_guide/general/hooks.html
+ * @link https://codeigniter.com/user_guide/general/hooks.html
*/
class CI_Hooks {
View
12 system/core/Input.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,10 +28,10 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
- * @link http://codeigniter.com
+ * @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
@@ -46,7 +46,7 @@
* @subpackage Libraries
* @category Input
* @author EllisLab Dev Team
- * @link http://codeigniter.com/user_guide/libraries/input.html
+ * @link https://codeigniter.com/user_guide/libraries/input.html
*/
class CI_Input {
@@ -653,7 +653,7 @@ protected function _sanitize_globals()
// Sanitize PHP_SELF
$_SERVER['PHP_SELF'] = strip_tags($_SERVER['PHP_SELF']);
- log_message('debug', 'Global POST, GET and COOKIE data sanitized');
+ log_message('info', 'Global POST, GET and COOKIE data sanitized');
}
// --------------------------------------------------------------------
View
10 system/core/Lang.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,10 +28,10 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
- * @link http://codeigniter.com
+ * @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
@@ -44,7 +44,7 @@
* @subpackage Libraries
* @category Language
* @author EllisLab Dev Team
- * @link http://codeigniter.com/user_guide/libraries/language.html
+ * @link https://codeigniter.com/user_guide/libraries/language.html
*/
class CI_Lang {
View
70 system/core/Loader.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,10 +28,10 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
- * @link http://codeigniter.com
+ * @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
@@ -46,7 +46,7 @@
* @subpackage Libraries
* @category Loader
* @author EllisLab Dev Team
- * @link http://codeigniter.com/user_guide/libraries/loader.html
+ * @link https://codeigniter.com/user_guide/libraries/loader.html
*/
class CI_Loader {
@@ -285,13 +285,43 @@ public function model($model, $name = '', $db_conn = FALSE)
$this->database($db_conn, FALSE, TRUE);
}
+ // Note: All of the code under this condition used to be just:
+ //
+ // load_class('Model', 'core');
+ //
+ // However, load_class() instantiates classes
+ // to cache them for later use and that prevents
+ // MY_Model from being an abstract class and is
+ // sub-optimal otherwise anyway.
if ( ! class_exists('CI_Model', FALSE))
{
- load_class('Model', 'core');
+ $app_path = APPPATH.'core'.DIRECTORY_SEPARATOR;
+ if (file_exists($app_path.'Model.php'))
+ {
+ require_once($app_path.'Model.php');
+ if ( ! class_exists('CI_Model', FALSE))
+ {
+ throw new RuntimeException($app_path."Model.php exists, but doesn't declare class CI_Model");
+ }
+ }
+ elseif ( ! class_exists('CI_Model', FALSE))
+ {
+ require_once(BASEPATH.'core'.DIRECTORY_SEPARATOR.'Model.php');
+ }
+
+ $class = config_item('subclass_prefix').'Model';
+ if (file_exists($app_path.$class.'.php'))
+ {
+ require_once($app_path.$class.'.php');
+ if ( ! class_exists($class, FALSE))
+ {
+ throw new RuntimeException($app_path.$class.".php exists, but doesn't declare class ".$class);
+ }
+ }
}
$model = ucfirst($model);
- if ( ! class_exists($model))
+ if ( ! class_exists($model, FALSE))
{
foreach ($this->_ci_model_paths as $mod_path)
{
@@ -688,9 +718,16 @@ public function driver($library, $params = NULL, $object_name = NULL)
{
if (is_array($library))
{
- foreach ($library as $driver)
+ foreach ($library as $key => $value)
{
- $this->driver($driver);
+ if (is_int($key))
+ {
+ $this->driver($value, $params);
+ }
+ else
+ {
+ $this->driver($key, $params, $value);
+ }
}
return $this;
@@ -899,6 +936,14 @@ protected function _ci_load($_ci_data)
*/
if (is_array($_ci_vars))
{
+ foreach (array_keys($_ci_vars) as $key)
+ {
+ if (strncmp($key, '_ci_', 4) === 0)
+ {
+ unset($_ci_vars[$key]);
+ }
+ }
+
$this->_ci_cached_vars = array_merge($this->_ci_cached_vars, $_ci_vars);
}
extract($this->_ci_cached_vars);
@@ -1061,7 +1106,7 @@ protected function _ci_load_library($class, $params = NULL, $object_name = NULL)
* @used-by CI_Loader::_ci_load_library()
* @uses CI_Loader::_ci_init_library()
*
- * @param string $library Library name to load
+ * @param string $library_name Library name to load
* @param string $file_path Path to the library filename, relative to libraries/
* @param mixed $params Optional parameters to pass to the class constructor
* @param string $object_name Optional object name to assign to
@@ -1304,10 +1349,7 @@ protected function _ci_autoloader()
// Autoload drivers
if (isset($autoload['drivers']))
{
- foreach ($autoload['drivers'] as $item)
- {
- $this->driver($item);
- }
+ $this->driver($autoload['drivers']);
}
// Load libraries
View
37 system/core/Log.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,10 +28,10 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
- * @link http://codeigniter.com
+ * @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
@@ -44,7 +44,7 @@
* @subpackage Libraries
* @category Logging
* @author EllisLab Dev Team
- * @link http://codeigniter.com/user_guide/general/errors.html
+ * @link https://codeigniter.com/user_guide/general/errors.html
*/
class CI_Log {
@@ -154,8 +154,8 @@ public function __construct()
*
* Generally this function will be called using the global log_message() function
*
- * @param string the error level: 'error', 'debug' or 'info'
- * @param string the error message
+ * @param string $level The error level: 'error', 'debug' or 'info'
+ * @param string $msg The error message
* @return bool
*/
public function write_log($level, $msg)
@@ -191,6 +191,8 @@ public function write_log($level, $msg)
return FALSE;
}
+ flock($fp, LOCK_EX);
+
// Instantiating DateTime with microseconds appended to initial date is needed for proper support of this format
if (strpos($this->_date_fmt, 'u') !== FALSE)
{
@@ -204,9 +206,7 @@ public function write_log($level, $msg)
$date = date($this->_date_fmt);
}
- $message .= $level.' - '.$date.' --> '.$msg."\n";
-
- flock($fp, LOCK_EX);
+ $message .= $this->_format_line($level, $date, $msg);
for ($written = 0, $length = strlen($message); $written < $length; $written += $result)
{
@@ -227,4 +227,21 @@ public function write_log($level, $msg)
return is_int($result);
}
+ // --------------------------------------------------------------------
+
+ /**
+ * Format the log line.
+ *
+ * This is for extensibility of log formatting
+ * If you want to change the log format, extend the CI_Log class and override this method
+ *
+ * @param string $level The error level
+ * @param string $date Formatted date string
+ * @param string $message The log message
+ * @return string Formatted log line with a new line character '\n' at the end
+ */
+ protected function _format_line($level, $date, $message)
+ {
+ return $level.' - '.$date.' --> '.$message."\n";
+ }
}
View
10 system/core/Model.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,10 +28,10 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
- * @link http://codeigniter.com
+ * @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
@@ -44,7 +44,7 @@
* @subpackage Libraries
* @category Libraries
* @author EllisLab Dev Team
- * @link http://codeigniter.com/user_guide/libraries/config.html
+ * @link https://codeigniter.com/user_guide/libraries/config.html
*/
class CI_Model {
View
18 system/core/Output.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,10 +28,10 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
- * @link http://codeigniter.com
+ * @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
@@ -46,7 +46,7 @@
* @subpackage Libraries
* @category Output
* @author EllisLab Dev Team
- * @link http://codeigniter.com/user_guide/libraries/output.html
+ * @link https://codeigniter.com/user_guide/libraries/output.html
*/
class CI_Output {
@@ -285,7 +285,7 @@ public function get_content_type()
/**
* Get Header
*
- * @param string $header_name
+ * @param string $header
* @return string
*/
public function get_header($header)
@@ -377,7 +377,7 @@ public function set_profiler_sections($sections)
/**
* Set Cache
*
- * @param int $time Cache expiration time in seconds
+ * @param int $time Cache expiration time in minutes
* @return CI_Output
*/
public function cache($time)
@@ -492,7 +492,7 @@ public function _display($output = '')
echo $output;
log_message('info', 'Final output sent to browser');
- log_message('debug', 'Total execution time: '.$elapsed);
+ log_message('info', 'Total execution time: '.$elapsed);
return;
}
@@ -529,7 +529,7 @@ public function _display($output = '')
}
log_message('info', 'Final output sent to browser');
- log_message('debug', 'Total execution time: '.$elapsed);
+ log_message('info', 'Total execution time: '.$elapsed);
}
// --------------------------------------------------------------------
View
10 system/core/Router.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,10 +28,10 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
- * @link http://codeigniter.com
+ * @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
@@ -46,7 +46,7 @@
* @subpackage Libraries
* @category Libraries
* @author EllisLab Dev Team
- * @link http://codeigniter.com/user_guide/general/routing.html
+ * @link https://codeigniter.com/user_guide/general/routing.html
*/
class CI_Router {
View
19 system/core/Security.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,10 +28,10 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
- * @link http://codeigniter.com
+ * @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
@@ -44,7 +44,7 @@
* @subpackage Libraries
* @category Security
* @author EllisLab Dev Team
- * @link http://codeigniter.com/user_guide/libraries/security.html
+ * @link https://codeigniter.com/user_guide/libraries/security.html
*/
class CI_Security {
@@ -762,7 +762,14 @@ public function sanitize_filename($str, $relative_path = FALSE)
*/
public function strip_image_tags($str)
{
- return preg_replace(array('#<img[\s/]+.*?src\s*=\s*["\'](.+?)["\'].*?\>#', '#<img[\s/]+.*?src\s*=\s*(.+?).*?\>#'), '\\1', $str);
+ return preg_replace(
+ array(
+ '#<img[\s/]+.*?src\s*=\s*(["\'])([^\\1]+?)\\1.*?\>#i',
+ '#<img[\s/]+.*?src\s*=\s*?(([^\s"\'=<>`]+)).*?\>#i'
+ ),
+ '\\2',
+ $str
+ );
}
// ----------------------------------------------------------------
View
132 system/core/URI.php
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
- * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+ * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -28,10 +28,10 @@
*
* @package CodeIgniter
* @author EllisLab Dev Team
- * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
- * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+ * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
- * @link http://codeigniter.com
+ * @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
@@ -46,7 +46,7 @@
* @subpackage Libraries
* @category URI
* @author EllisLab Dev Team
- * @link http://codeigniter.com/user_guide/libraries/uri.html
+ * @link https://codeigniter.com/user_guide/libraries/uri.html
*/
class CI_URI {
@@ -96,45 +96,40 @@ class CI_URI {
*
* @return void
*/
- public function __construct()
+ public function __construct(CI_Config $config)
{
- $this->config =& load_class('Config', 'core');
+ $this->config = $config;
+ // If it's a CLI request, ignore the configuration
+ if (is_cli())
+ {
+ $this->_set_uri_string($this->_parse_argv(), TRUE);
+ }
// If query strings are enabled, we don't need to parse any segments.
- // However, they don't make sense under CLI.
- if (is_cli() OR $this->config->item('enable_query_strings') !== TRUE)
+ elseif ($this->config->item('enable_query_strings') !== TRUE)
{
$this->_permitted_uri_chars = $this->config->item('permitted_uri_chars');
+ $protocol = $this->config->item('uri_protocol');
+ empty($protocol) && $protocol = 'REQUEST_URI';
- // If it's a CLI request, ignore the configuration
- if (is_cli())
+ switch ($protocol)
{
- $uri = $this->_parse_argv();
+ case 'AUTO': // For BC purposes only
+ case 'REQUEST_URI':
+ $uri = $this->_parse_request_uri();
+ break;
+ case 'QUERY_STRING':
+ $uri = $this->_parse_query_string();
+ break;
+ case 'PATH_INFO':
+ default:
+ $uri = isset($_SERVER[$protocol])
+ ? $_SERVER[$protocol]
+ : $this->_parse_request_uri();
+ break;
}
- else
- {
- $protocol = $this->config->item('uri_protocol');
- empty($protocol) && $protocol = 'REQUEST_URI';
- switch ($protocol)
- {
- case 'AUTO': // For BC purposes only
- case 'REQUEST_URI':
- $uri = $this->_parse_request_uri();
- break;
- case 'QUERY_STRING':
- $uri = $this->_parse_query_string();
- break;
- case 'PATH_INFO':
- default:
- $uri = isset($_SERVER[$protocol])
- ? $_SERVER[$protocol]
- : $this->_parse_request_uri();
- break;
- }
- }
-
- $this->_set_uri_string($uri);
+ $this->_set_uri_string($uri, FALSE);
}
log_message('info', 'URI Class Initialized');
@@ -145,43 +140,66 @@ public function __construct()
/**
* Set URI String
*
- * @param string $str
+ * @param string $str Input URI string
+ * @param bool $is_cli Whether the input comes from CLI
* @return void
*/
- protected function _set_uri_string($str)
+ protected function _set_uri_string($str, $is_cli = FALSE)
{
- // Filter out control characters and trim slashes
- $this->uri_string = trim(remove_invisible_characters($str, FALSE), '/');
-
- if ($this->uri_string !== '')
+ // CLI requests have a bit simpler logic
+ if ($is_cli)
{