Permalink
Browse files

Merge branch 'develop' of https://github.com/EllisLab/CodeIgniter int…

…o develop
  • Loading branch information...
2 parents 4c9fbc2 + b3d7443 commit 44d1503a49e2980d961fbd257108606fe01a6ea6 @jcc2010 committed Apr 28, 2012
Showing with 3,693 additions and 1,961 deletions.
  1. +6 −3 .travis.yml
  2. +6 −5 application/config/database.php
  3. +34 −29 application/config/foreign_chars.php
  4. +4 −7 system/core/Benchmark.php
  5. +17 −12 system/core/CodeIgniter.php
  6. +170 −170 system/core/Common.php
  7. +6 −12 system/core/Config.php
  8. +14 −3 system/core/Controller.php
  9. +18 −21 system/core/Exceptions.php
  10. +5 −3 system/core/Hooks.php
  11. +122 −100 system/core/Input.php
  12. +21 −15 system/core/Lang.php
  13. +33 −24 system/core/Loader.php
  14. +4 −3 system/core/Model.php
  15. +17 −7 system/core/Output.php
  16. +15 −7 system/core/Router.php
  17. +51 −48 system/core/Security.php
  18. +12 −8 system/core/URI.php
  19. +1 −3 system/core/Utf8.php
  20. +10 −10 system/database/DB.php
  21. +8 −8 system/database/DB_driver.php
  22. +256 −244 system/database/{DB_active_rec.php → DB_query_builder.php}
  23. +26 −58 system/database/drivers/cubrid/cubrid_driver.php
  24. +32 −62 system/database/drivers/cubrid/cubrid_forge.php
  25. +14 −48 system/database/drivers/cubrid/cubrid_result.php
  26. +1 −1 system/database/drivers/cubrid/cubrid_utility.php
  27. +1 −1 system/database/drivers/interbase/interbase_driver.php
  28. +2 −2 system/database/drivers/mssql/mssql_driver.php
  29. +2 −2 system/database/drivers/mysql/mysql_driver.php
  30. +2 −2 system/database/drivers/mysqli/mysqli_driver.php
  31. +2 −2 system/database/drivers/oci8/oci8_driver.php
  32. +2 −2 system/database/drivers/odbc/odbc_driver.php
  33. +3 −3 system/database/drivers/pdo/pdo_driver.php
  34. +39 −37 system/database/drivers/postgre/postgre_driver.php
  35. +19 −46 system/database/drivers/postgre/postgre_forge.php
  36. +2 −2 system/database/drivers/sqlite/sqlite_driver.php
  37. +1 −1 system/database/drivers/sqlite3/sqlite3_driver.php
  38. +3 −3 system/database/drivers/sqlsrv/sqlsrv_driver.php
  39. +28 −28 system/helpers/array_helper.php
  40. +9 −9 system/helpers/captcha_helper.php
  41. +32 −32 system/helpers/cookie_helper.php
  42. +122 −122 system/helpers/date_helper.php
  43. +12 −11 system/helpers/directory_helper.php
  44. +13 −10 system/helpers/download_helper.php
  45. +14 −14 system/helpers/email_helper.php
  46. +100 −99 system/helpers/file_helper.php
  47. +260 −254 system/helpers/form_helper.php
  48. +94 −93 system/helpers/html_helper.php
  49. +35 −13 system/libraries/Cache/Cache.php
  50. +1 −1 system/libraries/Cache/drivers/Cache_apc.php
  51. +1 −1 system/libraries/Cache/drivers/Cache_dummy.php
  52. +12 −4 system/libraries/Cache/drivers/Cache_file.php
  53. +17 −7 system/libraries/Cache/drivers/Cache_memcached.php
  54. +1 −1 system/libraries/Cache/drivers/Cache_wincache.php
  55. +69 −23 system/libraries/Calendar.php
  56. +41 −5 system/libraries/Cart.php
  57. +42 −3 system/libraries/Driver.php
  58. +1 −0 system/libraries/Email.php
  59. +34 −1 system/libraries/Encrypt.php
  60. +79 −4 system/libraries/Form_validation.php
  61. +300 −19 system/libraries/Image_lib.php
  62. +46 −0 system/libraries/Log.php
  63. +39 −0 system/libraries/Migration.php
  64. +17 −1 system/libraries/Parser.php
  65. +33 −11 system/libraries/Profiler.php
  66. +129 −0 system/libraries/Session.php
  67. +50 −2 system/libraries/Table.php
  68. +30 −6 system/libraries/Typography.php
  69. +105 −15 system/libraries/User_agent.php
  70. +18 −18 system/libraries/Xmlrpc.php
  71. +32 −5 system/libraries/Xmlrpcs.php
  72. +40 −0 system/libraries/Zip.php
  73. +36 −0 tests/codeigniter/database/DB_driver_test.php
  74. 0 tests/codeigniter/database/query_builder/.gitkeep
  75. +53 −0 tests/codeigniter/database/query_builder/get_test.php
  76. +67 −0 tests/codeigniter/database/query_builder/insert_test.php
  77. +95 −0 tests/codeigniter/database/query_builder/select_test.php
  78. +13 −2 tests/mocks/autoloader.php
  79. BIN tests/mocks/database/ci_test.sqlite
  80. +37 −0 tests/mocks/database/config/pdo/mysql.php
  81. +37 −0 tests/mocks/database/config/pdo/pgsql.php
  82. +37 −0 tests/mocks/database/config/pdo/sqlite.php
  83. +4 −5 tests/mocks/database/config/sqlite.php
  84. +8 −9 tests/mocks/database/db.php
  85. +36 −0 tests/mocks/database/db/driver.php
  86. +10 −0 tests/mocks/database/db/querybuilder.php
  87. +16 −0 tests/mocks/database/drivers/mysql.php
  88. +16 −0 tests/mocks/database/drivers/pdo.php
  89. +16 −0 tests/mocks/database/drivers/postgre.php
  90. +16 −0 tests/mocks/database/drivers/sqlite.php
  91. 0 tests/mocks/database/schema/.gitkeep
  92. +98 −0 tests/mocks/database/schema/skeleton.php
  93. +0 −5 tests/travis/mysql.phpunit.xml
  94. +32 −0 tests/travis/pdo/mysql.phpunit.xml
  95. +32 −0 tests/travis/pdo/pgsql.phpunit.xml
  96. +32 −0 tests/travis/pdo/sqlite.phpunit.xml
  97. +0 −5 tests/travis/pgsql.phpunit.xml
  98. +0 −5 tests/travis/sqlite.phpunit.xml
  99. +10 −2 user_guide_src/source/changelog.rst
  100. +6 −6 user_guide_src/source/database/configuration.rst
  101. +1 −1 user_guide_src/source/database/connecting.rst
  102. +4 −4 user_guide_src/source/database/examples.rst
  103. +2 −2 user_guide_src/source/database/index.rst
  104. +1 −1 user_guide_src/source/database/queries.rst
  105. +18 −18 user_guide_src/source/database/{active_record.rst → query_builder.rst}
  106. +1 −1 user_guide_src/source/general/models.rst
  107. +12 −1 user_guide_src/source/general/styleguide.rst
  108. +92 −60 user_guide_src/source/helpers/date_helper.rst
  109. +1 −1 user_guide_src/source/helpers/directory_helper.rst
  110. +10 −0 user_guide_src/source/installation/upgrade_300.rst
  111. +2 −2 user_guide_src/source/libraries/javascript.rst
  112. +1 −1 user_guide_src/source/overview/features.rst
  113. +1 −1 user_guide_src/source/tutorial/create_news_items.rst
  114. +1 −1 user_guide_src/source/tutorial/index.rst
  115. +2 −2 user_guide_src/source/tutorial/news_section.rst
