From 24abcb98d4281dcf857cb08a86a58af286a2f94a Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 5 Jan 2012 20:40:15 +0200 Subject: Numerous improvements to the Oracle (oci8) driver and DB_driver --- user_guide_src/source/changelog.rst | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 668f073df..2d76f81c9 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -45,6 +45,12 @@ Release Date: Not Released get_compiled_insert(), get_compiled_update(), get_compiled_delete(). - Taking care of LIKE condition when used with MySQL UPDATE statement. - Adding $escape parameter to the order_by function, this enables ordering by custom fields. + - Improved support of the Oracle (OCI8) driver, including: + - Added support for dropping tables to :doc:`Database Forge `. + - Added support for listing database schemas to :doc:`Database Utilities `. + - Generally improved for speed and cleaned up all of its components. + - *Row* result methods now really only fetch only the needed number of rows, instead of depending entirely on ``result()``. + - ``num_rows()`` is now only called explicitly by the developer and no longer re-executes statements. - Libraries @@ -75,8 +81,7 @@ Bug fixes for 3.0 ------------------ - Unlink raised an error if cache file did not exist when you try to delete it. -- Fixed a bug (#181) where a mis-spelling was in the form validation - language file. +- Fixed a bug (#181) where a mis-spelling was in the form validation language file. - Fixed a bug (#159, #163) that mishandled Active Record nested transactions because _trans_depth was not getting incremented. - Fixed a bug (#737, #75) where pagination anchor class was not set properly when using initialize method. - Fixed a bug (#419) - auto_link() now recognizes URLs that come after a word boundary. @@ -92,8 +97,7 @@ Bug fixes for 3.0 - Fixed a bug (#406) - sqlsrv DB driver not reuturning resource on db_pconnect(). - Fixed a bug in CI_Image_lib::gd_loaded() where it was possible for the script execution to end or a PHP E_WARNING message to be emitted. - In Pagination library, when use_page_numbers=TRUE previous link and page 1 link do not have the same url - - +- Fixed a bug in the Oracle (oci8) instance of :doc:`Database Forge Class ` where ``create_table()`` would fail if used with ``AUTO_INCREMENT`` as it's not supported by Oracle. Version 2.1.0 ============= @@ -156,11 +160,9 @@ Release Date: Not Released override them. - Removed CI_CORE boolean constant from CodeIgniter.php (no longer Reactor and Core versions). - Bug fixes for 2.1.0 ------------------- - - Fixed #378 Robots identified as regular browsers by the User Agent class. - If a config class was loaded first then a library with the same name @@ -1159,7 +1161,7 @@ Bug fixes for 1.6.3 - Added a language key for valid_emails in validation_lang.php. - Amended fixes for bug (#3419) with parsing DSN database connections. -- Moved the _has_operators() function (#4535) into DB_driver from +- Moved the _has_operator() function (#4535) into DB_driver from DB_active_rec. - Fixed a syntax error in upload_lang.php. - Fixed a bug (#4542) with a regular expression in the Image library. -- cgit v1.2.3-24-g4f1b From dc2ddfedc0660ce6db52db40ffa5667480b7568f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 5 Jan 2012 21:49:19 +0200 Subject: Update the changelog for #413 --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 2d76f81c9..5a290e73d 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -98,6 +98,7 @@ Bug fixes for 3.0 - Fixed a bug in CI_Image_lib::gd_loaded() where it was possible for the script execution to end or a PHP E_WARNING message to be emitted. - In Pagination library, when use_page_numbers=TRUE previous link and page 1 link do not have the same url - Fixed a bug in the Oracle (oci8) instance of :doc:`Database Forge Class ` where ``create_table()`` would fail if used with ``AUTO_INCREMENT`` as it's not supported by Oracle. +- Fixed a bug (#413) - The Oracle (oci8) database driver only used to return connection-related errors in `_error_message()` and `_error_number()`. Version 2.1.0 ============= -- cgit v1.2.3-24-g4f1b From 7fd137b9cb3aa8477e92ecce434ac61e904527c2 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 6 Jan 2012 13:59:31 +0200 Subject: Add an oracle-related note to num_rows() in the documentation --- user_guide_src/source/database/results.rst | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/database/results.rst b/user_guide_src/source/database/results.rst index 4f93c794d..de4a337cb 100644 --- a/user_guide_src/source/database/results.rst +++ b/user_guide_src/source/database/results.rst @@ -150,6 +150,13 @@ is the variable that the query result object is assigned to:: echo $query->num_rows(); +.. note:: Oracle (OCI8 driver) doesn't have a way of returning the + total number of rows in a result set without actually fetching + all of them. The only way to achieve this is to get all of the + results first and do a ``count()`` on the resulting array, + therefore you can't use ``num_rows()`` to increase performance + when using the OCI8 driver. + $query->num_fields() ===================== -- cgit v1.2.3-24-g4f1b From 901573ce19e905ce28a3f3345c33dedf9c703cd4 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 11 Jan 2012 01:40:48 +0200 Subject: Fix issue 863 --- user_guide_src/source/changelog.rst | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 48011f208..b82b38e64 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -52,13 +52,13 @@ Release Date: Not Released - Added max_filename_increment config setting for Upload library. - CI_Loader::_ci_autoloader() is now a protected method. - - Modified valid_ip() to use PHP's filter_var() when possible (>= PHP 5.2) in the :doc:`Form Validation library `. - - Added custom filename to Email::attach() as $this->email->attach($filename, $disposition, $newname) + - Modified valid_ip() to use PHP's filter_var() when possible (>= PHP 5.2) in the :doc:`Input library ` (also used by :doc:`Form Validation library `). + - Added custom filename to Email::attach() as $this->email->attach($filename, $disposition, $newname) - Cart library changes include: - It now auto-increments quantity's instead of just resetting it, this is the default behaviour of large e-commerce sites. - Product Name strictness can be disabled via the Cart Library by switching "$product_name_safe" - Added function remove() to remove a cart item, updating with quantity of 0 seemed like a hack but has remained to retain compatability - - Image manipulation library changes include: + - :doc:`Image Manipulation library ` changes include: - The initialize() method now only sets existing class properties. - Added support for 3-length hex color values for wm_font_color and wm_shadow_color properties, as well as validation for them. - Class properties wm_font_color, wm_shadow_color and wm_use_drop_shadow are now protected, to avoid breaking the text_watermark() method @@ -66,6 +66,9 @@ Release Date: Not Released - Minor speed optimizations and method & property visibility declarations in the Calendar Library. - Removed SHA1 function in the :doc:`Encryption Library `. - Added $config['csrf_regeneration'] to the CSRF protection in the :doc:`Security library `, which makes token regeneration optional. + - :doc:`Form Validation library ` changes include: + - _execute() now considers input data to be invalid if a specified rule is not found. + - Removed method is_numeric() as it exists as a native PHP function and _execute() will find and use that (the 'is_numeric' rule itself is deprecated since 1.6.1). - Core @@ -97,11 +100,12 @@ Bug fixes for 3.0 - In Pagination library, when use_page_numbers=TRUE previous link and page 1 link do not have the same url - Fixed a bug (#561) - Errors in :doc:`XML-RPC Library ` were not properly escaped. - Fixed a bug (#904) - ``CI_Loader::initialize()`` caused a PHP Fatal error to be triggered if error level E_STRICT is used. +- Fixed a bug (#863) - CI_Form_validation::_execute() silently continued to the next rule, if a callback rule method is not found. Version 2.1.0 ============= -Release Date: Not Released +Release Date: November 14, 2011 - General Changes -- cgit v1.2.3-24-g4f1b From 81c87cd453c61a17e28aff2cc3f4ea76d4d19c59 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 12 Jan 2012 17:00:29 +0200 Subject: Update the changelog --- user_guide_src/source/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index b82b38e64..27a8b5701 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -100,7 +100,7 @@ Bug fixes for 3.0 - In Pagination library, when use_page_numbers=TRUE previous link and page 1 link do not have the same url - Fixed a bug (#561) - Errors in :doc:`XML-RPC Library ` were not properly escaped. - Fixed a bug (#904) - ``CI_Loader::initialize()`` caused a PHP Fatal error to be triggered if error level E_STRICT is used. -- Fixed a bug (#863) - CI_Form_validation::_execute() silently continued to the next rule, if a callback rule method is not found. +- Fixed a bug (#11, #183, #863) - CI_Form_validation::_execute() silently continued to the next rule, if a rule method/function is not found. Version 2.1.0 ============= -- cgit v1.2.3-24-g4f1b From cde43687ef19aa23ee6796925270961b760369f3 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 13 Jan 2012 20:16:35 +0200 Subject: Allow native PHP functions used as rules to accept an additional parameter --- user_guide_src/source/changelog.rst | 1 + user_guide_src/source/libraries/form_validation.rst | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 27a8b5701..7c2ee26eb 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -69,6 +69,7 @@ Release Date: Not Released - :doc:`Form Validation library ` changes include: - _execute() now considers input data to be invalid if a specified rule is not found. - Removed method is_numeric() as it exists as a native PHP function and _execute() will find and use that (the 'is_numeric' rule itself is deprecated since 1.6.1). + - Native PHP functions used as rules can now accept an additional parameter, other than the data itself. - Core diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index e7875bc22..999ab362c 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -321,7 +321,7 @@ password to MD5, and running the username through the "xss_clean" function, which removes malicious data. **Any native PHP function that accepts one parameter can be used as a -rule, like htmlspecialchars, trim, MD5, etc.** +rule, like htmlspecialchars, trim, md5, etc.** .. note:: You will generally want to use the prepping functions **after** the validation rules so if there is an error, the original @@ -857,8 +857,9 @@ Rule Parameter Description $this->form_validation->required($string); -.. note:: You can also use any native PHP functions that permit one - parameter. +.. note:: You can also use any native PHP functions that permit up + to two parameters, where at least one is required (to pass + the field data). ****************** Prepping Reference -- cgit v1.2.3-24-g4f1b From 8ae24c57a1240a5a5e3fbd5755227e5d42b75390 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 16 Jan 2012 13:05:23 +0200 Subject: Add SQLite3 database driver --- user_guide_src/source/changelog.rst | 1 + user_guide_src/source/database/configuration.rst | 2 +- user_guide_src/source/general/requirements.rst | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 48011f208..e554b57d3 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -47,6 +47,7 @@ Release Date: Not Released get_compiled_insert(), get_compiled_update(), get_compiled_delete(). - Taking care of LIKE condition when used with MySQL UPDATE statement. - Adding $escape parameter to the order_by function, this enables ordering by custom fields. + - Added support for SQLite3 database driver. - Libraries diff --git a/user_guide_src/source/database/configuration.rst b/user_guide_src/source/database/configuration.rst index 4f88c25ab..7d3960f10 100644 --- a/user_guide_src/source/database/configuration.rst +++ b/user_guide_src/source/database/configuration.rst @@ -163,7 +163,7 @@ Explanation of Values: ====================== ================================================================================================== .. note:: Depending on what database platform you are using (MySQL, - Postgres, etc.) not all values will be needed. For example, when using + Postgre, etc.) not all values will be needed. For example, when using SQLite you will not need to supply a username or password, and the database name will be the path to your database file. The information above assumes you are using MySQL. diff --git a/user_guide_src/source/general/requirements.rst b/user_guide_src/source/general/requirements.rst index 38623557d..15686d7a7 100644 --- a/user_guide_src/source/general/requirements.rst +++ b/user_guide_src/source/general/requirements.rst @@ -4,5 +4,5 @@ Server Requirements - `PHP `_ version 5.1.6 or newer. - A Database is required for most web application programming. Current - supported databases are MySQL (4.1+), MySQLi, MS SQL, Postgres, Oracle, - SQLite, ODBC and CUBRID. \ No newline at end of file + supported database drivers are MySQL (4.1+), MySQLi, MS SQL, Postgre, + Oracle, SQLite, SQLite3, ODBC and CUBRID. -- cgit v1.2.3-24-g4f1b From 8d5b24a8c55dc1ae7721e10de094c4aba2ca7eae Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 27 Jan 2012 14:37:38 +0200 Subject: Fix issue #128 --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 48011f208..71143b99b 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -97,6 +97,7 @@ Bug fixes for 3.0 - In Pagination library, when use_page_numbers=TRUE previous link and page 1 link do not have the same url - Fixed a bug (#561) - Errors in :doc:`XML-RPC Library ` were not properly escaped. - Fixed a bug (#904) - ``CI_Loader::initialize()`` caused a PHP Fatal error to be triggered if error level E_STRICT is used. +- Fixed a bug (#128) - :doc:`Language Library ` did not correctly keep track of loaded language files. Version 2.1.0 ============= -- cgit v1.2.3-24-g4f1b From e90b6844701a8d7240cb2ac595c2d9d0d211d765 Mon Sep 17 00:00:00 2001 From: Kwaan Online <> Date: Tue, 31 Jan 2012 10:15:30 +0000 Subject: - Updated timezone selete list to match function output. - Updated timezone reference to match function output. - Note some reference locations have been abridged so they fit the table format. A note has been added to this effect. --- user_guide_src/source/helpers/date_helper.rst | 152 ++++++++++++++++---------- 1 file changed, 92 insertions(+), 60 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/helpers/date_helper.rst b/user_guide_src/source/helpers/date_helper.rst index ad06dd628..bd5a3aa18 100644 --- a/user_guide_src/source/helpers/date_helper.rst +++ b/user_guide_src/source/helpers/date_helper.rst @@ -327,36 +327,46 @@ Generates a pull-down menu of timezones, like this one:
@@ -393,66 +403,88 @@ Timezone Reference The following table indicates each timezone and its location. +Note some of the location lists have been abridged for clarity and formatting. + +------------+----------------------------------------------------------------+ | Time Zone | Location | +============+================================================================+ -| UM12 | (UTC - 12:00) Enitwetok, Kwajalien | +| UM12 | (UTC - 12:00) Baker/Howland Island | ++------------+----------------------------------------------------------------+ +| UM11 | (UTC - 11:00) Samoa Time Zone, Niue | ++------------+----------------------------------------------------------------+ +| UM10 | (UTC - 10:00) Hawaii-Aleutian Standard Time, Cook Islands | ++------------+----------------------------------------------------------------+ +| UM95 | (UTC - 09:30) Marquesas Islands | ++------------+----------------------------------------------------------------+ +| UM9 | (UTC - 09:00) Alaska Standard Time, Gambier Islands | ++------------+----------------------------------------------------------------+ +| UM8 | (UTC - 08:00) Pacific Standard Time, Clipperton Island | ++------------+----------------------------------------------------------------+ +| UM7 | (UTC - 11:00) Mountain Standard Time | ++------------+----------------------------------------------------------------+ +| UM6 | (UTC - 06:00) Central Standard Time | ++------------+----------------------------------------------------------------+ +| UM5 | (UTC - 05:00) Eastern Standard Time, Western Caribbean | ++------------+----------------------------------------------------------------+ +| UM45 | (UTC - 04:30) Venezuelan Standard Time | ++------------+----------------------------------------------------------------+ +| UM4 | (UTC - 04:00) Atlantic Standard Time, Eastern Caribbean | +------------+----------------------------------------------------------------+ -| UM11 | (UTC - 11:00) Nome, Midway Island, Samoa | +| UM35 | (UTC - 03:30) Newfoundland Standard Time | +------------+----------------------------------------------------------------+ -| UM10 | (UTC - 10:00) Hawaii | +| UM3 | (UTC - 03:00) Argentina, Brazil, French Guiana, Uruguay | +------------+----------------------------------------------------------------+ -| UM9 | (UTC - 9:00) Alaska | +| UM2 | (UTC - 02:00) South Georgia/South Sandwich Islands | +------------+----------------------------------------------------------------+ -| UM8 | (UTC - 8:00) Pacific Time | +| UM1 | (UTC -1:00) Azores, Cape Verde Islands | +------------+----------------------------------------------------------------+ -| UM7 | (UTC - 7:00) Mountain Time | +| UTC | (UTC) Greenwich Mean Time, Western European Time | +------------+----------------------------------------------------------------+ -| UM6 | (UTC - 6:00) Central Time, Mexico City | +| UP1 | (UTC +1:00) Central European Time, West Africa Time | +------------+----------------------------------------------------------------+ -| UM5 | (UTC - 5:00) Eastern Time, Bogota, Lima, Quito | +| UP2 | (UTC +2:00) Central Africa Time, Eastern European Time | +------------+----------------------------------------------------------------+ -| UM4 | (UTC - 4:00) Atlantic Time, Caracas, La Paz | +| UP3 | (UTC +3:00) Moscow Time, East Africa Time | +------------+----------------------------------------------------------------+ -| UM25 | (UTC - 3:30) Newfoundland | +| UP35 | (UTC +3:30) Iran Standard Time | +------------+----------------------------------------------------------------+ -| UM3 | (UTC - 3:00) Brazil, Buenos Aires, Georgetown, Falkland Is. | +| UP4 | (UTC +4:00) Azerbaijan Standard Time, Samara Time | +------------+----------------------------------------------------------------+ -| UM2 | (UTC - 2:00) Mid-Atlantic, Ascention Is., St Helena | +| UP45 | (UTC +4:30) Afghanistan | +------------+----------------------------------------------------------------+ -| UM1 | (UTC - 1:00) Azores, Cape Verde Islands | +| UP5 | (UTC +5:00) Pakistan Standard Time, Yekaterinburg Time | +------------+----------------------------------------------------------------+ -| UTC | (UTC) Casablanca, Dublin, Edinburgh, London, Lisbon, Monrovia | +| UP55 | (UTC +5:30) Indian Standard Time, Sri Lanka Time | +------------+----------------------------------------------------------------+ -| UP1 | (UTC + 1:00) Berlin, Brussels, Copenhagen, Madrid, Paris, Rome | +| UP575 | (UTC +5:45) Nepal Time | +------------+----------------------------------------------------------------+ -| UP2 | (UTC + 2:00) Kaliningrad, South Africa, Warsaw | +| UP6 | (UTC +6:00) Bangladesh Standard Time, Bhutan Time, Omsk Time | +------------+----------------------------------------------------------------+ -| UP3 | (UTC + 3:00) Baghdad, Riyadh, Moscow, Nairobi | +| UP65 | (UTC +6:30) Cocos Islands, Myanmar | +------------+----------------------------------------------------------------+ -| UP25 | (UTC + 3:30) Tehran | +| UP7 | (UTC +7:00) Krasnoyarsk Time, Cambodia, Laos, Thailand, Vietnam| +------------+----------------------------------------------------------------+ -| UP4 | (UTC + 4:00) Adu Dhabi, Baku, Muscat, Tbilisi | +| UP8 | (UTC +8:00) Australian Western Standard Time, Beijing Time | +------------+----------------------------------------------------------------+ -| UP35 | (UTC + 4:30) Kabul | +| UP875 | (UTC +8:45) Australian Central Western Standard Time | +------------+----------------------------------------------------------------+ -| UP5 | (UTC + 5:00) Islamabad, Karachi, Tashkent | +| UP9 | (UTC +9:00) Japan Standard Time, Korea Standard Time, Yakutsk | +------------+----------------------------------------------------------------+ -| UP45 | (UTC + 5:30) Bombay, Calcutta, Madras, New Delhi | +| UP95 | (UTC +9:30) Australian Central Standard Time | +------------+----------------------------------------------------------------+ -| UP6 | (UTC + 6:00) Almaty, Colomba, Dhaka | +| UP10 | (UTC +10:00) Australian Eastern Standard Time, Vladivostok Time| +------------+----------------------------------------------------------------+ -| UP7 | (UTC + 7:00) Bangkok, Hanoi, Jakarta | +| UP105 | (UTC +10:30) Lord Howe Island | +------------+----------------------------------------------------------------+ -| UP8 | (UTC + 8:00) Beijing, Hong Kong, Perth, Singapore, Taipei | +| UP11 | (UTC +11:00) Magadan Time, Solomon Islands, Vanuatu | +------------+----------------------------------------------------------------+ -| UP9 | (UTC + 9:00) Osaka, Sapporo, Seoul, Tokyo, Yakutsk | +| UP115 | (UTC +11:30) Norfolk Island | +------------+----------------------------------------------------------------+ -| UP85 | (UTC + 9:30) Adelaide, Darwin | +| UP12 | (UTC +12:00) Fiji, Gilbert Islands, Kamchatka, New Zealand | +------------+----------------------------------------------------------------+ -| UP10 | (UTC + 10:00) Melbourne, Papua New Guinea, Sydney, Vladivostok | +| UP1275 | (UTC +12:45) Chatham Islands Standard Time | +------------+----------------------------------------------------------------+ -| UP11 | (UTC + 11:00) Magadan, New Caledonia, Solomon Islands | +| UP13 | (UTC +13:00) Phoenix Islands Time, Tonga | +------------+----------------------------------------------------------------+ -| UP12 | (UTC + 12:00) Auckland, Wellington, Fiji, Marshall Island | +| UP14 | (UTC +14:00) Line Islands | +------------+----------------------------------------------------------------+ -- cgit v1.2.3-24-g4f1b From df82e686b666253e2ca02f48ccc7e485657223eb Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 13 Feb 2012 01:09:28 +0200 Subject: Update the changelog --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index d14eea7a9..5d4e72bb5 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -52,6 +52,7 @@ Release Date: Not Released - Added dsn if the group connections in the config use PDO or any driver which need DSN. - Improved PDO database support. - Improved support of the Oracle (OCI8) driver, including: + - Added DSN string support (Easy Connect and TNS). - Added support for dropping tables to :doc:`Database Forge `. - Added support for listing database schemas to :doc:`Database Utilities `. - Generally improved for speed and cleaned up all of its components. -- cgit v1.2.3-24-g4f1b From 7efad20597ef7e06f8cf837a9f40918d2d3f2727 Mon Sep 17 00:00:00 2001 From: Jamie Rumbelow Date: Sun, 19 Feb 2012 12:37:00 +0000 Subject: Renaming Active Record to Query Builder across the system --- user_guide_src/source/database/active_record.rst | 1008 -------------------- user_guide_src/source/database/configuration.rst | 12 +- user_guide_src/source/database/connecting.rst | 2 +- user_guide_src/source/database/examples.rst | 8 +- user_guide_src/source/database/index.rst | 4 +- user_guide_src/source/database/queries.rst | 2 +- user_guide_src/source/database/query_builder.rst | 1008 ++++++++++++++++++++ user_guide_src/source/general/models.rst | 2 +- user_guide_src/source/helpers/directory_helper.rst | 2 +- user_guide_src/source/overview/features.rst | 2 +- .../source/tutorial/create_news_items.rst | 2 +- user_guide_src/source/tutorial/index.rst | 2 +- user_guide_src/source/tutorial/news_section.rst | 4 +- 13 files changed, 1029 insertions(+), 1029 deletions(-) delete mode 100644 user_guide_src/source/database/active_record.rst create mode 100644 user_guide_src/source/database/query_builder.rst (limited to 'user_guide_src') diff --git a/user_guide_src/source/database/active_record.rst b/user_guide_src/source/database/active_record.rst deleted file mode 100644 index c04e67d2a..000000000 --- a/user_guide_src/source/database/active_record.rst +++ /dev/null @@ -1,1008 +0,0 @@ -################### -Active Record Class -################### - -CodeIgniter uses a modified version of the Active Record Database -Pattern. This pattern allows information to be retrieved, inserted, and -updated in your database with minimal scripting. In some cases only one -or two lines of code are necessary to perform a database action. -CodeIgniter does not require that each database table be its own class -file. It instead provides a more simplified interface. - -Beyond simplicity, a major benefit to using the Active Record features -is that it allows you to create database independent applications, since -the query syntax is generated by each database adapter. It also allows -for safer queries, since the values are escaped automatically by the -system. - -.. note:: If you intend to write your own queries you can disable this - class in your database config file, allowing the core database library - and adapter to utilize fewer resources. - -.. contents:: Page Contents - -************** -Selecting Data -************** - -The following functions allow you to build SQL **SELECT** statements. - -$this->db->get() -================ - -Runs the selection query and returns the result. Can be used by itself -to retrieve all records from a table:: - - $query = $this->db->get('mytable'); // Produces: SELECT * FROM mytable - -The second and third parameters enable you to set a limit and offset -clause:: - - $query = $this->db->get('mytable', 10, 20); - // Produces: SELECT * FROM mytable LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax) - -You'll notice that the above function is assigned to a variable named -$query, which can be used to show the results:: - - $query = $this->db->get('mytable'); - - foreach ($query->result() as $row) - { - echo $row->title; - } - -Please visit the :doc:`result functions ` page for a full -discussion regarding result generation. - -$this->db->get_compiled_select() -================================ - -Compiles the selection query just like `$this->db->get()`_ but does not *run* -the query. This method simply returns the SQL query as a string. - -Example:: - - $sql = $this->db->get_compiled_select('mytable'); - echo $sql; - - // Produces string: SELECT * FROM mytable - -The second parameter enables you to set whether or not the active record query -will be reset (by default it will be—just like `$this->db->get()`):: - - echo $this->db->limit(10,20)->get_compiled_select('mytable', FALSE); - // Produces string: SELECT * FROM mytable LIMIT 20, 10 - // (in MySQL. Other databases have slightly different syntax) - - echo $this->db->select('title, content, date')->get_compiled_select(); - - // Produces string: SELECT title, content, date FROM mytable - -The key thing to notice in the above example is that the second query did not -utilize `$this->db->from()`_ and did not pass a table name into the first -parameter. The reason for this outcome is because the query has not been -executed using `$this->db->get()`_ which resets values or reset directly -using `$this->db->reset_query()`_. - - -$this->db->get_where() -====================== - -Identical to the above function except that it permits you to add a -"where" clause in the second parameter, instead of using the db->where() -function:: - - $query = $this->db->get_where('mytable', array('id' => $id), $limit, $offset); - -Please read the about the where function below for more information. - -.. note:: get_where() was formerly known as getwhere(), which has been removed - -$this->db->select() -=================== - -Permits you to write the SELECT portion of your query:: - - $this->db->select('title, content, date'); - $query = $this->db->get('mytable'); // Produces: SELECT title, content, date FROM mytable - - -.. note:: If you are selecting all (\*) from a table you do not need to - use this function. When omitted, CodeIgniter assumes you wish to SELECT * - -$this->db->select() accepts an optional second parameter. If you set it -to FALSE, CodeIgniter will not try to protect your field or table names -with backticks. This is useful if you need a compound select statement. - -:: - - $this->db->select('(SELECT SUM(payments.amount) FROM payments WHERE payments.invoice_id=4') AS amount_paid', FALSE); - $query = $this->db->get('mytable'); - - -$this->db->select_max() -======================= - -Writes a "SELECT MAX(field)" portion for your query. You can optionally -include a second parameter to rename the resulting field. - -:: - - $this->db->select_max('age'); - $query = $this->db->get('members'); // Produces: SELECT MAX(age) as age FROM members - - $this->db->select_max('age', 'member_age'); - $query = $this->db->get('members'); // Produces: SELECT MAX(age) as member_age FROM members - - -$this->db->select_min() -======================= - -Writes a "SELECT MIN(field)" portion for your query. As with -select_max(), You can optionally include a second parameter to rename -the resulting field. - -:: - - $this->db->select_min('age'); - $query = $this->db->get('members'); // Produces: SELECT MIN(age) as age FROM members - - -$this->db->select_avg() -======================= - -Writes a "SELECT AVG(field)" portion for your query. As with -select_max(), You can optionally include a second parameter to rename -the resulting field. - -:: - - $this->db->select_avg('age'); - $query = $this->db->get('members'); // Produces: SELECT AVG(age) as age FROM members - - -$this->db->select_sum() -======================= - -Writes a "SELECT SUM(field)" portion for your query. As with -select_max(), You can optionally include a second parameter to rename -the resulting field. - -:: - - $this->db->select_sum('age'); - $query = $this->db->get('members'); // Produces: SELECT SUM(age) as age FROM members - - -$this->db->from() -================= - -Permits you to write the FROM portion of your query:: - - $this->db->select('title, content, date'); - $this->db->from('mytable'); - $query = $this->db->get(); // Produces: SELECT title, content, date FROM mytable - -.. note:: As shown earlier, the FROM portion of your query can be specified - in the $this->db->get() function, so use whichever method you prefer. - -$this->db->join() -================= - -Permits you to write the JOIN portion of your query:: - - $this->db->select('*'); - $this->db->from('blogs'); - $this->db->join('comments', 'comments.id = blogs.id'); - $query = $this->db->get(); - - // Produces: - // SELECT * FROM blogs JOIN comments ON comments.id = blogs.id - -Multiple function calls can be made if you need several joins in one -query. - -If you need a specific type of JOIN you can specify it via the third -parameter of the function. Options are: left, right, outer, inner, left -outer, and right outer. - -:: - - $this->db->join('comments', 'comments.id = blogs.id', 'left'); - // Produces: LEFT JOIN comments ON comments.id = blogs.id - -$this->db->where() -================== - -This function enables you to set **WHERE** clauses using one of four -methods: - -.. note:: All values passed to this function are escaped automatically, - producing safer queries. - -#. **Simple key/value method:** - - :: - - $this->db->where('name', $name); // Produces: WHERE name = 'Joe' - - Notice that the equal sign is added for you. - - If you use multiple function calls they will be chained together with - AND between them: - - :: - - $this->db->where('name', $name); - $this->db->where('title', $title); - $this->db->where('status', $status); - // WHERE name = 'Joe' AND title = 'boss' AND status = 'active' - -#. **Custom key/value method:** - You can include an operator in the first parameter in order to - control the comparison: - - :: - - $this->db->where('name !=', $name); - $this->db->where('id <', $id); // Produces: WHERE name != 'Joe' AND id < 45 - -#. **Associative array method:** - - :: - - $array = array('name' => $name, 'title' => $title, 'status' => $status); - $this->db->where($array); - // Produces: WHERE name = 'Joe' AND title = 'boss' AND status = 'active' - - You can include your own operators using this method as well: - - :: - - $array = array('name !=' => $name, 'id <' => $id, 'date >' => $date); - $this->db->where($array); - -#. **Custom string:** - You can write your own clauses manually:: - - $where = "name='Joe' AND status='boss' OR status='active'"; - $this->db->where($where); - - -$this->db->where() accepts an optional third parameter. If you set it to -FALSE, CodeIgniter will not try to protect your field or table names -with backticks. - -:: - - $this->db->where('MATCH (field) AGAINST ("value")', NULL, FALSE); - - -$this->db->or_where() -===================== - -This function is identical to the one above, except that multiple -instances are joined by OR:: - - $this->db->where('name !=', $name); - $this->db->or_where('id >', $id); // Produces: WHERE name != 'Joe' OR id > 50 - -.. note:: or_where() was formerly known as orwhere(), which has been - removed. - -$this->db->where_in() -===================== - -Generates a WHERE field IN ('item', 'item') SQL query joined with AND if -appropriate - -:: - - $names = array('Frank', 'Todd', 'James'); - $this->db->where_in('username', $names); - // Produces: WHERE username IN ('Frank', 'Todd', 'James') - - -$this->db->or_where_in() -======================== - -Generates a WHERE field IN ('item', 'item') SQL query joined with OR if -appropriate - -:: - - $names = array('Frank', 'Todd', 'James'); - $this->db->or_where_in('username', $names); - // Produces: OR username IN ('Frank', 'Todd', 'James') - - -$this->db->where_not_in() -========================= - -Generates a WHERE field NOT IN ('item', 'item') SQL query joined with -AND if appropriate - -:: - - $names = array('Frank', 'Todd', 'James'); - $this->db->where_not_in('username', $names); - // Produces: WHERE username NOT IN ('Frank', 'Todd', 'James') - - -$this->db->or_where_not_in() -============================ - -Generates a WHERE field NOT IN ('item', 'item') SQL query joined with OR -if appropriate - -:: - - $names = array('Frank', 'Todd', 'James'); - $this->db->or_where_not_in('username', $names); - // Produces: OR username NOT IN ('Frank', 'Todd', 'James') - - -$this->db->like() -================= - -This function enables you to generate **LIKE** clauses, useful for doing -searches. - -.. note:: All values passed to this function are escaped automatically. - -#. **Simple key/value method:** - - :: - - $this->db->like('title', 'match'); // Produces: WHERE title LIKE '%match%' - - If you use multiple function calls they will be chained together with - AND between them:: - - $this->db->like('title', 'match'); - $this->db->like('body', 'match'); - // WHERE title LIKE '%match%' AND body LIKE '%match% - - If you want to control where the wildcard (%) is placed, you can use - an optional third argument. Your options are 'before', 'after' and - 'both' (which is the default). - - :: - - $this->db->like('title', 'match', 'before'); // Produces: WHERE title LIKE '%match' - $this->db->like('title', 'match', 'after'); // Produces: WHERE title LIKE 'match%' - $this->db->like('title', 'match', 'both'); // Produces: WHERE title LIKE '%match%' - -#. **Associative array method:** - - :: - - $array = array('title' => $match, 'page1' => $match, 'page2' => $match); - $this->db->like($array); - // WHERE title LIKE '%match%' AND page1 LIKE '%match%' AND page2 LIKE '%match%' - - -$this->db->or_like() -==================== - -This function is identical to the one above, except that multiple -instances are joined by OR:: - - $this->db->like('title', 'match'); $this->db->or_like('body', $match); - // WHERE title LIKE '%match%' OR body LIKE '%match%' - -.. note:: or_like() was formerly known as orlike(), which has been removed. - -$this->db->not_like() -===================== - -This function is identical to **like()**, except that it generates NOT -LIKE statements:: - - $this->db->not_like('title', 'match'); // WHERE title NOT LIKE '%match% - -$this->db->or_not_like() -======================== - -This function is identical to **not_like()**, except that multiple -instances are joined by OR:: - - $this->db->like('title', 'match'); - $this->db->or_not_like('body', 'match'); - // WHERE title LIKE '%match% OR body NOT LIKE '%match%' - -$this->db->group_by() -===================== - -Permits you to write the GROUP BY portion of your query:: - - $this->db->group_by("title"); // Produces: GROUP BY title - -You can also pass an array of multiple values as well:: - - $this->db->group_by(array("title", "date")); // Produces: GROUP BY title, date - -.. note:: group_by() was formerly known as groupby(), which has been - removed. - -$this->db->distinct() -===================== - -Adds the "DISTINCT" keyword to a query - -:: - - $this->db->distinct(); - $this->db->get('table'); // Produces: SELECT DISTINCT * FROM table - - -$this->db->having() -=================== - -Permits you to write the HAVING portion of your query. There are 2 -possible syntaxes, 1 argument or 2:: - - $this->db->having('user_id = 45'); // Produces: HAVING user_id = 45 - $this->db->having('user_id', 45); // Produces: HAVING user_id = 45 - -You can also pass an array of multiple values as well:: - - $this->db->having(array('title =' => 'My Title', 'id <' => $id)); - // Produces: HAVING title = 'My Title', id < 45 - - -If you are using a database that CodeIgniter escapes queries for, you -can prevent escaping content by passing an optional third argument, and -setting it to FALSE. - -:: - - $this->db->having('user_id', 45); // Produces: HAVING `user_id` = 45 in some databases such as MySQL - $this->db->having('user_id', 45, FALSE); // Produces: HAVING user_id = 45 - - -$this->db->or_having() -====================== - -Identical to having(), only separates multiple clauses with "OR". - -$this->db->order_by() -===================== - -Lets you set an ORDER BY clause. The first parameter contains the name -of the column you would like to order by. The second parameter lets you -set the direction of the result. Options are asc or desc, or random. - -:: - - $this->db->order_by("title", "desc"); // Produces: ORDER BY title DESC - -You can also pass your own string in the first parameter:: - - $this->db->order_by('title desc, name asc'); // Produces: ORDER BY title DESC, name ASC - -Or multiple function calls can be made if you need multiple fields. - -:: - - $this->db->order_by("title", "desc"); - $this->db->order_by("name", "asc"); // Produces: ORDER BY title DESC, name ASC - - -.. note:: order_by() was formerly known as orderby(), which has been - removed. - -.. note:: random ordering is not currently supported in Oracle or MSSQL - drivers. These will default to 'ASC'. - -$this->db->limit() -================== - -Lets you limit the number of rows you would like returned by the query:: - - $this->db->limit(10); // Produces: LIMIT 10 - -The second parameter lets you set a result offset. - -:: - - $this->db->limit(10, 20); // Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax) - -$this->db->count_all_results() -============================== - -Permits you to determine the number of rows in a particular Active -Record query. Queries will accept Active Record restrictors such as -where(), or_where(), like(), or_like(), etc. Example:: - - echo $this->db->count_all_results('my_table'); // Produces an integer, like 25 - $this->db->like('title', 'match'); - $this->db->from('my_table'); - echo $this->db->count_all_results(); // Produces an integer, like 17 - -$this->db->count_all() -====================== - -Permits you to determine the number of rows in a particular table. -Submit the table name in the first parameter. Example:: - - echo $this->db->count_all('my_table'); // Produces an integer, like 25 - -************** -Query grouping -************** - -Query grouping allows you to create groups of WHERE clauses by enclosing them in parentheses. This will allow -you to create queries with complex WHERE clauses. Nested groups are supported. Example: - - $this->db->select('*')->from('my_table') - ->group_start() - ->where('a', 'a') - ->or_group_start() - ->where('b', 'b') - ->where('c', 'c') - ->group_end() - ->group_end() - ->where('d', 'd') - ->get(); - - // Generates: - // SELECT * FROM (`my_table`) WHERE ( `a` = 'a' OR ( `b` = 'b' AND `c` = 'c' ) ) AND `d` = 'd' - -.. note:: groups need to be balanced, make sure every group_start() is matched by a group_end(). - -$this->db->group_start() -======================== - -Starts a new group by adding an opening parenthesis to the WHERE clause of the query. - -$this->db->or_group_start() -=========================== - -Starts a new group by adding an opening parenthesis to the WHERE clause of the query, prefixing it with 'OR'. - -$this->db->not_group_start() -============================ - -Starts a new group by adding an opening parenthesis to the WHERE clause of the query, prefixing it with 'NOT'. - -$this->db->or_not_group_start() -=============================== - -Starts a new group by adding an opening parenthesis to the WHERE clause of the query, prefixing it with 'OR NOT'. - -$this->db->group_end() -====================== - -Ends the current group by adding an closing parenthesis to the WHERE clause of the query. - -************** -Inserting Data -************** - -$this->db->insert() -=================== - -Generates an insert string based on the data you supply, and runs the -query. You can either pass an **array** or an **object** to the -function. Here is an example using an array:: - - $data = array( - 'title' => 'My title', - 'name' => 'My Name', - 'date' => 'My date' - ); - - $this->db->insert('mytable', $data); - // Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date') - -The first parameter will contain the table name, the second is an -associative array of values. - -Here is an example using an object:: - - /* - class Myclass { - var $title = 'My Title'; - var $content = 'My Content'; - var $date = 'My Date'; - } - */ - - $object = new Myclass; - $this->db->insert('mytable', $object); - // Produces: INSERT INTO mytable (title, content, date) VALUES ('My Title', 'My Content', 'My Date') - -The first parameter will contain the table name, the second is an -object. - -.. note:: All values are escaped automatically producing safer queries. - -$this->db->get_compiled_insert() -================================ -Compiles the insertion query just like `$this->db->insert()`_ but does not -*run* the query. This method simply returns the SQL query as a string. - -Example:: - - $data = array( - 'title' => 'My title', - 'name' => 'My Name', - 'date' => 'My date' - ); - - $sql = $this->db->set($data)->get_compiled_insert('mytable'); - echo $sql; - - // Produces string: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date') - -The second parameter enables you to set whether or not the active record query -will be reset (by default it will be--just like `$this->db->insert()`_):: - - echo $this->db->set('title', 'My Title')->get_compiled_insert('mytable', FALSE); - - // Produces string: INSERT INTO mytable (title) VALUES ('My Title') - - echo $this->db->set('content', 'My Content')->get_compiled_insert(); - - // Produces string: INSERT INTO mytable (title, content) VALUES ('My Title', 'My Content') - -The key thing to notice in the above example is that the second query did not -utlize `$this->db->from()`_ nor did it pass a table name into the first -parameter. The reason this worked is because the query has not been executed -using `$this->db->insert()`_ which resets values or reset directly using -`$this->db->reset_query()`_. - -$this->db->insert_batch() -========================= - -Generates an insert string based on the data you supply, and runs the -query. You can either pass an **array** or an **object** to the -function. Here is an example using an array:: - - $data = array( - array( - 'title' => 'My title', - 'name' => 'My Name', - 'date' => 'My date' - ), - array( - 'title' => 'Another title', - 'name' => 'Another Name', - 'date' => 'Another date' - ) - ); - - $this->db->insert_batch('mytable', $data); - // Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date'), ('Another title', 'Another name', 'Another date') - -The first parameter will contain the table name, the second is an -associative array of values. - -.. note:: All values are escaped automatically producing safer queries. - -$this->db->set() -================ - -This function enables you to set values for inserts or updates. - -**It can be used instead of passing a data array directly to the insert -or update functions:** - -:: - - $this->db->set('name', $name); - $this->db->insert('mytable'); // Produces: INSERT INTO mytable (name) VALUES ('{$name}') - -If you use multiple function called they will be assembled properly -based on whether you are doing an insert or an update:: - - $this->db->set('name', $name); - $this->db->set('title', $title); - $this->db->set('status', $status); - $this->db->insert('mytable'); - -**set()** will also accept an optional third parameter ($escape), that -will prevent data from being escaped if set to FALSE. To illustrate the -difference, here is set() used both with and without the escape -parameter. - -:: - - $this->db->set('field', 'field+1', FALSE); - $this->db->insert('mytable'); // gives INSERT INTO mytable (field) VALUES (field+1) - $this->db->set('field', 'field+1'); - $this->db->insert('mytable'); // gives INSERT INTO mytable (field) VALUES ('field+1') - - -You can also pass an associative array to this function:: - - $array = array( - 'name' => $name, - 'title' => $title, - 'status' => $status - ); - - $this->db->set($array); - $this->db->insert('mytable'); - -Or an object:: - - /* - class Myclass { - var $title = 'My Title'; - var $content = 'My Content'; - var $date = 'My Date'; - } - */ - - $object = new Myclass; - $this->db->set($object); - $this->db->insert('mytable'); - - -************* -Updating Data -************* - -$this->db->update() -=================== - -Generates an update string and runs the query based on the data you -supply. You can pass an **array** or an **object** to the function. Here -is an example using an array:: - - $data = array( - 'title' => $title, - 'name' => $name, - 'date' => $date - ); - - $this->db->where('id', $id); - $this->db->update('mytable', $data); - // Produces: // UPDATE mytable // SET title = '{$title}', name = '{$name}', date = '{$date}' // WHERE id = $id - -Or you can supply an object:: - - /* - class Myclass { - var $title = 'My Title'; - var $content = 'My Content'; - var $date = 'My Date'; - } - */ - - $object = new Myclass; - $this->db->where('id', $id); - $this->db->update('mytable', $object); - // Produces: // UPDATE mytable // SET title = '{$title}', name = '{$name}', date = '{$date}' // WHERE id = $id - -.. note:: All values are escaped automatically producing safer queries. - -You'll notice the use of the $this->db->where() function, enabling you -to set the WHERE clause. You can optionally pass this information -directly into the update function as a string:: - - $this->db->update('mytable', $data, "id = 4"); - -Or as an array:: - - $this->db->update('mytable', $data, array('id' => $id)); - -You may also use the $this->db->set() function described above when -performing updates. - -$this->db->update_batch() -========================= - -Generates an update string based on the data you supply, and runs the query. -You can either pass an **array** or an **object** to the function. -Here is an example using an array:: - - $data = array( - array( - 'title' => 'My title' , - 'name' => 'My Name 2' , - 'date' => 'My date 2' - ), - array( - 'title' => 'Another title' , - 'name' => 'Another Name 2' , - 'date' => 'Another date 2' - ) - ); - - $this->db->update_batch('mytable', $data, 'title'); - - // Produces: - // UPDATE `mytable` SET `name` = CASE - // WHEN `title` = 'My title' THEN 'My Name 2' - // WHEN `title` = 'Another title' THEN 'Another Name 2' - // ELSE `name` END, - // `date` = CASE - // WHEN `title` = 'My title' THEN 'My date 2' - // WHEN `title` = 'Another title' THEN 'Another date 2' - // ELSE `date` END - // WHERE `title` IN ('My title','Another title') - -The first parameter will contain the table name, the second is an associative -array of values, the third parameter is the where key. - -.. note:: All values are escaped automatically producing safer queries. - -$this->db->get_compiled_update() -================================ - -This works exactly the same way as ``$this->db->get_compiled_insert()`` except -that it produces an UPDATE SQL string instead of an INSERT SQL string. - -For more information view documentation for `$this->db->get_compiled_insert()`_. - - -************* -Deleting Data -************* - -$this->db->delete() -=================== - -Generates a delete SQL string and runs the query. - -:: - - $this->db->delete('mytable', array('id' => $id)); // Produces: // DELETE FROM mytable // WHERE id = $id - -The first parameter is the table name, the second is the where clause. -You can also use the where() or or_where() functions instead of passing -the data to the second parameter of the function:: - - $this->db->where('id', $id); - $this->db->delete('mytable'); - - // Produces: - // DELETE FROM mytable - // WHERE id = $id - - -An array of table names can be passed into delete() if you would like to -delete data from more than 1 table. - -:: - - $tables = array('table1', 'table2', 'table3'); - $this->db->where('id', '5'); - $this->db->delete($tables); - - -If you want to delete all data from a table, you can use the truncate() -function, or empty_table(). - -$this->db->empty_table() -======================== - -Generates a delete SQL string and runs the -query.:: - - $this->db->empty_table('mytable'); // Produces: DELETE FROM mytable - - -$this->db->truncate() -===================== - -Generates a truncate SQL string and runs the query. - -:: - - $this->db->from('mytable'); - $this->db->truncate(); - - // or - - $this->db->truncate('mytable'); - - // Produce: - // TRUNCATE mytable - -.. note:: If the TRUNCATE command isn't available, truncate() will - execute as "DELETE FROM table". - -$this->db->get_compiled_delete() -================================ -This works exactly the same way as ``$this->db->get_compiled_insert()`` except -that it produces a DELETE SQL string instead of an INSERT SQL string. - -For more information view documentation for `$this->db->get_compiled_insert()`_. - -*************** -Method Chaining -*************** - -Method chaining allows you to simplify your syntax by connecting -multiple functions. Consider this example:: - - $query = $this->db->select('title') - ->where('id', $id) - ->limit(10, 20) - ->get('mytable'); - -.. _ar-caching: - -********************* -Active Record Caching -********************* - -While not "true" caching, Active Record enables you to save (or "cache") -certain parts of your queries for reuse at a later point in your -script's execution. Normally, when an Active Record call is completed, -all stored information is reset for the next call. With caching, you can -prevent this reset, and reuse information easily. - -Cached calls are cumulative. If you make 2 cached select() calls, and -then 2 uncached select() calls, this will result in 4 select() calls. -There are three Caching functions available: - -$this->db->start_cache() -======================== - -This function must be called to begin caching. All Active Record queries -of the correct type (see below for supported queries) are stored for -later use. - -$this->db->stop_cache() -======================= - -This function can be called to stop caching. - -$this->db->flush_cache() -======================== - -This function deletes all items from the Active Record cache. - -Here's a usage example:: - - $this->db->start_cache(); - $this->db->select('field1'); - $this->db->stop_cache(); - $this->db->get('tablename'); - //Generates: SELECT `field1` FROM (`tablename`) - - $this->db->select('field2'); - $this->db->get('tablename'); - //Generates: SELECT `field1`, `field2` FROM (`tablename`) - - $this->db->flush_cache(); - $this->db->select('field2'); - $this->db->get('tablename'); - //Generates: SELECT `field2` FROM (`tablename`) - - -.. note:: The following statements can be cached: select, from, join, - where, like, group_by, having, order_by, set - - -$this->db->reset_query() -======================== - -Resetting Active Record allows you to start fresh with your query without -executing it first using a method like $this->db->get() or $this->db->insert(). -Just like the methods that execute a query, this will *not* reset items you've -cached using `Active Record Caching`_. - -This is useful in situations where you are using Active Record to generate SQL -(ex. ``$this->db->get_compiled_select()``) but then choose to, for instance, -run the query:: - - // Note that the second parameter of the get_compiled_select method is FALSE - $sql = $this->db->select(array('field1','field2')) - ->where('field3',5) - ->get_compiled_select('mytable', FALSE); - - // ... - // Do something crazy with the SQL code... like add it to a cron script for - // later execution or something... - // ... - - $data = $this->db->get()->result_array(); - - // Would execute and return an array of results of the following query: - // SELECT field1, field1 from mytable where field3 = 5; diff --git a/user_guide_src/source/database/configuration.rst b/user_guide_src/source/database/configuration.rst index 040e7e33f..953bbfbcb 100644 --- a/user_guide_src/source/database/configuration.rst +++ b/user_guide_src/source/database/configuration.rst @@ -106,18 +106,18 @@ Note: The name "test" is arbitrary. It can be anything you want. By default we've used the word "default" for the primary connection, but it too can be renamed to something more relevant to your project. -Active Record +Query Builder ------------- -The :doc:`Active Record Class ` is globally enabled or -disabled by setting the $active_record variable in the database +The :doc:`Query Builder Class ` is globally enabled or +disabled by setting the $query_builder variable in the database configuration file to TRUE/FALSE (boolean). If you are not using the -active record class, setting it to FALSE will utilize fewer resources +query builder class, setting it to FALSE will utilize fewer resources when the database classes are initialized. :: - $active_record = TRUE; + $query_builder = TRUE; .. note:: that some CodeIgniter classes such as Sessions require Active Records be enabled to access certain functionality. @@ -134,7 +134,7 @@ Explanation of Values: **database** The name of the database you want to connect to. **dbdriver** The database type. ie: mysql, postgres, odbc, etc. Must be specified in lower case. **dbprefix** An optional table prefix which will added to the table name when running :doc: - `Active Record ` queries. This permits multiple CodeIgniter installations + `Query Builder ` queries. This permits multiple CodeIgniter installations to share one database. **pconnect** TRUE/FALSE (boolean) - Whether to use a persistent connection. **db_debug** TRUE/FALSE (boolean) - Whether database errors should be displayed. diff --git a/user_guide_src/source/database/connecting.rst b/user_guide_src/source/database/connecting.rst index a834cc0f7..4db038e1e 100644 --- a/user_guide_src/source/database/connecting.rst +++ b/user_guide_src/source/database/connecting.rst @@ -36,7 +36,7 @@ Available Parameters string. #. TRUE/FALSE (boolean). Whether to return the connection ID (see Connecting to Multiple Databases below). -#. TRUE/FALSE (boolean). Whether to enable the Active Record class. Set +#. TRUE/FALSE (boolean). Whether to enable the Query Builder class. Set to TRUE by default. Manually Connecting to a Database diff --git a/user_guide_src/source/database/examples.rst b/user_guide_src/source/database/examples.rst index d1cd48837..8b3cc4701 100644 --- a/user_guide_src/source/database/examples.rst +++ b/user_guide_src/source/database/examples.rst @@ -104,10 +104,10 @@ Standard Insert $this->db->query($sql); echo $this->db->affected_rows(); -Active Record Query +Query Builder Query =================== -The :doc:`Active Record Pattern ` gives you a simplified +The :doc:`Query Builder Pattern ` gives you a simplified means of retrieving data:: $query = $this->db->get('table_name'); @@ -118,10 +118,10 @@ means of retrieving data:: } The above get() function retrieves all the results from the supplied -table. The :doc:`Active Record ` class contains a full +table. The :doc:`Query Builder ` class contains a full compliment of functions for working with data. -Active Record Insert +Query Builder Insert ==================== :: diff --git a/user_guide_src/source/database/index.rst b/user_guide_src/source/database/index.rst index ab12b7cb7..7ccb8fb00 100644 --- a/user_guide_src/source/database/index.rst +++ b/user_guide_src/source/database/index.rst @@ -3,7 +3,7 @@ The Database Class ################## CodeIgniter comes with a full-featured and very fast abstracted database -class that supports both traditional structures and Active Record +class that supports both traditional structures and Query Builder patterns. The database functions offer clear, simple syntax. .. toctree:: @@ -15,7 +15,7 @@ patterns. The database functions offer clear, simple syntax. Running Queries Generating Query Results Query Helper Functions - Active Record Class + Query Builder Class Transactions Table MetaData Field MetaData diff --git a/user_guide_src/source/database/queries.rst b/user_guide_src/source/database/queries.rst index 971d5d61d..2ba3d3f4a 100644 --- a/user_guide_src/source/database/queries.rst +++ b/user_guide_src/source/database/queries.rst @@ -50,7 +50,7 @@ Protecting identifiers ********************** In many databases it is advisable to protect table and field names - for -example with backticks in MySQL. **Active Record queries are +example with backticks in MySQL. **Query Builder queries are automatically protected**, however if you need to manually protect an identifier you can use:: diff --git a/user_guide_src/source/database/query_builder.rst b/user_guide_src/source/database/query_builder.rst new file mode 100644 index 000000000..f55d8e2f7 --- /dev/null +++ b/user_guide_src/source/database/query_builder.rst @@ -0,0 +1,1008 @@ +################### +Query Builder Class +################### + +CodeIgniter gives you access to a Query Builder class. This pattern +allows information to be retrieved, inserted, and updated in your +database with minimal scripting. In some cases only one or two lines +of code are necessary to perform a database action. +CodeIgniter does not require that each database table be its own class +file. It instead provides a more simplified interface. + +Beyond simplicity, a major benefit to using the Query Builder features +is that it allows you to create database independent applications, since +the query syntax is generated by each database adapter. It also allows +for safer queries, since the values are escaped automatically by the +system. + +.. note:: If you intend to write your own queries you can disable this + class in your database config file, allowing the core database library + and adapter to utilize fewer resources. + +.. contents:: Page Contents + +************** +Selecting Data +************** + +The following functions allow you to build SQL **SELECT** statements. + +$this->db->get() +================ + +Runs the selection query and returns the result. Can be used by itself +to retrieve all records from a table:: + + $query = $this->db->get('mytable'); // Produces: SELECT * FROM mytable + +The second and third parameters enable you to set a limit and offset +clause:: + + $query = $this->db->get('mytable', 10, 20); + // Produces: SELECT * FROM mytable LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax) + +You'll notice that the above function is assigned to a variable named +$query, which can be used to show the results:: + + $query = $this->db->get('mytable'); + + foreach ($query->result() as $row) + { + echo $row->title; + } + +Please visit the :doc:`result functions ` page for a full +discussion regarding result generation. + +$this->db->get_compiled_select() +================================ + +Compiles the selection query just like `$this->db->get()`_ but does not *run* +the query. This method simply returns the SQL query as a string. + +Example:: + + $sql = $this->db->get_compiled_select('mytable'); + echo $sql; + + // Produces string: SELECT * FROM mytable + +The second parameter enables you to set whether or not the query builder query +will be reset (by default it will be—just like `$this->db->get()`):: + + echo $this->db->limit(10,20)->get_compiled_select('mytable', FALSE); + // Produces string: SELECT * FROM mytable LIMIT 20, 10 + // (in MySQL. Other databases have slightly different syntax) + + echo $this->db->select('title, content, date')->get_compiled_select(); + + // Produces string: SELECT title, content, date FROM mytable + +The key thing to notice in the above example is that the second query did not +utilize `$this->db->from()`_ and did not pass a table name into the first +parameter. The reason for this outcome is because the query has not been +executed using `$this->db->get()`_ which resets values or reset directly +using `$this->db->reset_query()`_. + + +$this->db->get_where() +====================== + +Identical to the above function except that it permits you to add a +"where" clause in the second parameter, instead of using the db->where() +function:: + + $query = $this->db->get_where('mytable', array('id' => $id), $limit, $offset); + +Please read the about the where function below for more information. + +.. note:: get_where() was formerly known as getwhere(), which has been removed + +$this->db->select() +=================== + +Permits you to write the SELECT portion of your query:: + + $this->db->select('title, content, date'); + $query = $this->db->get('mytable'); // Produces: SELECT title, content, date FROM mytable + + +.. note:: If you are selecting all (\*) from a table you do not need to + use this function. When omitted, CodeIgniter assumes you wish to SELECT * + +$this->db->select() accepts an optional second parameter. If you set it +to FALSE, CodeIgniter will not try to protect your field or table names +with backticks. This is useful if you need a compound select statement. + +:: + + $this->db->select('(SELECT SUM(payments.amount) FROM payments WHERE payments.invoice_id=4') AS amount_paid', FALSE); + $query = $this->db->get('mytable'); + + +$this->db->select_max() +======================= + +Writes a "SELECT MAX(field)" portion for your query. You can optionally +include a second parameter to rename the resulting field. + +:: + + $this->db->select_max('age'); + $query = $this->db->get('members'); // Produces: SELECT MAX(age) as age FROM members + + $this->db->select_max('age', 'member_age'); + $query = $this->db->get('members'); // Produces: SELECT MAX(age) as member_age FROM members + + +$this->db->select_min() +======================= + +Writes a "SELECT MIN(field)" portion for your query. As with +select_max(), You can optionally include a second parameter to rename +the resulting field. + +:: + + $this->db->select_min('age'); + $query = $this->db->get('members'); // Produces: SELECT MIN(age) as age FROM members + + +$this->db->select_avg() +======================= + +Writes a "SELECT AVG(field)" portion for your query. As with +select_max(), You can optionally include a second parameter to rename +the resulting field. + +:: + + $this->db->select_avg('age'); + $query = $this->db->get('members'); // Produces: SELECT AVG(age) as age FROM members + + +$this->db->select_sum() +======================= + +Writes a "SELECT SUM(field)" portion for your query. As with +select_max(), You can optionally include a second parameter to rename +the resulting field. + +:: + + $this->db->select_sum('age'); + $query = $this->db->get('members'); // Produces: SELECT SUM(age) as age FROM members + + +$this->db->from() +================= + +Permits you to write the FROM portion of your query:: + + $this->db->select('title, content, date'); + $this->db->from('mytable'); + $query = $this->db->get(); // Produces: SELECT title, content, date FROM mytable + +.. note:: As shown earlier, the FROM portion of your query can be specified + in the $this->db->get() function, so use whichever method you prefer. + +$this->db->join() +================= + +Permits you to write the JOIN portion of your query:: + + $this->db->select('*'); + $this->db->from('blogs'); + $this->db->join('comments', 'comments.id = blogs.id'); + $query = $this->db->get(); + + // Produces: + // SELECT * FROM blogs JOIN comments ON comments.id = blogs.id + +Multiple function calls can be made if you need several joins in one +query. + +If you need a specific type of JOIN you can specify it via the third +parameter of the function. Options are: left, right, outer, inner, left +outer, and right outer. + +:: + + $this->db->join('comments', 'comments.id = blogs.id', 'left'); + // Produces: LEFT JOIN comments ON comments.id = blogs.id + +$this->db->where() +================== + +This function enables you to set **WHERE** clauses using one of four +methods: + +.. note:: All values passed to this function are escaped automatically, + producing safer queries. + +#. **Simple key/value method:** + + :: + + $this->db->where('name', $name); // Produces: WHERE name = 'Joe' + + Notice that the equal sign is added for you. + + If you use multiple function calls they will be chained together with + AND between them: + + :: + + $this->db->where('name', $name); + $this->db->where('title', $title); + $this->db->where('status', $status); + // WHERE name = 'Joe' AND title = 'boss' AND status = 'active' + +#. **Custom key/value method:** + You can include an operator in the first parameter in order to + control the comparison: + + :: + + $this->db->where('name !=', $name); + $this->db->where('id <', $id); // Produces: WHERE name != 'Joe' AND id < 45 + +#. **Associative array method:** + + :: + + $array = array('name' => $name, 'title' => $title, 'status' => $status); + $this->db->where($array); + // Produces: WHERE name = 'Joe' AND title = 'boss' AND status = 'active' + + You can include your own operators using this method as well: + + :: + + $array = array('name !=' => $name, 'id <' => $id, 'date >' => $date); + $this->db->where($array); + +#. **Custom string:** + You can write your own clauses manually:: + + $where = "name='Joe' AND status='boss' OR status='active'"; + $this->db->where($where); + + +$this->db->where() accepts an optional third parameter. If you set it to +FALSE, CodeIgniter will not try to protect your field or table names +with backticks. + +:: + + $this->db->where('MATCH (field) AGAINST ("value")', NULL, FALSE); + + +$this->db->or_where() +===================== + +This function is identical to the one above, except that multiple +instances are joined by OR:: + + $this->db->where('name !=', $name); + $this->db->or_where('id >', $id); // Produces: WHERE name != 'Joe' OR id > 50 + +.. note:: or_where() was formerly known as orwhere(), which has been + removed. + +$this->db->where_in() +===================== + +Generates a WHERE field IN ('item', 'item') SQL query joined with AND if +appropriate + +:: + + $names = array('Frank', 'Todd', 'James'); + $this->db->where_in('username', $names); + // Produces: WHERE username IN ('Frank', 'Todd', 'James') + + +$this->db->or_where_in() +======================== + +Generates a WHERE field IN ('item', 'item') SQL query joined with OR if +appropriate + +:: + + $names = array('Frank', 'Todd', 'James'); + $this->db->or_where_in('username', $names); + // Produces: OR username IN ('Frank', 'Todd', 'James') + + +$this->db->where_not_in() +========================= + +Generates a WHERE field NOT IN ('item', 'item') SQL query joined with +AND if appropriate + +:: + + $names = array('Frank', 'Todd', 'James'); + $this->db->where_not_in('username', $names); + // Produces: WHERE username NOT IN ('Frank', 'Todd', 'James') + + +$this->db->or_where_not_in() +============================ + +Generates a WHERE field NOT IN ('item', 'item') SQL query joined with OR +if appropriate + +:: + + $names = array('Frank', 'Todd', 'James'); + $this->db->or_where_not_in('username', $names); + // Produces: OR username NOT IN ('Frank', 'Todd', 'James') + + +$this->db->like() +================= + +This function enables you to generate **LIKE** clauses, useful for doing +searches. + +.. note:: All values passed to this function are escaped automatically. + +#. **Simple key/value method:** + + :: + + $this->db->like('title', 'match'); // Produces: WHERE title LIKE '%match%' + + If you use multiple function calls they will be chained together with + AND between them:: + + $this->db->like('title', 'match'); + $this->db->like('body', 'match'); + // WHERE title LIKE '%match%' AND body LIKE '%match% + + If you want to control where the wildcard (%) is placed, you can use + an optional third argument. Your options are 'before', 'after' and + 'both' (which is the default). + + :: + + $this->db->like('title', 'match', 'before'); // Produces: WHERE title LIKE '%match' + $this->db->like('title', 'match', 'after'); // Produces: WHERE title LIKE 'match%' + $this->db->like('title', 'match', 'both'); // Produces: WHERE title LIKE '%match%' + +#. **Associative array method:** + + :: + + $array = array('title' => $match, 'page1' => $match, 'page2' => $match); + $this->db->like($array); + // WHERE title LIKE '%match%' AND page1 LIKE '%match%' AND page2 LIKE '%match%' + + +$this->db->or_like() +==================== + +This function is identical to the one above, except that multiple +instances are joined by OR:: + + $this->db->like('title', 'match'); $this->db->or_like('body', $match); + // WHERE title LIKE '%match%' OR body LIKE '%match%' + +.. note:: or_like() was formerly known as orlike(), which has been removed. + +$this->db->not_like() +===================== + +This function is identical to **like()**, except that it generates NOT +LIKE statements:: + + $this->db->not_like('title', 'match'); // WHERE title NOT LIKE '%match% + +$this->db->or_not_like() +======================== + +This function is identical to **not_like()**, except that multiple +instances are joined by OR:: + + $this->db->like('title', 'match'); + $this->db->or_not_like('body', 'match'); + // WHERE title LIKE '%match% OR body NOT LIKE '%match%' + +$this->db->group_by() +===================== + +Permits you to write the GROUP BY portion of your query:: + + $this->db->group_by("title"); // Produces: GROUP BY title + +You can also pass an array of multiple values as well:: + + $this->db->group_by(array("title", "date")); // Produces: GROUP BY title, date + +.. note:: group_by() was formerly known as groupby(), which has been + removed. + +$this->db->distinct() +===================== + +Adds the "DISTINCT" keyword to a query + +:: + + $this->db->distinct(); + $this->db->get('table'); // Produces: SELECT DISTINCT * FROM table + + +$this->db->having() +=================== + +Permits you to write the HAVING portion of your query. There are 2 +possible syntaxes, 1 argument or 2:: + + $this->db->having('user_id = 45'); // Produces: HAVING user_id = 45 + $this->db->having('user_id', 45); // Produces: HAVING user_id = 45 + +You can also pass an array of multiple values as well:: + + $this->db->having(array('title =' => 'My Title', 'id <' => $id)); + // Produces: HAVING title = 'My Title', id < 45 + + +If you are using a database that CodeIgniter escapes queries for, you +can prevent escaping content by passing an optional third argument, and +setting it to FALSE. + +:: + + $this->db->having('user_id', 45); // Produces: HAVING `user_id` = 45 in some databases such as MySQL + $this->db->having('user_id', 45, FALSE); // Produces: HAVING user_id = 45 + + +$this->db->or_having() +====================== + +Identical to having(), only separates multiple clauses with "OR". + +$this->db->order_by() +===================== + +Lets you set an ORDER BY clause. The first parameter contains the name +of the column you would like to order by. The second parameter lets you +set the direction of the result. Options are asc or desc, or random. + +:: + + $this->db->order_by("title", "desc"); // Produces: ORDER BY title DESC + +You can also pass your own string in the first parameter:: + + $this->db->order_by('title desc, name asc'); // Produces: ORDER BY title DESC, name ASC + +Or multiple function calls can be made if you need multiple fields. + +:: + + $this->db->order_by("title", "desc"); + $this->db->order_by("name", "asc"); // Produces: ORDER BY title DESC, name ASC + + +.. note:: order_by() was formerly known as orderby(), which has been + removed. + +.. note:: random ordering is not currently supported in Oracle or MSSQL + drivers. These will default to 'ASC'. + +$this->db->limit() +================== + +Lets you limit the number of rows you would like returned by the query:: + + $this->db->limit(10); // Produces: LIMIT 10 + +The second parameter lets you set a result offset. + +:: + + $this->db->limit(10, 20); // Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax) + +$this->db->count_all_results() +============================== + +Permits you to determine the number of rows in a particular Active +Record query. Queries will accept Query Builder restrictors such as +where(), or_where(), like(), or_like(), etc. Example:: + + echo $this->db->count_all_results('my_table'); // Produces an integer, like 25 + $this->db->like('title', 'match'); + $this->db->from('my_table'); + echo $this->db->count_all_results(); // Produces an integer, like 17 + +$this->db->count_all() +====================== + +Permits you to determine the number of rows in a particular table. +Submit the table name in the first parameter. Example:: + + echo $this->db->count_all('my_table'); // Produces an integer, like 25 + +************** +Query grouping +************** + +Query grouping allows you to create groups of WHERE clauses by enclosing them in parentheses. This will allow +you to create queries with complex WHERE clauses. Nested groups are supported. Example: + + $this->db->select('*')->from('my_table') + ->group_start() + ->where('a', 'a') + ->or_group_start() + ->where('b', 'b') + ->where('c', 'c') + ->group_end() + ->group_end() + ->where('d', 'd') + ->get(); + + // Generates: + // SELECT * FROM (`my_table`) WHERE ( `a` = 'a' OR ( `b` = 'b' AND `c` = 'c' ) ) AND `d` = 'd' + +.. note:: groups need to be balanced, make sure every group_start() is matched by a group_end(). + +$this->db->group_start() +======================== + +Starts a new group by adding an opening parenthesis to the WHERE clause of the query. + +$this->db->or_group_start() +=========================== + +Starts a new group by adding an opening parenthesis to the WHERE clause of the query, prefixing it with 'OR'. + +$this->db->not_group_start() +============================ + +Starts a new group by adding an opening parenthesis to the WHERE clause of the query, prefixing it with 'NOT'. + +$this->db->or_not_group_start() +=============================== + +Starts a new group by adding an opening parenthesis to the WHERE clause of the query, prefixing it with 'OR NOT'. + +$this->db->group_end() +====================== + +Ends the current group by adding an closing parenthesis to the WHERE clause of the query. + +************** +Inserting Data +************** + +$this->db->insert() +=================== + +Generates an insert string based on the data you supply, and runs the +query. You can either pass an **array** or an **object** to the +function. Here is an example using an array:: + + $data = array( + 'title' => 'My title', + 'name' => 'My Name', + 'date' => 'My date' + ); + + $this->db->insert('mytable', $data); + // Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date') + +The first parameter will contain the table name, the second is an +associative array of values. + +Here is an example using an object:: + + /* + class Myclass { + var $title = 'My Title'; + var $content = 'My Content'; + var $date = 'My Date'; + } + */ + + $object = new Myclass; + $this->db->insert('mytable', $object); + // Produces: INSERT INTO mytable (title, content, date) VALUES ('My Title', 'My Content', 'My Date') + +The first parameter will contain the table name, the second is an +object. + +.. note:: All values are escaped automatically producing safer queries. + +$this->db->get_compiled_insert() +================================ +Compiles the insertion query just like `$this->db->insert()`_ but does not +*run* the query. This method simply returns the SQL query as a string. + +Example:: + + $data = array( + 'title' => 'My title', + 'name' => 'My Name', + 'date' => 'My date' + ); + + $sql = $this->db->set($data)->get_compiled_insert('mytable'); + echo $sql; + + // Produces string: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date') + +The second parameter enables you to set whether or not the query builder query +will be reset (by default it will be--just like `$this->db->insert()`_):: + + echo $this->db->set('title', 'My Title')->get_compiled_insert('mytable', FALSE); + + // Produces string: INSERT INTO mytable (title) VALUES ('My Title') + + echo $this->db->set('content', 'My Content')->get_compiled_insert(); + + // Produces string: INSERT INTO mytable (title, content) VALUES ('My Title', 'My Content') + +The key thing to notice in the above example is that the second query did not +utlize `$this->db->from()`_ nor did it pass a table name into the first +parameter. The reason this worked is because the query has not been executed +using `$this->db->insert()`_ which resets values or reset directly using +`$this->db->reset_query()`_. + +$this->db->insert_batch() +========================= + +Generates an insert string based on the data you supply, and runs the +query. You can either pass an **array** or an **object** to the +function. Here is an example using an array:: + + $data = array( + array( + 'title' => 'My title', + 'name' => 'My Name', + 'date' => 'My date' + ), + array( + 'title' => 'Another title', + 'name' => 'Another Name', + 'date' => 'Another date' + ) + ); + + $this->db->insert_batch('mytable', $data); + // Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date'), ('Another title', 'Another name', 'Another date') + +The first parameter will contain the table name, the second is an +associative array of values. + +.. note:: All values are escaped automatically producing safer queries. + +$this->db->set() +================ + +This function enables you to set values for inserts or updates. + +**It can be used instead of passing a data array directly to the insert +or update functions:** + +:: + + $this->db->set('name', $name); + $this->db->insert('mytable'); // Produces: INSERT INTO mytable (name) VALUES ('{$name}') + +If you use multiple function called they will be assembled properly +based on whether you are doing an insert or an update:: + + $this->db->set('name', $name); + $this->db->set('title', $title); + $this->db->set('status', $status); + $this->db->insert('mytable'); + +**set()** will also accept an optional third parameter ($escape), that +will prevent data from being escaped if set to FALSE. To illustrate the +difference, here is set() used both with and without the escape +parameter. + +:: + + $this->db->set('field', 'field+1', FALSE); + $this->db->insert('mytable'); // gives INSERT INTO mytable (field) VALUES (field+1) + $this->db->set('field', 'field+1'); + $this->db->insert('mytable'); // gives INSERT INTO mytable (field) VALUES ('field+1') + + +You can also pass an associative array to this function:: + + $array = array( + 'name' => $name, + 'title' => $title, + 'status' => $status + ); + + $this->db->set($array); + $this->db->insert('mytable'); + +Or an object:: + + /* + class Myclass { + var $title = 'My Title'; + var $content = 'My Content'; + var $date = 'My Date'; + } + */ + + $object = new Myclass; + $this->db->set($object); + $this->db->insert('mytable'); + + +************* +Updating Data +************* + +$this->db->update() +=================== + +Generates an update string and runs the query based on the data you +supply. You can pass an **array** or an **object** to the function. Here +is an example using an array:: + + $data = array( + 'title' => $title, + 'name' => $name, + 'date' => $date + ); + + $this->db->where('id', $id); + $this->db->update('mytable', $data); + // Produces: // UPDATE mytable // SET title = '{$title}', name = '{$name}', date = '{$date}' // WHERE id = $id + +Or you can supply an object:: + + /* + class Myclass { + var $title = 'My Title'; + var $content = 'My Content'; + var $date = 'My Date'; + } + */ + + $object = new Myclass; + $this->db->where('id', $id); + $this->db->update('mytable', $object); + // Produces: // UPDATE mytable // SET title = '{$title}', name = '{$name}', date = '{$date}' // WHERE id = $id + +.. note:: All values are escaped automatically producing safer queries. + +You'll notice the use of the $this->db->where() function, enabling you +to set the WHERE clause. You can optionally pass this information +directly into the update function as a string:: + + $this->db->update('mytable', $data, "id = 4"); + +Or as an array:: + + $this->db->update('mytable', $data, array('id' => $id)); + +You may also use the $this->db->set() function described above when +performing updates. + +$this->db->update_batch() +========================= + +Generates an update string based on the data you supply, and runs the query. +You can either pass an **array** or an **object** to the function. +Here is an example using an array:: + + $data = array( + array( + 'title' => 'My title' , + 'name' => 'My Name 2' , + 'date' => 'My date 2' + ), + array( + 'title' => 'Another title' , + 'name' => 'Another Name 2' , + 'date' => 'Another date 2' + ) + ); + + $this->db->update_batch('mytable', $data, 'title'); + + // Produces: + // UPDATE `mytable` SET `name` = CASE + // WHEN `title` = 'My title' THEN 'My Name 2' + // WHEN `title` = 'Another title' THEN 'Another Name 2' + // ELSE `name` END, + // `date` = CASE + // WHEN `title` = 'My title' THEN 'My date 2' + // WHEN `title` = 'Another title' THEN 'Another date 2' + // ELSE `date` END + // WHERE `title` IN ('My title','Another title') + +The first parameter will contain the table name, the second is an associative +array of values, the third parameter is the where key. + +.. note:: All values are escaped automatically producing safer queries. + +$this->db->get_compiled_update() +================================ + +This works exactly the same way as ``$this->db->get_compiled_insert()`` except +that it produces an UPDATE SQL string instead of an INSERT SQL string. + +For more information view documentation for `$this->db->get_compiled_insert()`_. + + +************* +Deleting Data +************* + +$this->db->delete() +=================== + +Generates a delete SQL string and runs the query. + +:: + + $this->db->delete('mytable', array('id' => $id)); // Produces: // DELETE FROM mytable // WHERE id = $id + +The first parameter is the table name, the second is the where clause. +You can also use the where() or or_where() functions instead of passing +the data to the second parameter of the function:: + + $this->db->where('id', $id); + $this->db->delete('mytable'); + + // Produces: + // DELETE FROM mytable + // WHERE id = $id + + +An array of table names can be passed into delete() if you would like to +delete data from more than 1 table. + +:: + + $tables = array('table1', 'table2', 'table3'); + $this->db->where('id', '5'); + $this->db->delete($tables); + + +If you want to delete all data from a table, you can use the truncate() +function, or empty_table(). + +$this->db->empty_table() +======================== + +Generates a delete SQL string and runs the +query.:: + + $this->db->empty_table('mytable'); // Produces: DELETE FROM mytable + + +$this->db->truncate() +===================== + +Generates a truncate SQL string and runs the query. + +:: + + $this->db->from('mytable'); + $this->db->truncate(); + + // or + + $this->db->truncate('mytable'); + + // Produce: + // TRUNCATE mytable + +.. note:: If the TRUNCATE command isn't available, truncate() will + execute as "DELETE FROM table". + +$this->db->get_compiled_delete() +================================ +This works exactly the same way as ``$this->db->get_compiled_insert()`` except +that it produces a DELETE SQL string instead of an INSERT SQL string. + +For more information view documentation for `$this->db->get_compiled_insert()`_. + +*************** +Method Chaining +*************** + +Method chaining allows you to simplify your syntax by connecting +multiple functions. Consider this example:: + + $query = $this->db->select('title') + ->where('id', $id) + ->limit(10, 20) + ->get('mytable'); + +.. _ar-caching: + +********************* +Query Builder Caching +********************* + +While not "true" caching, Query Builder enables you to save (or "cache") +certain parts of your queries for reuse at a later point in your +script's execution. Normally, when an Query Builder call is completed, +all stored information is reset for the next call. With caching, you can +prevent this reset, and reuse information easily. + +Cached calls are cumulative. If you make 2 cached select() calls, and +then 2 uncached select() calls, this will result in 4 select() calls. +There are three Caching functions available: + +$this->db->start_cache() +======================== + +This function must be called to begin caching. All Query Builder queries +of the correct type (see below for supported queries) are stored for +later use. + +$this->db->stop_cache() +======================= + +This function can be called to stop caching. + +$this->db->flush_cache() +======================== + +This function deletes all items from the Query Builder cache. + +Here's a usage example:: + + $this->db->start_cache(); + $this->db->select('field1'); + $this->db->stop_cache(); + $this->db->get('tablename'); + //Generates: SELECT `field1` FROM (`tablename`) + + $this->db->select('field2'); + $this->db->get('tablename'); + //Generates: SELECT `field1`, `field2` FROM (`tablename`) + + $this->db->flush_cache(); + $this->db->select('field2'); + $this->db->get('tablename'); + //Generates: SELECT `field2` FROM (`tablename`) + + +.. note:: The following statements can be cached: select, from, join, + where, like, group_by, having, order_by, set + + +$this->db->reset_query() +======================== + +Resetting Query Builder allows you to start fresh with your query without +executing it first using a method like $this->db->get() or $this->db->insert(). +Just like the methods that execute a query, this will *not* reset items you've +cached using `Query Builder Caching`_. + +This is useful in situations where you are using Query Builder to generate SQL +(ex. ``$this->db->get_compiled_select()``) but then choose to, for instance, +run the query:: + + // Note that the second parameter of the get_compiled_select method is FALSE + $sql = $this->db->select(array('field1','field2')) + ->where('field3',5) + ->get_compiled_select('mytable', FALSE); + + // ... + // Do something crazy with the SQL code... like add it to a cron script for + // later execution or something... + // ... + + $data = $this->db->get()->result_array(); + + // Would execute and return an array of results of the following query: + // SELECT field1, field1 from mytable where field3 = 5; diff --git a/user_guide_src/source/general/models.rst b/user_guide_src/source/general/models.rst index b816f958a..0156b0460 100644 --- a/user_guide_src/source/general/models.rst +++ b/user_guide_src/source/general/models.rst @@ -55,7 +55,7 @@ model class might look like:: } .. note:: The functions in the above example use the :doc:`Active - Record <../database/active_record>` database functions. + Record <../database/query_builder>` database functions. .. note:: For the sake of simplicity in this example we're using $_POST directly. This is generally bad practice, and a more common approach diff --git a/user_guide_src/source/helpers/directory_helper.rst b/user_guide_src/source/helpers/directory_helper.rst index fd169886c..cf88732d3 100644 --- a/user_guide_src/source/helpers/directory_helper.rst +++ b/user_guide_src/source/helpers/directory_helper.rst @@ -59,7 +59,7 @@ be numerically indexed. Here is an example of a typical array:: [1] => config.html         [database] => Array (               - [0] => active_record.html               + [0] => query_builder.html               [1] => binds.html               [2] => configuration.html [3] => connecting.html               diff --git a/user_guide_src/source/overview/features.rst b/user_guide_src/source/overview/features.rst index 44db08a94..8c27b1436 100644 --- a/user_guide_src/source/overview/features.rst +++ b/user_guide_src/source/overview/features.rst @@ -15,7 +15,7 @@ CodeIgniter's main features. - Model-View-Controller Based System - Extremely Light Weight - Full Featured database classes with support for several platforms. -- Active Record Database Support +- Query Builder Database Support - Form and Data Validation - Security and XSS Filtering - Session Management diff --git a/user_guide_src/source/tutorial/create_news_items.rst b/user_guide_src/source/tutorial/create_news_items.rst index 794b67eed..bfaf13537 100644 --- a/user_guide_src/source/tutorial/create_news_items.rst +++ b/user_guide_src/source/tutorial/create_news_items.rst @@ -94,7 +94,7 @@ Model ----- The only thing that remains is writing a method that writes the data to -the database. You'll use the Active Record class to insert the +the database. You'll use the Query Builder class to insert the information and use the input library to get the posted data. Open up the model created earlier and add the following: diff --git a/user_guide_src/source/tutorial/index.rst b/user_guide_src/source/tutorial/index.rst index c959d04d2..b1ab331d1 100644 --- a/user_guide_src/source/tutorial/index.rst +++ b/user_guide_src/source/tutorial/index.rst @@ -16,7 +16,7 @@ This tutorial will primarily focus on: - Model-View-Controller basics - Routing basics - Form validation -- Performing basic database queries using "Active Record" +- Performing basic database queries using "Query Builder" The entire tutorial is split up over several pages, each explaining a small part of the functionality of the CodeIgniter framework. You'll go diff --git a/user_guide_src/source/tutorial/news_section.rst b/user_guide_src/source/tutorial/news_section.rst index 38e4214ca..82b3e3b38 100644 --- a/user_guide_src/source/tutorial/news_section.rst +++ b/user_guide_src/source/tutorial/news_section.rst @@ -54,7 +54,7 @@ seed records. Now that the database and a model have been set up, you'll need a method to get all of our posts from our database. To do this, the database abstraction layer that is included with CodeIgniter — `Active -Record <../database/active_record.html>`_ — is used. This makes it +Record <../database/query_builder.html>`_ — is used. This makes it possible to write your 'queries' once and make them work on `all supported database systems <../general/requirements.html>`_. Add the following code to your model. @@ -76,7 +76,7 @@ following code to your model. With this code you can perform two different queries. You can get all news records, or get a news item by its `slug <#>`_. You might have noticed that the $slug variable wasn't sanitized before running the -query; Active Record does this for you. +query; Query Builder does this for you. Display the news ---------------- -- cgit v1.2.3-24-g4f1b From d48f30d1f28fb70d6e06bc4c9607993a991e4c42 Mon Sep 17 00:00:00 2001 From: Jamie Rumbelow Date: Sun, 19 Feb 2012 12:39:03 +0000 Subject: Adding the change to the release notes --- user_guide_src/source/changelog.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index a4904fceb..5ad3c3cbc 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -42,7 +42,9 @@ Release Date: Not Released - Database - - Added new :doc:`Active Record ` methods that return + - Renamed the Active Record class to Query Builder to remove confusion with + the Active Record design pattern + - Added new :doc:`Query Builder ` methods that return the SQL string of queries without executing them: get_compiled_select(), get_compiled_insert(), get_compiled_update(), get_compiled_delete(). - Taking care of LIKE condition when used with MySQL UPDATE statement. -- cgit v1.2.3-24-g4f1b From 08c7c62b57b0d6d8f126e8629b8e8da71bd9636f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 28 Feb 2012 13:23:38 +0200 Subject: Fix escape_like_str() --- user_guide_src/source/changelog.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index d5125591c..15b531665 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -114,8 +114,9 @@ Bug fixes for 3.0 - Fixed a possible bug in ``CI_Input::is_ajax_request()`` where some clients might not send the X-Requested-With HTTP header value exactly as 'XmlHttpRequest'. - Fixed a bug (#1039) - MySQL's _backup() method failed due to a table name not being escaped. - Fixed a bug (#1070) - CI_DB_driver::initialize() didn't set a character set if a database is not selected. -- Fixed a bug in the Oracle (oci8) instance of :doc:`Database Forge Class ` where ``create_table()`` would fail if used with ``AUTO_INCREMENT`` as it's not supported by Oracle. -- Fixed a bug (#413) - The Oracle (oci8) database driver only used to return connection-related errors in `_error_message()` and `_error_number()`. +- Fixed a bug in the Oracle (oci8) instance of :doc:`Database Forge Class ` where create_table() would fail if used with AUTO_INCREMENT as it's not supported by Oracle. +- Fixed a bug (#413) - The Oracle (oci8) database driver only used to return connection-related errors in _error_message() and _error_number(). +- Fixed a bug (#68, #414) - Oracle's escape_like_str() didn't properly escape the LIKE wild characters. Version 2.1.0 ============= -- cgit v1.2.3-24-g4f1b From 4c4740ec492b30aeb47cb1829525247053e4adfe Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 12 Mar 2012 16:09:15 +0200 Subject: Postgre to Postgres --- user_guide_src/source/database/configuration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/database/configuration.rst b/user_guide_src/source/database/configuration.rst index a58492ccc..040e7e33f 100644 --- a/user_guide_src/source/database/configuration.rst +++ b/user_guide_src/source/database/configuration.rst @@ -167,7 +167,7 @@ Explanation of Values: ====================== ================================================================================================== .. note:: Depending on what database platform you are using (MySQL, - Postgre, etc.) not all values will be needed. For example, when using + Postgres, etc.) not all values will be needed. For example, when using SQLite you will not need to supply a username or password, and the database name will be the path to your database file. The information above assumes you are using MySQL. -- cgit v1.2.3-24-g4f1b From 2f3beb258aa291155610579d86a2277d31ce323c Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 12 Mar 2012 16:34:15 +0200 Subject: Postgres to PostgreSQL --- user_guide_src/source/database/configuration.rst | 12 ++++++------ user_guide_src/source/general/requirements.rst | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/database/configuration.rst b/user_guide_src/source/database/configuration.rst index 040e7e33f..3f3bae336 100644 --- a/user_guide_src/source/database/configuration.rst +++ b/user_guide_src/source/database/configuration.rst @@ -132,7 +132,7 @@ Explanation of Values: **username** The username used to connect to the database. **password** The password used to connect to the database. **database** The name of the database you want to connect to. -**dbdriver** The database type. ie: mysql, postgres, odbc, etc. Must be specified in lower case. +**dbdriver** The database type. ie: mysql, postgre, odbc, etc. Must be specified in lower case. **dbprefix** An optional table prefix which will added to the table name when running :doc: `Active Record ` queries. This permits multiple CodeIgniter installations to share one database. @@ -166,8 +166,8 @@ Explanation of Values: $db['default']['port'] = 5432; ====================== ================================================================================================== -.. note:: Depending on what database platform you are using (MySQL, - Postgres, etc.) not all values will be needed. For example, when using - SQLite you will not need to supply a username or password, and the - database name will be the path to your database file. The information - above assumes you are using MySQL. +.. note:: Depending on what database platform you are using (MySQL, PostgreSQL, + etc.) not all values will be needed. For example, when using SQLite you + will not need to supply a username or password, and the database name + will be the path to your database file. The information above assumes + you are using MySQL. diff --git a/user_guide_src/source/general/requirements.rst b/user_guide_src/source/general/requirements.rst index 54d243b6c..b46733c1d 100644 --- a/user_guide_src/source/general/requirements.rst +++ b/user_guide_src/source/general/requirements.rst @@ -4,5 +4,5 @@ Server Requirements - `PHP `_ version 5.2.4 or newer. - A Database is required for most web application programming. Current - supported databases are MySQL (5.1+), MySQLi, MS SQL, Postgres, Oracle, - SQLite, SQLite3, ODBC and CUBRID. + supported databases are MySQL (5.1+), MySQLi, MS SQL, PostgreSQL, + Oracle, SQLite, SQLite3, ODBC and CUBRID. -- cgit v1.2.3-24-g4f1b From 5a98a3dda56f6167f8241a7bc7d1c8784d98ccf9 Mon Sep 17 00:00:00 2001 From: Matteo Mattei Date: Thu, 15 Mar 2012 12:00:44 +0100 Subject: Email class: move string_attach() to attach() and add documentation --- user_guide_src/source/libraries/email.rst | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/libraries/email.rst b/user_guide_src/source/libraries/email.rst index 27b704dae..d05439a77 100644 --- a/user_guide_src/source/libraries/email.rst +++ b/user_guide_src/source/libraries/email.rst @@ -228,10 +228,18 @@ use the function multiple times. For example:: $this->email->attach('/path/to/photo2.jpg'); $this->email->attach('/path/to/photo3.jpg'); -If you'd like to change the disposition or add a custom file name, you can use the second and third paramaters. To use the default disposition (attachment), leave the second parameter blank. Here's an example:: +$filename, $str = '', $mime = '', $disposition = '', $newname = NULL +If you need to use a buffer string instead of a real (physical) file you can use the +second and third parameters that are respectively the buffer and the mime-type:: + + $this->email->attach('report.pdf', $buffer, 'application/pdf'); + +If you'd like to change the disposition or add a custom file name, you can use the +fourth and fifth paramaters. To use the default disposition (attachment), leave the +fourth parameter blank. Here's an example:: - $this->email->attach('/path/to/photo1.jpg', 'inline'); - $this->email->attach('/path/to/photo1.jpg', '', 'birthday.jpg'); + $this->email->attach('/path/to/photo1.jpg', '', '', 'inline'); + $this->email->attach('/path/to/photo1.jpg', '', '', '', 'birthday.jpg'); $this->email->print_debugger() -- cgit v1.2.3-24-g4f1b From df59c687a2243142e6da9d7b904523a1b91ca09b Mon Sep 17 00:00:00 2001 From: Matteo Mattei Date: Thu, 15 Mar 2012 16:03:58 +0100 Subject: Email class: adjust documentation and make the code backward compatible --- user_guide_src/source/libraries/email.rst | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/libraries/email.rst b/user_guide_src/source/libraries/email.rst index d05439a77..2be50fd35 100644 --- a/user_guide_src/source/libraries/email.rst +++ b/user_guide_src/source/libraries/email.rst @@ -228,19 +228,18 @@ use the function multiple times. For example:: $this->email->attach('/path/to/photo2.jpg'); $this->email->attach('/path/to/photo3.jpg'); -$filename, $str = '', $mime = '', $disposition = '', $newname = NULL +To use the default disposition (attachment), leave the second parameter blank. If you need to use a buffer string instead of a real (physical) file you can use the -second and third parameters that are respectively the buffer and the mime-type:: +third and fourth parameters that are respectively the buffer and the mime-type:: - $this->email->attach('report.pdf', $buffer, 'application/pdf'); + $this->email->attach('report.pdf', 'inline', $buffer, 'application/pdf'); -If you'd like to change the disposition or add a custom file name, you can use the -fourth and fifth paramaters. To use the default disposition (attachment), leave the -fourth parameter blank. Here's an example:: +If you'd like to add a custom file name, you can use the fifth paramaters. +Here's an example:: - $this->email->attach('/path/to/photo1.jpg', '', '', 'inline'); + $this->email->attach('/path/to/photo1.jpg', '', '', '', 'inline'); $this->email->attach('/path/to/photo1.jpg', '', '', '', 'birthday.jpg'); - + $this->email->print_debugger() ------------------------------- -- cgit v1.2.3-24-g4f1b From 13707203a18785476948202a32c8d9eeae5a1676 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 00:13:06 +0200 Subject: Changelog --- user_guide_src/source/changelog.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 6d596a4a1..f50d284a9 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -56,8 +56,10 @@ Release Date: Not Released get_compiled_insert(), get_compiled_update(), get_compiled_delete(). - Taking care of LIKE condition when used with MySQL UPDATE statement. - Adding $escape parameter to the order_by function, this enables ordering by custom fields. - - MySQLi driver now uses mysqli_get_server_info() for server version checking. - - MySQLi driver now supports persistent connections when running on PHP >= 5.3. + - Improved support for the MySQLi driver, including: + - OOP style of the PHP extension is now used, instead of the procedural aliases. + - Server version checking is now done via ``mysqli::$server_info`` instead of running an SQL query. + - Added persistent connections support for PHP >= 5.3. - Added dsn if the group connections in the config use PDO or any driver which need DSN. - Improved PDO database support. - Added Interbase/Firebird database support via the "interbase" driver -- cgit v1.2.3-24-g4f1b From c3b36f4c6b8e8b15c96d6653ebdf07c76eb57d9e Mon Sep 17 00:00:00 2001 From: Matteo Mattei Date: Mon, 26 Mar 2012 10:27:17 +0200 Subject: Centralize handling of attach() function for both real file and buffer string. Update documentation. --- user_guide_src/source/libraries/email.rst | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/libraries/email.rst b/user_guide_src/source/libraries/email.rst index 2be50fd35..19c2706d9 100644 --- a/user_guide_src/source/libraries/email.rst +++ b/user_guide_src/source/libraries/email.rst @@ -228,18 +228,20 @@ use the function multiple times. For example:: $this->email->attach('/path/to/photo2.jpg'); $this->email->attach('/path/to/photo3.jpg'); -To use the default disposition (attachment), leave the second parameter blank. -If you need to use a buffer string instead of a real (physical) file you can use the -third and fourth parameters that are respectively the buffer and the mime-type:: +To use the default disposition (attachment), leave the second parameter blank, +otherwise use a custom disposition:: - $this->email->attach('report.pdf', 'inline', $buffer, 'application/pdf'); + $this->email->attach('image.jpg', 'inline'); -If you'd like to add a custom file name, you can use the fifth paramaters. -Here's an example:: - - $this->email->attach('/path/to/photo1.jpg', '', '', '', 'inline'); - $this->email->attach('/path/to/photo1.jpg', '', '', '', 'birthday.jpg'); +If you'd like to use a custom file name, you can use the third paramater:: + $this->email->attach('filename.pdf', 'attachment', 'report.pdf'); + +If you need to use a buffer string instead of a real - physical - file you can +use the first parameter as buffer, the third parameter as file name and the fourth +parameter as mime-type:: + + $this->email->attach($buffer, 'attachment', 'report.pdf', 'application/pdf'); $this->email->print_debugger() ------------------------------- -- cgit v1.2.3-24-g4f1b From a11b16b1af42bbb4ffbc15eeee50a3d3ceb402d5 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 28 Mar 2012 12:22:04 +0300 Subject: Fix a CI_Loader::_ci_load_class() bug --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index b4bf0cfaa..4703190a9 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -172,6 +172,7 @@ Bug fixes for 3.0 - Fixed a bug (#501) - set_rules() to check if the request method is not 'POST' before aborting, instead of depending on count($_POST) in the :doc:`Form Validation Library `. - Fixed a bug (#940) - csrf_verify() used to set the CSRF cookie while processing a POST request with no actual POST data, which resulted in validating a request that should be considered invalid. - Fixed a bug in PostgreSQL's escape_str() where it didn't properly escape LIKE wild characters. +- Fixed a bug in the library loader where some PHP versions wouldn't execute the class constructor. Version 2.1.1 ============= -- cgit v1.2.3-24-g4f1b From 3b2587e1559d2cbe751d04f801f999ef3fa4e74c Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 28 Mar 2012 13:39:34 +0300 Subject: Added random ordering support for MSSQL and SQLSRV drivers and removed an unused method --- user_guide_src/source/changelog.rst | 2 ++ 1 file changed, 2 insertions(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 4703190a9..22235ee26 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -80,6 +80,8 @@ Release Date: Not Released - Added DSN string support for CUBRID. - Added persistent connections support for CUBRID. - Added DSN string support (Easy Connect and TNS) for Oracle. + - Added random ordering support for MSSQL. + - Added random ordering support for SQLSRV. - Libraries -- cgit v1.2.3-24-g4f1b From 1366cbcb9f509b52bead3180cf62c2fe9a0b3540 Mon Sep 17 00:00:00 2001 From: Matteo Mattei Date: Wed, 28 Mar 2012 14:26:59 +0200 Subject: Add buffer string attach function to changelog. --- user_guide_src/source/changelog.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index f9e742264..3dd5fca2a 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -75,7 +75,8 @@ Release Date: Not Released - Added max_filename_increment config setting for Upload library. - CI_Loader::_ci_autoloader() is now a protected method. - - Added custom filename to Email::attach() as $this->email->attach($filename, $disposition, $newname) + - Added custom filename to Email::attach() as $this->email->attach($filename, $disposition, $newname). + - Added possibility to send attachment as buffer string in Email::attach() as $this->email->attach($buffer, $disposition, $newname, $mime). - Cart library changes include: - It now auto-increments quantity's instead of just resetting it, this is the default behaviour of large e-commerce sites. - Product Name strictness can be disabled via the Cart Library by switching "$product_name_safe" -- cgit v1.2.3-24-g4f1b From 64bfa0634c991ef98ec3d2d44d862ea99d839854 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 29 Mar 2012 18:54:09 +0300 Subject: Add a missing changelog entry for pull #1227 --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 52cd51603..3ea95d9ae 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -176,6 +176,7 @@ Bug fixes for 3.0 - Fixed a bug (#940) - csrf_verify() used to set the CSRF cookie while processing a POST request with no actual POST data, which resulted in validating a request that should be considered invalid. - Fixed a bug in PostgreSQL's escape_str() where it didn't properly escape LIKE wild characters. - Fixed a bug in the library loader where some PHP versions wouldn't execute the class constructor. +- Fixed a bug (#88) - An unexisting property was used for configuration of the Memcache cache driver. Version 2.1.1 ============= -- cgit v1.2.3-24-g4f1b From 52fe7bb68f9961cdd765dd38e54779ae3b66e586 Mon Sep 17 00:00:00 2001 From: Songpol Sripaoeiam Date: Sun, 1 Apr 2012 11:43:20 +0700 Subject: add function get_current_content_type to output class and user manual library --- user_guide_src/source/libraries/output.rst | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/libraries/output.rst b/user_guide_src/source/libraries/output.rst index 2cf7c0854..8cd5ff895 100644 --- a/user_guide_src/source/libraries/output.rst +++ b/user_guide_src/source/libraries/output.rst @@ -49,6 +49,13 @@ data, JPEG's, XML, etc easily. .. important:: Make sure any non-mime string you pass to this method exists in config/mimes.php or it will have no effect. +$this->output->get_current_content_type(); +==================================== + +Get the current mime-type of your page and return 'text/html' by default. + + $this->output->get_current_content_type(); + $this->output->get_output(); ============================= -- cgit v1.2.3-24-g4f1b From b966701fad01c094199a89f7e4df72d981e5cf48 Mon Sep 17 00:00:00 2001 From: Songpol Sripaoeiam Date: Sun, 1 Apr 2012 17:13:44 +0700 Subject: bracket on a new line Also add space after foreach bracket on a new line... Also add a space after if Follow up from https://github.com/EllisLab/CodeIgniter/pull/1234/files#r630522 --- user_guide_src/source/libraries/output.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/libraries/output.rst b/user_guide_src/source/libraries/output.rst index 8cd5ff895..ba1ef19e6 100644 --- a/user_guide_src/source/libraries/output.rst +++ b/user_guide_src/source/libraries/output.rst @@ -50,7 +50,7 @@ data, JPEG's, XML, etc easily. exists in config/mimes.php or it will have no effect. $this->output->get_current_content_type(); -==================================== +========================================== Get the current mime-type of your page and return 'text/html' by default. -- cgit v1.2.3-24-g4f1b From 614db07c77e341bfe4bf92d7576f01a6cabd43ff Mon Sep 17 00:00:00 2001 From: Songpol Sripaoeiam Date: Tue, 3 Apr 2012 01:29:28 +0700 Subject: The current name is too wide change to get_content_type()consistent with set_content_type() --- user_guide_src/source/libraries/output.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/libraries/output.rst b/user_guide_src/source/libraries/output.rst index ba1ef19e6..7fd2a1c72 100644 --- a/user_guide_src/source/libraries/output.rst +++ b/user_guide_src/source/libraries/output.rst @@ -49,12 +49,12 @@ data, JPEG's, XML, etc easily. .. important:: Make sure any non-mime string you pass to this method exists in config/mimes.php or it will have no effect. -$this->output->get_current_content_type(); +$this->output->get_content_type(); ========================================== Get the current mime-type of your page and return 'text/html' by default. - $this->output->get_current_content_type(); + $this->output->get_content_type(); $this->output->get_output(); ============================= -- cgit v1.2.3-24-g4f1b From 937f104c39353ecc513863545b47769143c1c9a1 Mon Sep 17 00:00:00 2001 From: Songpol Sripao-eiam Date: Tue, 3 Apr 2012 11:04:33 +0700 Subject: Update changelog --- user_guide_src/source/changelog.rst | 3 +++ 1 file changed, 3 insertions(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 4fdbda054..272ca348c 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -190,6 +190,9 @@ Release Date: Not Released - Libraries - Further improved MIME type detection in the :doc:`File Uploading Library `. +- Core + - Added get_content_type for get current mime-types :doc:`Core Output Library `. + - Helpers - url_title() performance and output improved. You can now use any string as the word delimiter, but 'dash' and 'underscore' are still supported. -- cgit v1.2.3-24-g4f1b From cc0e4152502c368c0f4aa9be0af6b921ef106b81 Mon Sep 17 00:00:00 2001 From: Songpol Sripao-eiam Date: Tue, 3 Apr 2012 15:37:02 +0700 Subject: Move changelog line from verion 2.1.1 to version 3.0 --- user_guide_src/source/changelog.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 272ca348c..491f93782 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -124,6 +124,7 @@ Release Date: Not Released - Modified valid_ip() to use PHP's filter_var() in the :doc:`Input Library `. - Added support for HTTP-Only cookies with new config option ``cookie_httponly`` (default FALSE). - Renamed method _call_hook() to call_hook() in the :doc:`Hooks Library `. + - Added get_content_type for get current mime-types :doc:`Core Output Library `. Bug fixes for 3.0 ------------------ @@ -190,9 +191,6 @@ Release Date: Not Released - Libraries - Further improved MIME type detection in the :doc:`File Uploading Library `. -- Core - - Added get_content_type for get current mime-types :doc:`Core Output Library `. - - Helpers - url_title() performance and output improved. You can now use any string as the word delimiter, but 'dash' and 'underscore' are still supported. -- cgit v1.2.3-24-g4f1b From 00adf1d480f94692a625ec2165e0fcc9171c6e2f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 3 Apr 2012 12:30:50 +0300 Subject: Some improvements to the additions from pull #1234 --- user_guide_src/source/changelog.rst | 4 ++-- user_guide_src/source/libraries/output.rst | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 770d68a8e..c3e0e1dc0 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -129,8 +129,8 @@ Release Date: Not Released - Added method() to CI_Input to retrieve $_SERVER['REQUEST_METHOD']. - Modified valid_ip() to use PHP's filter_var() in the :doc:`Input Library `. - Added support for HTTP-Only cookies with new config option ``cookie_httponly`` (default FALSE). - - Renamed method _call_hook() to call_hook() in the :doc:`Hooks Library `. - - Added get_content_type for get current mime-types :doc:`Core Output Library `. + - Renamed method _call_hook() to call_hook() in the :doc:`Hooks Library `. + - Added get_content_type() method to the :doc:`Output Library `. Bug fixes for 3.0 ------------------ diff --git a/user_guide_src/source/libraries/output.rst b/user_guide_src/source/libraries/output.rst index 7fd2a1c72..baceaae7b 100644 --- a/user_guide_src/source/libraries/output.rst +++ b/user_guide_src/source/libraries/output.rst @@ -52,9 +52,11 @@ data, JPEG's, XML, etc easily. $this->output->get_content_type(); ========================================== -Get the current mime-type of your page and return 'text/html' by default. +Returns the Content-Type HTTP header that's currently in use. - $this->output->get_content_type(); + $mime = $this->output->get_content_type(); + +.. note:: If not set, the default return value is 'text/html'. $this->output->get_output(); ============================= -- cgit v1.2.3-24-g4f1b From d6057485408fab0caaca75ef78434d8077eaadd9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 3 Apr 2012 14:07:31 +0300 Subject: Fix issue #14 --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index c3e0e1dc0..0a690a5eb 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -185,6 +185,7 @@ Bug fixes for 3.0 - Fixed a bug in PostgreSQL's escape_str() where it didn't properly escape LIKE wild characters. - Fixed a bug in the library loader where some PHP versions wouldn't execute the class constructor. - Fixed a bug (#88) - An unexisting property was used for configuration of the Memcache cache driver. +- Fixed a bug (#14) - create_database() method in the :doc:`Database Forge Library ` didn't utilize the configured database character set. Version 2.1.1 ============= -- cgit v1.2.3-24-g4f1b From fd6c2bc7ed0ce474ac08fefb3efe88288368da98 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 3 Apr 2012 16:21:48 +0300 Subject: Fix issue #1238 --- user_guide_src/source/changelog.rst | 2 ++ 1 file changed, 2 insertions(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 0a690a5eb..9f0d55ad5 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -50,6 +50,7 @@ Release Date: Not Released - form_dropdown() will now also take an array for unity with other form helpers. - set_realpath() can now also handle file paths as opposed to just directories. - do_hash() now uses PHP's native hash() function, supporting more algorithms. + - Added an optional paramater to ``delete_files()`` to enable it to skip deleting files such as .htaccess and index.html. - Database @@ -186,6 +187,7 @@ Bug fixes for 3.0 - Fixed a bug in the library loader where some PHP versions wouldn't execute the class constructor. - Fixed a bug (#88) - An unexisting property was used for configuration of the Memcache cache driver. - Fixed a bug (#14) - create_database() method in the :doc:`Database Forge Library ` didn't utilize the configured database character set. +- Fixed a bug (#1238) - delete_all() in the `Database Caching Library ` used to delete .htaccess and index.html files, which is a potential security risk. Version 2.1.1 ============= -- cgit v1.2.3-24-g4f1b From 426faa94502218f110e5391e32aba795fa75b1e8 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 3 Apr 2012 19:03:58 +0300 Subject: Fix an issue in CI_Trackback::validate_url() and do some cleanup and optimizations in the library --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 9f0d55ad5..fe0670a82 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -188,6 +188,7 @@ Bug fixes for 3.0 - Fixed a bug (#88) - An unexisting property was used for configuration of the Memcache cache driver. - Fixed a bug (#14) - create_database() method in the :doc:`Database Forge Library ` didn't utilize the configured database character set. - Fixed a bug (#1238) - delete_all() in the `Database Caching Library ` used to delete .htaccess and index.html files, which is a potential security risk. +- Fixed a bug in :doc:`Trackback Library ` method validate_url() where it didn't actually do anything, due to input not being passed by reference. Version 2.1.1 ============= -- cgit v1.2.3-24-g4f1b From 7bf632f4ba3a3db1ae38915efe2026d25acc9539 Mon Sep 17 00:00:00 2001 From: Tobias Tschech Date: Wed, 4 Apr 2012 15:18:26 +0300 Subject: Update user_guide_src/source/changelog.rst --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 9929cc368..1c8647bb7 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -194,6 +194,7 @@ Bug fixes for 3.0 - Fixed a bug (#1238) - delete_all() in the `Database Caching Library ` used to delete .htaccess and index.html files, which is a potential security risk. - Fixed a bug in :doc:`Trackback Library ` method validate_url() where it didn't actually do anything, due to input not being passed by reference. - Fixed a bug (#11, #183, #863) - CI_Form_validation::_execute() silently continued to the next rule, if a rule method/function is not found. +- Fixed a bug (#1242) Added Windows path compatibility to function read_dir of ZIP library Version 2.1.1 ============= -- cgit v1.2.3-24-g4f1b From 5d66f6554872e87f896daa8bf6f93e60b0fa34fa Mon Sep 17 00:00:00 2001 From: "M. Fauzilkamil Zainuddin" Date: Wed, 28 Mar 2012 16:02:23 +0800 Subject: Fixing user_guide compilation warnings --- user_guide_src/source/conf.py | 2 +- user_guide_src/source/libraries/form_validation.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/conf.py b/user_guide_src/source/conf.py index 593ceaf1c..e972a388b 100644 --- a/user_guide_src/source/conf.py +++ b/user_guide_src/source/conf.py @@ -121,7 +121,7 @@ html_theme_path = ["./_themes"] # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +#html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index ef4be5601..028b61c4c 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -608,7 +608,7 @@ call the reset_validation() function before setting up rules and validating the For more info please see the :ref:`function-reference` section below. --.. _saving-groups: +.. _saving-groups: ************************************************ Saving Sets of Validation Rules to a Config File @@ -977,7 +977,7 @@ $this->form_validation->set_data(); $_POST array. $this->form_validation->reset_validation(); -======================================== +=========================================== .. php:method:: reset_validation () -- cgit v1.2.3-24-g4f1b From 1f975cad332154f9b27159ba0fdc0ca8b174d82d Mon Sep 17 00:00:00 2001 From: "M. Fauzilkamil Zainuddin" Date: Wed, 28 Mar 2012 16:34:55 +0800 Subject: Fixing doc link in changelog --- user_guide_src/source/changelog.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 1c8647bb7..b3f6ced57 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -121,7 +121,12 @@ Release Date: Not Released - Changed the :doc:`Session Library ` to select only one row when using database sessions. - Added all_flashdata() method to session class. Returns an associative array of only flashdata. - Allowed for setting table class defaults in a config file. - - Added a Wincache driver to the `Caching Library `. + - Form Validation library now allows setting of error delimiters in the config file via $config['error_prefix'] and $config['error_suffix']. + - Added function error_array() to return all error messages as an array in the Form_validation class. + - Added function set_data() to Form_validation library, which can be used in place of the default $_POST array. + - Added function reset_validation() to form validation library, which resets internal validation variables in case of multiple validation routines. + - Changed the Session library to select only one row when using database sessions. + - Added a Wincache driver to the :doc:`Caching Library `. - Added dsn (delivery status notification) option to the :doc:`Email Library `. - Core -- cgit v1.2.3-24-g4f1b From a396c3bf6398d3d5631725078b81b8d2757481e2 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 4 Apr 2012 18:57:39 +0300 Subject: Remove duplicate changelog entries introduced in pull #1225 --- user_guide_src/source/changelog.rst | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index b3f6ced57..189dccf0a 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -121,11 +121,6 @@ Release Date: Not Released - Changed the :doc:`Session Library ` to select only one row when using database sessions. - Added all_flashdata() method to session class. Returns an associative array of only flashdata. - Allowed for setting table class defaults in a config file. - - Form Validation library now allows setting of error delimiters in the config file via $config['error_prefix'] and $config['error_suffix']. - - Added function error_array() to return all error messages as an array in the Form_validation class. - - Added function set_data() to Form_validation library, which can be used in place of the default $_POST array. - - Added function reset_validation() to form validation library, which resets internal validation variables in case of multiple validation routines. - - Changed the Session library to select only one row when using database sessions. - Added a Wincache driver to the :doc:`Caching Library `. - Added dsn (delivery status notification) option to the :doc:`Email Library `. @@ -199,7 +194,7 @@ Bug fixes for 3.0 - Fixed a bug (#1238) - delete_all() in the `Database Caching Library ` used to delete .htaccess and index.html files, which is a potential security risk. - Fixed a bug in :doc:`Trackback Library ` method validate_url() where it didn't actually do anything, due to input not being passed by reference. - Fixed a bug (#11, #183, #863) - CI_Form_validation::_execute() silently continued to the next rule, if a rule method/function is not found. -- Fixed a bug (#1242) Added Windows path compatibility to function read_dir of ZIP library +- Fixed a bug (#1242) - read_dir() in the :doc:`Zip Library ` wasn't compatible with Windows. Version 2.1.1 ============= -- cgit v1.2.3-24-g4f1b From 97f3697b6c1c220a32d8e63c5da636e9d725dd8a Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 5 Apr 2012 12:44:36 +0300 Subject: Added a default _insert_batch() method instead of requiring each driver to define it and fixed 2 issues related to it --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 189dccf0a..3525b530f 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -195,6 +195,7 @@ Bug fixes for 3.0 - Fixed a bug in :doc:`Trackback Library ` method validate_url() where it didn't actually do anything, due to input not being passed by reference. - Fixed a bug (#11, #183, #863) - CI_Form_validation::_execute() silently continued to the next rule, if a rule method/function is not found. - Fixed a bug (#1242) - read_dir() in the :doc:`Zip Library ` wasn't compatible with Windows. +- Fixed a bug (#306) - ODBC driver didn't have an _insert_batch() method, which resulted in fatal error being triggered when insert_batch() is used with it. Version 2.1.1 ============= -- cgit v1.2.3-24-g4f1b From 17ceeae7ddd5c4eba2b1d0b25a17706b3d873346 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 5 Apr 2012 15:38:30 +0300 Subject: Add replace() support for SQLite/SQLite3 --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 3525b530f..911996e12 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -90,6 +90,7 @@ Release Date: Not Released - Generally improved for speed and cleaned up all of its components. - *Row* result methods now really only fetch only the needed number of rows, instead of depending entirely on result(). - num_rows() is now only called explicitly by the developer and no longer re-executes statements. + - Added replace() support for SQLite. - Libraries -- cgit v1.2.3-24-g4f1b From 6d83cde3ba326f400b11475c51a4becec51c2de8 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 5 Apr 2012 16:20:50 +0300 Subject: Fixed MSSQL and SQLSrv truncate() --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 911996e12..81644ecac 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -197,6 +197,7 @@ Bug fixes for 3.0 - Fixed a bug (#11, #183, #863) - CI_Form_validation::_execute() silently continued to the next rule, if a rule method/function is not found. - Fixed a bug (#1242) - read_dir() in the :doc:`Zip Library ` wasn't compatible with Windows. - Fixed a bug (#306) - ODBC driver didn't have an _insert_batch() method, which resulted in fatal error being triggered when insert_batch() is used with it. +- Fixed a bug in MSSQL and SQLSrv's _truncate() where the TABLE keyword was missing. Version 2.1.1 ============= -- cgit v1.2.3-24-g4f1b From ea09a8a5552f2aacdeab0c88a605fe44047ebd0a Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 6 Apr 2012 20:50:07 +0300 Subject: Renamed _escape_identifiers() to escape_identifiers() and moved it to CI_DB_driver --- user_guide_src/source/changelog.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 81644ecac..3ad930ed1 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -75,7 +75,7 @@ Release Date: Not Released - Added _optimize_table() support for the :doc:`Database Utility Class ` (rebuilds table indexes). - Added a constructor to the DB_result class and moved all driver-specific properties and logic out of the base DB_driver class to allow better abstraction. - Removed limit() and order_by() support for UPDATE and DELETE queries in PostgreSQL driver. Postgres does not support those features. - - Removed protect_identifiers() and renamed _protect_identifiers() to it instead - it was just an alias. + - Removed protect_identifiers() and renamed internal method _protect_identifiers() to it instead - it was just an alias. - MySQL and MySQLi drivers now require at least MySQL version 5.1. - db_set_charset() now only requires one parameter (collation was only needed due to legacy support for MySQL versions prior to 5.1). - Added DSN string support for CUBRID. @@ -91,6 +91,7 @@ Release Date: Not Released - *Row* result methods now really only fetch only the needed number of rows, instead of depending entirely on result(). - num_rows() is now only called explicitly by the developer and no longer re-executes statements. - Added replace() support for SQLite. + - Renamed internal method _escape_identifiers() to escape_identifiers(). - Libraries -- cgit v1.2.3-24-g4f1b From 80144bf2badfa992eaef71337e1557209817027c Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 6 Apr 2012 22:19:26 +0300 Subject: Fix a CI_DB_pdo_driver::trans_commit() bug --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 3ad930ed1..923224ecc 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -199,6 +199,7 @@ Bug fixes for 3.0 - Fixed a bug (#1242) - read_dir() in the :doc:`Zip Library ` wasn't compatible with Windows. - Fixed a bug (#306) - ODBC driver didn't have an _insert_batch() method, which resulted in fatal error being triggered when insert_batch() is used with it. - Fixed a bug in MSSQL and SQLSrv's _truncate() where the TABLE keyword was missing. +- Fixed a bug in PDO's trans_commit() method where it failed due to an erroneous property name. Version 2.1.1 ============= -- cgit v1.2.3-24-g4f1b From 00541ae101a2044c4223b7b48d97c6afefe94be4 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 9 Apr 2012 11:43:10 +0300 Subject: Extend fix for #798 to work across all DB drivers instead of just mysql --- user_guide_src/source/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 923224ecc..30793111b 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -57,7 +57,6 @@ Release Date: Not Released - Added new :doc:`Active Record ` methods that return the SQL string of queries without executing them: get_compiled_select(), get_compiled_insert(), get_compiled_update(), get_compiled_delete(). - - Taking care of LIKE condition when used with MySQL UPDATE statement. - Adding $escape parameter to the order_by function, this enables ordering by custom fields. - Improved support for the MySQLi driver, including: - OOP style of the PHP extension is now used, instead of the procedural aliases. @@ -200,6 +199,7 @@ Bug fixes for 3.0 - Fixed a bug (#306) - ODBC driver didn't have an _insert_batch() method, which resulted in fatal error being triggered when insert_batch() is used with it. - Fixed a bug in MSSQL and SQLSrv's _truncate() where the TABLE keyword was missing. - Fixed a bug in PDO's trans_commit() method where it failed due to an erroneous property name. +- Fixed a bug (#798) - update() used to ignore LIKE conditions that were set with like(). Version 2.1.1 ============= -- cgit v1.2.3-24-g4f1b From 5f56246efd8ae86b327835ddaf67bc0d726700a3 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 9 Apr 2012 12:06:35 +0300 Subject: Fix AR delete() for Oracle --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 30793111b..5ca688c2c 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -200,6 +200,7 @@ Bug fixes for 3.0 - Fixed a bug in MSSQL and SQLSrv's _truncate() where the TABLE keyword was missing. - Fixed a bug in PDO's trans_commit() method where it failed due to an erroneous property name. - Fixed a bug (#798) - update() used to ignore LIKE conditions that were set with like(). +- Fixed a bug in Oracle's delete() method where an erroneous SQL statement was generated when used with limit(). Version 2.1.1 ============= -- cgit v1.2.3-24-g4f1b From 5c0e9fe409e9ca87cc9daf39ae9029c026ad01cc Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 9 Apr 2012 12:28:11 +0300 Subject: Fix AR delete() for MSSQL and SQLSRV --- user_guide_src/source/changelog.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 5ca688c2c..2a74503eb 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -200,7 +200,8 @@ Bug fixes for 3.0 - Fixed a bug in MSSQL and SQLSrv's _truncate() where the TABLE keyword was missing. - Fixed a bug in PDO's trans_commit() method where it failed due to an erroneous property name. - Fixed a bug (#798) - update() used to ignore LIKE conditions that were set with like(). -- Fixed a bug in Oracle's delete() method where an erroneous SQL statement was generated when used with limit(). +- Fixed a bug in Oracle's and MSSQL's delete() methods where an erroneous SQL statement was generated when used with limit(). +- Fixed a bug in SQLSRV's delete() method where like() and limit() conditions were ignored. Version 2.1.1 ============= -- cgit v1.2.3-24-g4f1b From d947eba0bdaf9d86401fdcba9e97706905cacf9d Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 9 Apr 2012 14:58:28 +0300 Subject: Multiple DB Forge improvements - Replaced driver methods _create_database(), _drop_database(), _drop_table() and _rename_table() with properties - Added defaults for the above mentioned platform-specific queries, so that not all drivers need to define them - Improved support for the SQLite, ODBC and PDO drivers --- user_guide_src/source/changelog.rst | 3 +++ 1 file changed, 3 insertions(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 2a74503eb..1e2813014 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -91,6 +91,9 @@ Release Date: Not Released - num_rows() is now only called explicitly by the developer and no longer re-executes statements. - Added replace() support for SQLite. - Renamed internal method _escape_identifiers() to escape_identifiers(). + - Added SQLite support for drop_table() in :doc:`Database Forge `. + - Added ODBC support for create_database(), drop_database() and drop_table() in :doc:`Database Forge `. + - Added PDO support for create_database(), drop_database and drop_table() in :doc:`Database Forge `. - Libraries -- cgit v1.2.3-24-g4f1b From b457a4001ce2380e97f36b0a983b477c3e31de69 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 9 Apr 2012 16:11:56 +0300 Subject: DB Utility improvements - Replaced driver methods _list_databases(), _optimize_table() and _repair_table() with properties - Added defaults for optimize_table() and repair_table() SQL strings (FALSE, as those are mostly MySQL-specific) - Added MSSQL/SQLSRV support for optimize_table() (actually rebuilds table indexes) - Switched public driver methods to protected - Improved CUBRID support for list_databases() as it used to only return the currently used database - Minor speed improvements --- user_guide_src/source/changelog.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 1e2813014..8146a5139 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -79,8 +79,7 @@ Release Date: Not Released - db_set_charset() now only requires one parameter (collation was only needed due to legacy support for MySQL versions prior to 5.1). - Added DSN string support for CUBRID. - Added persistent connections support for CUBRID. - - Added random ordering support for MSSQL. - - Added random ordering support for SQLSRV. + - Added random ordering support for MSSQL, SQLSRV. - Added support for SQLite3 database driver. - Improved support of the Oracle (OCI8) driver, including: - Added DSN string support (Easy Connect and TNS). @@ -94,6 +93,8 @@ Release Date: Not Released - Added SQLite support for drop_table() in :doc:`Database Forge `. - Added ODBC support for create_database(), drop_database() and drop_table() in :doc:`Database Forge `. - Added PDO support for create_database(), drop_database and drop_table() in :doc:`Database Forge `. + - Added MSSQL, SQLSRV support for optimize_table() in :doc:`Database Utility `. + - Improved CUBRID support for list_databases() in :doc:`Database Utility ` (until now only the currently used database was returned). - Libraries -- cgit v1.2.3-24-g4f1b From 8b52222a684892e3306a093821d4507792acd3ea Mon Sep 17 00:00:00 2001 From: Rogerio Prado de Jesus Date: Fri, 13 Apr 2012 01:18:03 -0300 Subject: Update Release Date for version 2.1.1 at user_guide_src/source/changelog.rst --- user_guide_src/source/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 8146a5139..5f6d5912c 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -210,7 +210,7 @@ Bug fixes for 3.0 Version 2.1.1 ============= -Release Date: November 14, 2011 +Release Date: Not Released - General Changes - Fixed support for docx, xlsx files in mimes.php. -- cgit v1.2.3-24-g4f1b From 3c0a4529b05ed8b3d9fadf97238e3d462d0ce733 Mon Sep 17 00:00:00 2001 From: Iban Eguia Date: Sun, 15 Apr 2012 13:30:44 +0200 Subject: Added the ability to insert objects with insert_batch() in Active Reccord. --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 5f6d5912c..0cac8aea0 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -54,6 +54,7 @@ Release Date: Not Released - Database + - Added the ability to insert objects with insert_batch() in :doc:`Active Record `. - Added new :doc:`Active Record ` methods that return the SQL string of queries without executing them: get_compiled_select(), get_compiled_insert(), get_compiled_update(), get_compiled_delete(). -- cgit v1.2.3-24-g4f1b From bb8ae01bff0fa7cb3b14fb5f1310d944c414cf81 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Fri, 20 Apr 2012 10:31:51 -0400 Subject: added suggested styleguide addition for future consistency --- user_guide_src/source/general/styleguide.rst | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/general/styleguide.rst b/user_guide_src/source/general/styleguide.rst index 2b91d1cc0..925954c03 100644 --- a/user_guide_src/source/general/styleguide.rst +++ b/user_guide_src/source/general/styleguide.rst @@ -149,7 +149,7 @@ months down the line. There is not a required format for comments, but the following are recommended. `DocBlock `_ -style comments preceding class and method declarations so they can be +style comments preceding class, method, and property declarations so they can be picked up by IDEs:: /** @@ -172,6 +172,17 @@ picked up by IDEs:: * @return string */ function xml_encode($str) + +:: + + /** + * Data for class manipulation + * + * @var array + */ + public $data + + Use single line comments within code, leaving a blank line between large comment blocks and code. -- cgit v1.2.3-24-g4f1b From b3f774bbbb81293326136e3e13297c3b8d49dfa4 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 23 Apr 2012 12:57:57 +0300 Subject: Fix issue #1265 --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 0cac8aea0..f9b087e83 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -207,6 +207,7 @@ Bug fixes for 3.0 - Fixed a bug (#798) - update() used to ignore LIKE conditions that were set with like(). - Fixed a bug in Oracle's and MSSQL's delete() methods where an erroneous SQL statement was generated when used with limit(). - Fixed a bug in SQLSRV's delete() method where like() and limit() conditions were ignored. +- Fixed a bug (#1265) - Database connections were always closed, regardless of the 'pconnect' option value. Version 2.1.1 ============= -- cgit v1.2.3-24-g4f1b From e7bbb1dc97c6f2027db5f24383f8d93c4ba41d82 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 24 Apr 2012 21:11:21 +0300 Subject: Add changelog entry for already fixed issue #23 --- user_guide_src/source/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index f9b087e83..3bd8f989e 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -197,7 +197,7 @@ Bug fixes for 3.0 - Fixed a bug in the library loader where some PHP versions wouldn't execute the class constructor. - Fixed a bug (#88) - An unexisting property was used for configuration of the Memcache cache driver. - Fixed a bug (#14) - create_database() method in the :doc:`Database Forge Library ` didn't utilize the configured database character set. -- Fixed a bug (#1238) - delete_all() in the `Database Caching Library ` used to delete .htaccess and index.html files, which is a potential security risk. +- Fixed a bug (#23, #1238) - delete_all() in the `Database Caching Library ` used to delete .htaccess and index.html files, which is a potential security risk. - Fixed a bug in :doc:`Trackback Library ` method validate_url() where it didn't actually do anything, due to input not being passed by reference. - Fixed a bug (#11, #183, #863) - CI_Form_validation::_execute() silently continued to the next rule, if a rule method/function is not found. - Fixed a bug (#1242) - read_dir() in the :doc:`Zip Library ` wasn't compatible with Windows. -- cgit v1.2.3-24-g4f1b From 72b1076858662f535d42811c005e718f3114a1a8 Mon Sep 17 00:00:00 2001 From: George Petsagourakis Date: Wed, 25 Apr 2012 11:26:46 +0300 Subject: Added foreign_characters.php changes in the changelog. --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index f9b087e83..65790cab1 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -29,6 +29,7 @@ Release Date: Not Released - Added support for 3gp, 3g2, mp4, wmv, f4v, vlc Video files to mimes.php. - Added support for m4a, aac, m4u, xspf, au, ac3, flac, ogg Audio files to mimes.php. - Added support for kmz and kml (Google Earth) files to mimes.php. + - Added Romanian and Greek characters in foreign_characters.php - Updated support for doc files in mimes.php. - Added application/xml for xml and application/xml, text/xsl for xsl in mimes.php. - Changed logger to only chmod when file is first created. -- cgit v1.2.3-24-g4f1b From a28812aed2aa56d4e8e69ac3560ad33aa4b82f38 Mon Sep 17 00:00:00 2001 From: Chad Hedgcock Date: Wed, 25 Apr 2012 23:29:52 -0300 Subject: Corrected path to jquery --- user_guide_src/source/libraries/javascript.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/libraries/javascript.rst b/user_guide_src/source/libraries/javascript.rst index 5e80fb998..d5e09c314 100644 --- a/user_guide_src/source/libraries/javascript.rst +++ b/user_guide_src/source/libraries/javascript.rst @@ -86,14 +86,14 @@ The jQuery Class To initialize the jQuery class manually in your controller constructor, use the $this->load->library function:: - $this->load->library('jquery'); + $this->load->library('javascript/jquery'); You may send an optional parameter to determine whether or not a script tag for the main jQuery file will be automatically included when loading the library. It will be created by default. To prevent this, load the library as follows:: - $this->load->library('jquery', FALSE); + $this->load->library('javascript/jquery', FALSE); Once loaded, the jQuery library object will be available using: $this->jquery -- cgit v1.2.3-24-g4f1b From 606d246d7583a42582c9c283bc2163fec68d30eb Mon Sep 17 00:00:00 2001 From: Jamie Rumbelow Date: Thu, 26 Apr 2012 13:38:44 +0100 Subject: Adding some update notes for 3.0.0 (renaming AR to QB) --- user_guide_src/source/installation/upgrade_300.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/installation/upgrade_300.rst b/user_guide_src/source/installation/upgrade_300.rst index 4c594ab17..e434e8d45 100644 --- a/user_guide_src/source/installation/upgrade_300.rst +++ b/user_guide_src/source/installation/upgrade_300.rst @@ -31,3 +31,13 @@ Step 3: Remove $autoload['core'] from your config/autoload.php Use of the `$autoload['core']` config array has been deprecated as of CodeIgniter 1.4.1 and is now removed. Move any entries that you might have listed there to `$autoload['libraries']` instead. + +Step 4: Update your config/database.php +======================================= + +Due to 3.0.0's renaming of Active Record to Query Builder, inside your _config/database.php_, you will +need to rename the `$active_record` variable to `$query_builder`. + + $active_group = 'default'; + // $active_record = TRUE; + $query_builder = TRUE; \ No newline at end of file -- cgit v1.2.3-24-g4f1b From cdfbd5281e4dec7278a07943832c2590c1141eb3 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Thu, 26 Apr 2012 22:13:31 +0100 Subject: Fixed issue #122 - ruri_string() in subdirs. --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 1c8647bb7..615e0f734 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -195,6 +195,7 @@ Bug fixes for 3.0 - Fixed a bug in :doc:`Trackback Library ` method validate_url() where it didn't actually do anything, due to input not being passed by reference. - Fixed a bug (#11, #183, #863) - CI_Form_validation::_execute() silently continued to the next rule, if a rule method/function is not found. - Fixed a bug (#1242) Added Windows path compatibility to function read_dir of ZIP library +- Fixed a bug (#122) Where routed uri string was being reported incorrectly in sub-directories Version 2.1.1 ============= -- cgit v1.2.3-24-g4f1b