summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source
diff options
context:
space:
mode:
Diffstat (limited to 'user_guide_src/source')
-rw-r--r--user_guide_src/source/changelog.rst66
-rw-r--r--user_guide_src/source/database/configuration.rst4
-rw-r--r--user_guide_src/source/database/connecting.rst6
-rw-r--r--user_guide_src/source/database/helpers.rst6
-rw-r--r--user_guide_src/source/database/queries.rst17
-rw-r--r--user_guide_src/source/database/utilities.rst6
-rw-r--r--user_guide_src/source/libraries/form_validation.rst42
-rw-r--r--user_guide_src/source/overview/at_a_glance.rst2
8 files changed, 138 insertions, 11 deletions
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index c9354dea4..e96076164 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -28,6 +28,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.
+ - 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.
- Removed previously deprecated SHA1 Library.
@@ -39,6 +40,8 @@ Release Date: Not Released
- url_title() will now trim extra dashes from beginning and end.
- Added XHTML Basic 1.1 doctype to :doc:`HTML Helper <helpers/html_helper>`.
- Changed humanize to include a second param for the separator.
+ - Refactored ``plural()`` and ``singular()`` to avoid double pluralization and support more words.
+ - Added an optional third parameter to ``force_download()`` that enables/disables sending the actual file MIME type in the Content-Type header (disabled by default).
- Database
@@ -49,13 +52,23 @@ Release Date: Not Released
- 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.
+ - 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
+ - Added an optional database name parameter to db_select().
+ - Replaced the _error_message() and _error_number() methods with error(), that returns an array containing the last database error code and message.
+ - Improved version() implementation so that drivers that have a native function to get the version number don't have to be defined in the core DB_driver class.
+ - Improved support of the PostgreSQL driver, including:
+ - pg_version() is now used to get the database version number, when possible.
+ - Added db_set_charset() support.
+ - Added _optimize_table() support for the :doc:`Database Utility Class <database/utilities>` (rebuilds table indexes).
- Libraries
- 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 <libraries/form_validation>`.
- - 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)
- 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"
@@ -65,9 +78,13 @@ Release Date: Not Released
- 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
if they are set manually after initialization.
+ - If property maintain_ratio is set to TRUE, image_reproportion() now doesn't need both width and height to be specified.
- Minor speed optimizations and method & property visibility declarations in the Calendar Library.
- Removed SHA1 function in the :doc:`Encryption Library <libraries/encryption>`.
- Added $config['csrf_regeneration'] to the CSRF protection in the :doc:`Security library <libraries/security>`, which makes token regeneration optional.
+ - 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.
+ - Changed the Session library to select only one row when using database sessions.
- Core
@@ -80,8 +97,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.
@@ -101,11 +117,53 @@ Bug fixes for 3.0
- Fixed a bug (#904) - ``CI_Loader::initialize()`` caused a PHP Fatal error to be triggered if error level E_STRICT is used.
- Fixed a hosting edge case where an empty $_SERVER['HTTPS'] variable would evaluate to 'on'
- Fixed a bug (#154) - ``CI_Session::sess_update()`` caused the session to be destroyed on pages where multiple AJAX requests were executed at once.
+- 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 (#177) - CI_Form_validation::set_value() didn't set the default value if POST data is NULL.
+- Fixed a bug (#68, #414) - Oracle's escape_str() didn't properly escape LIKE wild characters.
+- Fixed a bug (#81) - ODBC's list_fields() and field_data() methods skipped the first column due to odbc_field_*() functions' index starting at 1 instead of 0.
+- Fixed a bug (#129) - ODBC's num_rows() returned -1 in some cases, due to not all subdrivers supporting the odbc_num_rows() function.
+- Fixed a bug (#153) - E_NOTICE being generated by getimagesize() in the :doc:`File Uploading Library <libraries/file_uploading>`.
+- Fixed a bug (#611) - SQLSRV's error handling methods used to issue warnings when there's no actual error.
+- Fixed a bug (#1036) - is_write_type() method in the :doc:`Database Library <database/index>` didn't return TRUE for RENAME and OPTIMIZE queries.
+- Fixed a bug in PDO's _version() method where it used to return the client version as opposed to the server one.
+- Fixed a bug in PDO's insert_id() method where it could've failed if it's used with Postgre versions prior to 8.1.
+- Fixed a bug in CUBRID's affected_rows() method where a connection resource was passed to cubrid_affected_rows() instead of a result.
+- Fixed a bug (#638) - db_set_charset() ignored its arguments and always used the configured charset and collation instead.
+- Fixed a bug (#413) - Oracle's error handling methods used to only return connection-related errors.
+- Fixed a bug (#804) - Profiler library was trying to handle objects as strings in some cases, resulting in warnings being issued by htmlspecialchars().
+- Fixed a bug (#1101) - MySQL/MySQLi result method field_data() was implemented as if it was handling a DESCRIBE result instead of the actual result set.
+- Fixed a bug in Oracle's :doc:`Database Forge Class <database/forge>` method _create_table() where it failed with AUTO_INCREMENT as it's not supported.
+- Fixed a bug (#1080) - When using the SMTP protocol, the :doc:`Email Library <libraries/email>` send() method was returning TRUE even if the connection/authentication against the server failed.
+
+Version 2.1.1
+=============
+
+Release Date: Not Released
+
+- General Changes
+ - Fixed support for docx, xlsx files in mimes.php.
+
+- Libraries
+ - Further improved MIME type detection in the :doc:`File Uploading Library <libraries/file_uploading>`.
+
+- Helpers
+ - url_title() performance and output improved. You can now use any string as the word delimiter, but 'dash' and 'underscore' are still supported.
+
+Bug fixes for 2.1.1
+-------------------
+
+- Fixed a bug (#697) - A wrong array key was used in the Upload library to check for mime-types.
+- Fixed a bug - form_open() compared $action against site_url() instead of base_url().
+- Fixed a bug - CI_Upload::_file_mime_type() could've failed if mime_content_type() is used for the detection and returns FALSE.
+- Fixed a bug (#538) - Windows paths were ignored when using the :doc:`Image Manipulation Library <libraries/image_lib>` to create a new file.
+- Fixed a bug - When database caching was enabled, $this->db->query() checked the cache before binding variables which resulted in cached queries never being found
Version 2.1.0
=============
-Release Date: Not Released
+Release Date: November 14, 2011
- General Changes
diff --git a/user_guide_src/source/database/configuration.rst b/user_guide_src/source/database/configuration.rst
index 4f88c25ab..040e7e33f 100644
--- a/user_guide_src/source/database/configuration.rst
+++ b/user_guide_src/source/database/configuration.rst
@@ -28,6 +28,10 @@ prototype::
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
+If you use PDO as your dbdriver, you can specify the full DSN string describe a connection to the database like this::
+
+ $db['default']['dsn'] = 'pgsql:host=localhost;port=5432;dbname=database_name';
+
You can also specify failovers for the situation when the main connection cannot connect for some reason.
These failovers can be specified by setting the failover for a connection like this::
diff --git a/user_guide_src/source/database/connecting.rst b/user_guide_src/source/database/connecting.rst
index a834cc0f7..fb4524116 100644
--- a/user_guide_src/source/database/connecting.rst
+++ b/user_guide_src/source/database/connecting.rst
@@ -122,6 +122,12 @@ return the database object.
| $DB1->result();
| etc...
+.. note:: You don't need to create separate database configurations if you
+ only need to use a different database on the same connection. You
+ can switch to a different database when you need to, like this:
+
+ | $this->db->db_select($database2_name);
+
Reconnecting / Keeping the Connection Alive
===========================================
diff --git a/user_guide_src/source/database/helpers.rst b/user_guide_src/source/database/helpers.rst
index 7ea19e9f6..e8a5ac801 100644
--- a/user_guide_src/source/database/helpers.rst
+++ b/user_guide_src/source/database/helpers.rst
@@ -7,9 +7,9 @@ $this->db->insert_id()
The insert ID number when performing database inserts.
-.. note:: If using the PDO driver with PostgreSQL, this function requires
- a $name parameter, which specifies the appropriate sequence to check
- for the insert id.
+.. note:: If using the PDO driver with PostgreSQL, or using the Interbase
+ driver, this function requires a $name parameter, which specifies the
+ appropriate sequence to check for the insert id.
$this->db->affected_rows()
===========================
diff --git a/user_guide_src/source/database/queries.rst b/user_guide_src/source/database/queries.rst
index 971d5d61d..15a73614a 100644
--- a/user_guide_src/source/database/queries.rst
+++ b/user_guide_src/source/database/queries.rst
@@ -112,3 +112,20 @@ The secondary benefit of using binds is that the values are
automatically escaped, producing safer queries. You don't have to
remember to manually escape data; the engine does it automatically for
you.
+
+***************
+Handling Errors
+***************
+
+$this->db->error();
+===================
+
+If you need to get the last error that has occured, the error() method
+will return an array containing its code and message. Here's a quick
+example::
+
+ if ( ! $this->db->simple_query('SELECT `example_field` FROM `example_table`'))
+ {
+ $error = $this->db->error(); // Has keys 'code' and 'message'
+ }
+
diff --git a/user_guide_src/source/database/utilities.rst b/user_guide_src/source/database/utilities.rst
index b0920109f..3805ffb87 100644
--- a/user_guide_src/source/database/utilities.rst
+++ b/user_guide_src/source/database/utilities.rst
@@ -161,7 +161,11 @@ $this->dbutil->backup()
Permits you to backup your full database or individual tables. The
backup data can be compressed in either Zip or Gzip format.
-.. note:: This features is only available for MySQL databases.
+.. note:: This features is only available for MySQL and Interbase/Firebird databases.
+
+.. note:: For Interbase/Firebird databases, the backup file name is the only parameter.
+
+ Eg. $this->dbutil->backup('db_backup_filename');
.. note:: Due to the limited execution time and memory available to PHP,
backing up very large databases may not be possible. If your database is
diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst
index 684051db5..0d6a49e79 100644
--- a/user_guide_src/source/libraries/form_validation.rst
+++ b/user_guide_src/source/libraries/form_validation.rst
@@ -579,7 +579,27 @@ must supply it as an array to the function. Example::
For more info please see the :ref:`using-arrays-as-field-names` section below.
-.. _saving-groups:
+Validating an Array (other than $_POST)
+=======================================
+
+Sometimes you may want to validate an array that does not originate from $_POST data.
+
+In this case, you can specify the array to be validated::
+
+ $data = array(
+ 'username' => 'johndoe',
+ 'password' => 'mypassword',
+ 'passconf' => 'mypassword'
+ );
+
+ $this->form_validation->set_data($data);
+
+Creating validation rules, running the validation and retrieving error messages works the same whether you are
+validating $_POST data or an array.
+
+For more info please see the :ref:`function-reference` section below.
+
+-.. _saving-groups:
************************************************
Saving Sets of Validation Rules to a Config File
@@ -936,6 +956,25 @@ $this->form_validation->set_message();
Permits you to set custom error messages. See :ref:`setting-error-messages`
+$this->form_validation->set_data();
+========================================
+
+ .. php:method:: set_data ($data = '')
+
+ :param array $data: The data to validate
+
+ Permits you to set an array for validation, instead of using the default
+ $_POST array.
+
+$this->form_validation->error_array();
+========================================
+
+ .. php:method:: error_array ()
+
+ :rtype: Array
+
+ Returns the error messages as an array.
+
.. _helper-functions:
****************
@@ -1017,4 +1056,3 @@ This function is identical to the **set_checkbox()** function above.
<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
-
diff --git a/user_guide_src/source/overview/at_a_glance.rst b/user_guide_src/source/overview/at_a_glance.rst
index 31f0b4dd9..6dcfdbb14 100644
--- a/user_guide_src/source/overview/at_a_glance.rst
+++ b/user_guide_src/source/overview/at_a_glance.rst
@@ -41,7 +41,7 @@ CodeIgniter Uses M-V-C
CodeIgniter uses the Model-View-Controller approach, which allows great
separation between logic and presentation. This is particularly good for
projects in which designers are working with your template files, as the
-code these file contain will be minimized. We describe MVC in more
+code these files contain will be minimized. We describe MVC in more
detail on its own page.
CodeIgniter Generates Clean URLs