View
@@ -8,14 +8,17 @@ env:
- DB=mysql
- DB=pgsql
- DB=sqlite
+ - DB=pdo/mysql
+ - DB=pdo/pgsql
+ - DB=pdo/sqlite
before_script:
- pyrus channel-discover pear.php-tools.net
- pyrus install http://pear.php-tools.net/get/vfsStream-0.11.2.tgz
- phpenv rehash
- - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS ci_test;' -U postgres; fi"
- - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database ci_test;' -U postgres; fi"
- - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS ci_test;'; fi"
+ - 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' = 'pdo/mysql' ]; then mysql -e 'create database IF NOT EXISTS ci_test;'; fi"
script: phpunit --configuration tests/travis/$DB.phpunit.xml
@@ -43,9 +43,10 @@
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
| ['dbdriver'] The database type. e.g.: mysql. Currently supported:
- mysql, mysqli, pdo, postgre, odbc, mssql, sqlite, oci8
+| cubrid, interbase, mssql, mysql, mysqli, oci8,
+| odbc, pdo, postgre, sqlite, sqlite3, sqlsrv
| ['dbprefix'] You can add an optional prefix, which will be added
-| to the table name when using the Active Record class
+| to the table name when using the Query Builder class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
@@ -68,12 +69,12 @@
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the 'default' group).
|
-| The $active_record variables lets you determine whether or not to load
-| the active record class
+| The $query_builder variables lets you determine whether or not to load
+| the query builder class
*/
$active_group = 'default';
-$active_record = TRUE;
+$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
@@ -40,50 +40,55 @@
'/Ä/' => 'Ae',
'/Ü/' => 'Ue',
'/Ö/' => 'Oe',
- '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ/' => 'A',
- '/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª/' => 'a',
+ '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|Α|Ά/' => 'A',
+ '/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª|α|ά/' => 'a',
'/Ç|Ć|Ĉ|Ċ|Č/' => 'C',
'/ç|ć|ĉ|ċ|č/' => 'c',
- '/Ð|Ď|Đ/' => 'Dj',
- '/ð|ď|đ/' => 'dj',
- '/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě/' => 'E',
- '/è|é|ê|ë|ē|ĕ|ė|ę|ě/' => 'e',
- '/Ĝ|Ğ|Ġ|Ģ/' => 'G',
- '/ĝ|ğ|ġ|ģ/' => 'g',
+ '/Ð|Ď|Đ/' => 'Dj',
+ '/ð|ď|đ/' => 'dj',
+ '/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Ε|Έ/' => 'E',
+ '/è|é|ê|ë|ē|ĕ|ė|ę|ě|έ|ε/' => 'e',
+ '/Ĝ|Ğ|Ġ|Ģ/' => 'G',
+ '/ĝ|ğ|ġ|ģ/' => 'g',
'/Ĥ|Ħ/' => 'H',
'/ĥ|ħ/' => 'h',
- '/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ/' => 'I',
- '/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı/' => 'i',
+ '/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|Η|Ή|Ί|Ι|Ϊ/' => 'I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ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ/' => 'U',
- '/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ/' => 'u',
- '/Ý|Ÿ|Ŷ/' => 'Y',
+ '/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|υ|ύ|ϋ/' => 'u',
+ '/Ý|Ÿ|Ŷ|Υ|Ύ|Ϋ/' => 'Y',
'/ý|ÿ|ŷ/' => 'y',
'/Ŵ/' => 'W',
'/ŵ/' => 'w',
- '/Ź|Ż|Ž/' => 'Z',
- '/ź|ż|ž/' => 'z',
+ '/Ź|Ż|Ž/' => 'Z',
+ '/ź|ż|ž/' => 'z',
'/Æ|Ǽ/' => 'AE',
'/ß/'=> 'ss',
'/IJ/' => 'IJ',
'/ij/' => 'ij',
'/Œ/' => 'OE',
- '/ƒ/' => 'f'
+ '/ƒ/' => 'f',
+ '/ξ/' => 'ks',
+ '/π/' => 'p',
+ '/β/' => 'v',
+ '/μ/' => 'm',
+ '/ψ/' => 'ps',
);
/* End of file foreign_chars.php */
@@ -46,7 +46,7 @@ class CI_Benchmark {
*
* @var array
*/
- public $marker = array();
+ public $marker = array();
// --------------------------------------------------------------------
@@ -61,7 +61,7 @@ class CI_Benchmark {
*/
public function mark($name)
{
- $this->marker[$name] = microtime();
+ $this->marker[$name] = microtime(TRUE);
}
// --------------------------------------------------------------------
@@ -93,13 +93,10 @@ public function elapsed_time($point1 = '', $point2 = '', $decimals = 4)
if ( ! isset($this->marker[$point2]))
{
- $this->marker[$point2] = microtime();
+ $this->marker[$point2] = microtime(TRUE);
}
- list($sm, $ss) = explode(' ', $this->marker[$point1]);
- list($em, $es) = explode(' ', $this->marker[$point2]);
-
- return number_format(($em + $es) - ($sm + $ss), $decimals);
+ return number_format($this->marker[$point2] - $this->marker[$point1], $decimals);
}
// --------------------------------------------------------------------
@@ -25,8 +25,6 @@
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* System Initialization File
*
@@ -42,7 +40,7 @@
/**
* CodeIgniter Version
*
- * @var string
+ * @var string
*
*/
define('CI_VERSION', '3.0-dev');
@@ -155,7 +153,7 @@
*
* Note: Order here is rather important as the UTF-8
* class needs to be used very early on, but it cannot
- * properly determine if UTf-8 can be supported until
+ * properly determine if UTF-8 can be supported until
* after the Config class is instantiated.
*
*/
@@ -230,6 +228,13 @@
// Load the base controller class
require BASEPATH.'core/Controller.php';
+ /**
+ * Reference to the CI_Controller method.
+ *
+ * Returns current CI instance object
+ *
+ * @return object
+ */
function &get_instance()
{
return CI_Controller::get_instance();
@@ -275,20 +280,20 @@ function &get_instance()
{
$x = explode('/', $RTR->routes['404_override'], 2);
$class = $x[0];
- $method = (isset($x[1]) ? $x[1] : 'index');
+ $method = isset($x[1]) ? $x[1] : 'index';
if ( ! class_exists($class))
{
if ( ! file_exists(APPPATH.'controllers/'.$class.'.php'))
{
- show_404("{$class}/{$method}");
+ show_404($class.'/'.$method);
}
include_once(APPPATH.'controllers/'.$class.'.php');
}
}
else
{
- show_404("{$class}/{$method}");
+ show_404($class.'/'.$method);
}
}
@@ -337,12 +342,12 @@ function &get_instance()
{
$x = explode('/', $RTR->routes['404_override'], 2);
$class = $x[0];
- $method = (isset($x[1]) ? $x[1] : 'index');
+ $method = isset($x[1]) ? $x[1] : 'index';
if ( ! class_exists($class))
{
if ( ! file_exists(APPPATH.'controllers/'.$class.'.php'))
{
- show_404("{$class}/{$method}");
+ show_404($class.'/'.$method);
}
include_once(APPPATH.'controllers/'.$class.'.php');
@@ -352,7 +357,7 @@ function &get_instance()
}
else
{
- show_404("{$class}/{$method}");
+ show_404($class.'/'.$method);
}
}
@@ -393,10 +398,10 @@ function &get_instance()
* Close the DB connection if one exists
* ------------------------------------------------------
*/
- if (class_exists('CI_DB') && isset($CI->db))
+ if (class_exists('CI_DB') && isset($CI->db) && ! $CI->db->pconnect)
{
$CI->db->close();
}
/* End of file CodeIgniter.php */
-/* Location: ./system/core/CodeIgniter.php */
+/* Location: ./system/core/CodeIgniter.php */
Oops, something went wrong. Retry.

0 comments on commit 44d1503

Please sign in to comment.