summaryrefslogtreecommitdiffstats
path: root/user_guide_src
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2012-06-15 00:02:16 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2012-06-15 00:02:16 +0200
commitc9bb0c5b7a3a349a5c255b02b5cc7ddbe32132e5 (patch)
tree905ff3f3153720c1d1547092e54feaf0e46568a6 /user_guide_src
parent3061ee737ff2c1853428482e1704b0973b621118 (diff)
parentf11a1939c25de1e327c7c02001c8fbd1ec1fc7b4 (diff)
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop
Diffstat (limited to 'user_guide_src')
-rw-r--r--user_guide_src/source/changelog.rst137
-rw-r--r--user_guide_src/source/general/common_functions.rst5
-rw-r--r--user_guide_src/source/general/core_classes.rst1
-rw-r--r--user_guide_src/source/general/requirements.rst5
-rw-r--r--user_guide_src/source/helpers/date_helper.rst18
-rw-r--r--user_guide_src/source/helpers/file_helper.rst3
-rw-r--r--user_guide_src/source/helpers/security_helper.rst6
-rw-r--r--user_guide_src/source/helpers/string_helper.rst3
-rw-r--r--user_guide_src/source/installation/upgrade_300.rst4
-rw-r--r--user_guide_src/source/installation/upgrading.rst3
-rw-r--r--user_guide_src/source/libraries/email.rst8
-rw-r--r--user_guide_src/source/libraries/file_uploading.rst4
-rw-r--r--user_guide_src/source/libraries/form_validation.rst7
-rw-r--r--user_guide_src/source/libraries/input.rst43
-rw-r--r--user_guide_src/source/libraries/output.rst4
-rw-r--r--user_guide_src/source/libraries/pagination.rst24
-rw-r--r--user_guide_src/source/libraries/sessions.rst2
-rw-r--r--user_guide_src/source/libraries/uri.rst2
18 files changed, 190 insertions, 89 deletions
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 587e56ea7..7748f9b37 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -23,50 +23,62 @@ Release Date: Not Released
- Added an optional backtrace to php-error template.
- Added Android to the list of user agents.
- Added Windows 7, Android, Blackberry and iOS to the list of user platforms.
+ - Added Fennec (Firefox for mobile) to the list of mobile user agents.
- Ability to log certain error types, not all under a threshold.
- Added support for pem, p10, p12, p7a, p7c, p7m, p7r, p7s, crt, crl, der, kdb, rsa, cer, sst, csr Certs to mimes.php.
- Added support for pgp and gpg to mimes.php.
- 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
+ - Added support for ics Calendar files to mimes.php
+ - Updated support for xml ('application/xml') and xsl ('application/xml', 'text/xsl') files in 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.
+ - Added some more doctypes.
+ - Added Romanian and Greek characters in foreign_characters.php.
- Changed logger to only chmod when file is first created.
- Removed previously deprecated SHA1 Library.
- Removed previously deprecated use of ``$autoload['core']`` in application/config/autoload.php.
Only entries in ``$autoload['libraries']`` are auto-loaded now.
- - Added some more doctypes.
+ - Removed previously deprecated EXT constant.
- Updated all classes to be written in PHP 5 style, with visibility declarations and no ``var`` usage for properties.
- Moved error templates to "application/views/errors"
- - Global config files are loaded first, then environment ones. Environment config keys overwrite base ones, allowing to only set the keys we want changed per Env.
+ - Global config files are loaded first, then environment ones. Environment config keys overwrite base ones, allowing to only set the keys we want changed per environment.
+ - Changed detection of ``$view_folder`` so that if it's not found in the current path, it will now also be searched for under the application folder.
+ - Path constants BASEPATH, APPPATH and VIEWPATH are now (internally) defined as absolute paths.
- Helpers
- - create_captcha() accepts additional colors parameter, allowing for color customization
- - url_title() will now trim extra dashes from beginning and end.
+ - :doc:`Date Helper <helpers/date_helper>` function now() now works with all timezone strings supported by PHP.
+ - ``create_captcha()`` accepts additional colors parameter, allowing for color customization.
+ - ``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.
+ - 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).
- Added an optional third parameter to ``timespan()`` that constrains the number of time units displayed.
- - Added a work-around in force_download() for a bug Android <= 2.1, where the filename extension needs to be in uppercase.
- - 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.
- - Removed deprecated helper function ``js_insert_smiley()`` from smiley helper.
+ - Added a work-around in ``force_download()`` for a bug Android <= 2.1, where the filename extension needs to be in uppercase.
+ - ``form_dropdown()`` will now also take an array for unity with other form helpers.
+ - ``do_hash()`` now uses PHP's native ``hash()`` function (supporting more algorithms) and is deprecated.
+ - Removed previously deprecated helper function ``js_insert_smiley()`` from smiley helper.
+ - :doc:`File Helper <helpers/file_helper>` changes include:
+ - ``set_realpath()`` can now also handle file paths as opposed to just directories.
+ - Added an optional paramater to ``delete_files()`` to enable it to skip deleting files such as .htaccess and index.html.
+ - ``read_file()`` is now a deprecated alias of ``file_get_contents()``.
- Database
- - Renamed the Active Record class to Query Builder to remove confusion with the Active Record design pattern.
- - Added the ability to insert objects with insert_batch() in :doc:`Query Builder <database/query_builder>`.
- - Added new :doc:`Query Builder <database/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().
- - Adding $escape parameter to the order_by() method, this enables ordering by custom fields.
+ - :doc:`Query Builder <database/query_builder>` changes include:
+ - Renamed the Active Record class to Query Builder to remove confusion with the Active Record design pattern.
+ - Added the ability to insert objects with insert_batch().
+ - Added new methods that return the SQL string of queries without executing them: get_compiled_select(), get_compiled_insert(), get_compiled_update(), get_compiled_delete().
+ - Added an optional order_by() parameter that allows to disable escaping (useful for custom fields).
+ - Added an optional join() parameter that allows to disable escaping.
+ - Added support for join() with multiple conditions.
- 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.
+ - 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 support for backup() in :doc:`Database Utilities <database/utilities>`.
- Added 'dsn' configuration setting for drivers that support DSN strings (PDO, PostgreSQL, Oracle, ODBC, CUBRID).
- Improved PDO database support.
- Added Interbase/Firebird database support via the "interbase" driver.
@@ -74,34 +86,41 @@ Release Date: Not Released
- 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).
- - Added boolean data type support in escape().
- - Added update_batch() support.
+ - pg_version() is now used to get the database version number, when possible.
+ - Added db_set_charset() support.
+ - Added support for optimize_table() in :doc:`Database Utilities <database/utilities>` (rebuilds table indexes).
+ - Added boolean data type support in escape().
+ - Added update_batch() support.
+ - Removed limit() and order_by() support for UPDATE and DELETE queries in as PostgreSQL does not support those features.
- 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 internal method _protect_identifiers() to it instead - it was just an alias.
+ - Renamed internal method _escape_identifiers() to escape_identifiers().
+ - Updated escape_identifiers() to accept an array of fields as well as strings.
- 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.
- - Added persistent connections support for CUBRID.
- - Added random ordering support for MSSQL, SQLSRV.
- Added support for SQLite3 database driver.
+ - Improved support of the CUBRID driver, including:
+ - Added DSN string support.
+ - Added persistent connections support.
+ - Improved list_databases() in :doc:`Database Utility <database/utilities>` (until now only the currently used database was returned).
+ - Improved support of the MSSQL and SQLSRV drivers, including:
+ - Added random ordering support.
+ - Added support for optimize_table() in :doc:`Database Utility <database/utilities>`.
+ - Added escaping with QUOTE_IDENTIFIER setting detection.
+ - Added port handling support for UNIX-based systems (MSSQL driver).
+ - Added OFFSET support for SQL Server 2005 and above.
- 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 <database/forge>`.
- - Added support for listing database schemas to :doc:`Database Utilities <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.
- - Added replace() support for SQLite.
- - Renamed internal method _escape_identifiers() to escape_identifiers().
- - Added SQLite support for drop_table() in :doc:`Database Forge <database/forge>`.
+ - Added DSN string support (Easy Connect and TNS).
+ - Added support for drop_table() in :doc:`Database Forge <database/forge>`.
+ - Added support for list_databases() in :doc:`Database Utilities <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.
+ - Improved support of the SQLite driver, including:
+ - Added support for replace() in :doc:`Query Builder <database/query_builder>`.
+ - Added support for drop_table() in :doc:`Database Forge <database/forge>`.
- Added ODBC support for create_database(), drop_database() and drop_table() in :doc:`Database Forge <database/forge>`.
- Added PDO support for create_database(), drop_database and drop_table() in :doc:`Database Forge <database/forge>`.
- - Added MSSQL, SQLSRV support for optimize_table() in :doc:`Database Utility <database/utilities>`.
- - Improved CUBRID support for list_databases() in :doc:`Database Utility <database/utilities>` (until now only the currently used database was returned).
- Added unbuffered_row() method for getting a row without prefetching whole result (consume less memory).
- Libraries
@@ -129,11 +148,16 @@ Release Date: Not Released
- _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.
+ - Updated set_rules() to accept an array of rules as well as a string.
- Changed the :doc:`Session Library <libraries/sessions>` 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 :doc:`Caching Library <libraries/caching>`.
+ - Added a Redis driver to the :doc:`Caching Library <libraries/caching>`.
- Added dsn (delivery status notification) option to the :doc:`Email Library <libraries/email>`.
+ - Renamed method _set_header() to set_header() and made it public to enable adding custom headers in the :doc:`Email Library <libraries/email>`.
+ - Added an "index" parameter to the data() method in the :doc:`Upload Library <libraries/file_uploading>`.
+ - Added support for the anchor "rel" attribute in the :doc:`Pagination Library <libraries/pagination>`.
- Core
@@ -147,6 +171,9 @@ Release Date: Not Released
- 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 <general/hooks>`.
- Added get_content_type() method to the :doc:`Output Library <libraries/output>`.
+ - Added get_mimes() function to system/core/Commons.php to return the config/mimes.php array.
+ - Added a second argument to set_content_type() in the :doc:`Output Library <libraries/output>` that allows setting the document charset as well.
+ - $config['time_reference'] now supports all timezone strings supported by PHP.
Bug fixes for 3.0
------------------
@@ -154,7 +181,7 @@ Bug fixes for 3.0
- Fixed a bug where ``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 (#159, #163) that mishandled Query Builder 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 (#737, #75) - :doc:`Pagination <libraries/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.
- Fixed a bug (#724) - is_unique in form validation now checks that you are connected to a database.
- Fixed a bug (#647) - _get_mod_time() in Zip library no longer generates stat failed errors.
@@ -165,7 +192,7 @@ Bug fixes for 3.0
- Fixed a bug (#797) - timespan() was using incorrect seconds for year and month.
- Fixed a bug in CI_Cart::contents() where if called without a TRUE (or equal) parameter, it would fail due to a typo.
- Fixed a bug (#696) - make oci_execute() calls inside num_rows() non-committing, since they are only there to reset which row is next in line for oci_fetch calls and thus don't need to be committed.
-- Fixed a bug (#406) - sqlsrv DB driver not returning resource on ``db_pconnect()``.
+- Fixed a bug (#406) - SQLSRV DB driver not returning 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.
- Fixed a bug in the :doc:`Pagination library <libraries/pagination>` where when use_page_numbers=TRUE previous link and page 1 link did not have the same url.
- Fixed a bug (#561) - Errors in :doc:`XML-RPC Library <libraries/xmlrpc>` were not properly escaped.
@@ -223,19 +250,39 @@ Bug fixes for 3.0
- Fixed a bug (#121) - ``CI_DB_result::row()`` returned an array when there's no actual result to be returned.
- Fixed a bug (#319) - SQLSRV's affected_rows() method failed due to a scrollable cursor being created for write-type queries.
- Fixed a bug (#356) - PostgreSQL driver didn't have an _update_batch() method, which resulted in fatal error being triggered when update_batch() is used with it.
-- Fixed a bug (#862) - create_table() failed on SQLSRV/MSSQL when used with 'IF NOT EXISTS'.
+- Fixed a bug (#784, #862) - :doc:`Database Forge <database/forge>` method ``create_table()`` failed on SQLSRV/MSSQL when used with 'IF NOT EXISTS'.
- Fixed a bug (#1419) - libraries/Driver.php had a static variable that was causing an error.
+- Fixed a bug (#1411) - the :doc:`Email library <libraries/email>` used its own short list of MIMEs instead the one from config/mimes.php.
+- Fixed a bug where the magic_quotes_runtime setting wasn't turned off for PHP 5.3 (where it is indeed deprecated, but not non-existent).
+- Fixed a bug (#666) - :doc:`Output library <libraries/output>`'s set_content_type() method didn't set the document charset.
+- Fixed a bug (#784, #861) - :doc:`Database Forge <database/forge>` method ``create_table()`` used to accept constraints for MSSQL/SQLSRV integer-type columns.
+- Fixed a bug (#706) - SQLSRV/MSSSQL didn't escape field names.
+- Fixed a bug (#1452) - protect_identifiers() didn't properly detect identifiers with spaces in their names.
+- Fixed a bug where protect_identifiers() ignored it's extra arguments when the value passed to it is an array.
+- Fixed a bug where _has_operator() didn't detect BETWEEN.
+- Fixed a bug in :doc:`Query Builder <database/query_builder>`'s join() method where it failed with identifiers containing dashes.
+- Fixed a bug (#1264) - :doc:`Database Forge <database/forge>` and :doc:`Database Utilities <database/utilities>` didn't update/reset the databases and tables list cache when a table or a database is created, dropped or renamed.
+- Fixed a bug (#7) - :doc:`Query Builder <database/query_builder>`'s join() method only escaped one set of conditions.
+- Fixed a bug (#1321) - Core Exceptions class couldn't find the errors/ folder in some cases.
+- Fixed a bug in the File-based :doc:`Cache Library <libraries/caching>` driver's get_metadata() method where a non-existent array key was accessed for the TTL value.
+- Fixed a bug (#1202) - :doc:`Encryption Library <libraries/encryption>` encode_from_legacy() didn't set back the encrypt mode on failure.
+- Fixed a bug (#145) - compile_binds() failed when the bind marker was present in a literal string within the query.
+- Fixed a bug in protect_identifiers() where if passed along with the field names, operators got escaped as well.
+- Fixed a bug (#10) - :doc:`URI Library <libraries/uri>` internal method _detect_uri() failed with paths containing a colon.
+- Fixed a bug (#1387) - :doc:`Query Builder <database/query_builder>`'s from() method didn't escape table aliases.
Version 2.1.1
=============
-Release Date: Not Released
+Release Date: June 13, 2012
- 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>`.
+ - Added support for IPv6 to the :doc:`Input Library <libraries/input>`.
+ - Added support for the IP format parameter to the :doc:`Form Validation Library <libraries/form_validation>`.
- Helpers
- url_title() performance and output improved. You can now use any string as the word delimiter, but 'dash' and 'underscore' are still supported.
@@ -250,6 +297,8 @@ Bug fixes for 2.1.1
- 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.
- Fixed a bug - CSRF cookie value was allowed to be any (non-empty) string before being written to the output, making code injection a risk.
- Fixed a bug (#726) - PDO put a 'dbname' argument in it's connection string regardless of the database platform in use, which made it impossible to use SQLite.
+- Fixed a bug - CI_DB_pdo_driver::num_rows() was not returning properly value with SELECT queries, cause it was relying on PDOStatement::rowCount().
+- Fixed a bug (#1059) - CI_Image_lib::clear() was not correctly clearing all necessary object properties, namely width and height.
Version 2.1.0
=============
diff --git a/user_guide_src/source/general/common_functions.rst b/user_guide_src/source/general/common_functions.rst
index 70563b8d2..99126f900 100644
--- a/user_guide_src/source/general/common_functions.rst
+++ b/user_guide_src/source/general/common_functions.rst
@@ -79,3 +79,8 @@ html_escape($mixed)
This function provides short cut for htmlspecialchars() function. It
accepts string and array. To prevent Cross Site Scripting (XSS), it is
very useful.
+
+get_mimes()
+=============
+
+This function returns the MIMEs array from config/mimes.php. \ No newline at end of file
diff --git a/user_guide_src/source/general/core_classes.rst b/user_guide_src/source/general/core_classes.rst
index ac41407f7..4aa6693f7 100644
--- a/user_guide_src/source/general/core_classes.rst
+++ b/user_guide_src/source/general/core_classes.rst
@@ -31,6 +31,7 @@ time CodeIgniter runs:
- Log
- Output
- Router
+- Security
- URI
- Utf8
diff --git a/user_guide_src/source/general/requirements.rst b/user_guide_src/source/general/requirements.rst
index d97b7b4b2..d9edfba6d 100644
--- a/user_guide_src/source/general/requirements.rst
+++ b/user_guide_src/source/general/requirements.rst
@@ -4,5 +4,6 @@ Server Requirements
- `PHP <http://www.php.net/>`_ 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, SQLSRV, Oracle,
- PostgreSQL, SQLite, SQLite3, CUBRID, Interbase, ODBC and PDO.
+ supported databases are MySQL (5.1+), MySQLi, Oracle, PostgreSQL,
+ MS SQL, SQLSRV (SQL Server 2005+), SQLite, SQLite3, CUBRID, Interbase,
+ ODBC and PDO.
diff --git a/user_guide_src/source/helpers/date_helper.rst b/user_guide_src/source/helpers/date_helper.rst
index 18216c5a2..1b7177fc2 100644
--- a/user_guide_src/source/helpers/date_helper.rst
+++ b/user_guide_src/source/helpers/date_helper.rst
@@ -21,13 +21,21 @@ now()
=====
Returns the current time as a Unix timestamp, referenced either to your
-server's local time or GMT, based on the "time reference" setting in
-your config file. If you do not intend to set your master time reference
-to GMT (which you'll typically do if you run a site that lets each user
-set their own timezone settings) there is no benefit to using this
+server's local time or any PHP suported timezone, based on the "time reference"
+setting in your config file. If you do not intend to set your master time reference
+to any other PHP suported timezone (which you'll typically do if you run a site that
+lets each user set their own timezone settings) there is no benefit to using this
function over PHP's time() function.
-.. php:method:: now()
+.. php:method:: now($timezone = NULL)
+
+ :param string $timezone: The timezone you want to be returned
+ :returns: integer
+
+::
+ echo now("Australia/Victoria");
+
+If a timezone is not provided, it will return time() based on "time_reference" setting.
mdate()
=======
diff --git a/user_guide_src/source/helpers/file_helper.rst b/user_guide_src/source/helpers/file_helper.rst
index bfc271eb3..60c5aa98c 100644
--- a/user_guide_src/source/helpers/file_helper.rst
+++ b/user_guide_src/source/helpers/file_helper.rst
@@ -32,6 +32,9 @@ The path can be a relative or full server path. Returns FALSE (boolean) on failu
controller or view files. CodeIgniter uses a front controller so paths
are always relative to the main site index.
+.. note:: This function is DEPRECATED. Use the native ``file_get_contents()``
+ instead.
+
If your server is running an `open_basedir` restriction this function might not work if you are trying to access a file above the calling script.
write_file('path', $data)
diff --git a/user_guide_src/source/helpers/security_helper.rst b/user_guide_src/source/helpers/security_helper.rst
index b1bcf2b4a..ec0be28b3 100644
--- a/user_guide_src/source/helpers/security_helper.rst
+++ b/user_guide_src/source/helpers/security_helper.rst
@@ -43,8 +43,10 @@ for a full list of supported algorithms.
$str = do_hash($str); // SHA1
$str = do_hash($str, 'md5'); // MD5
-.. note:: This function was formerly named dohash(), which has been
- removed in favor of `do_hash()`.
+.. note:: This function was formerly named ``dohash()``, which has been
+ removed in favor of ``do_hash()``.
+
+.. note:: This function is DEPRECATED. Use the native ``hash()`` instead.
strip_image_tags()
==================
diff --git a/user_guide_src/source/helpers/string_helper.rst b/user_guide_src/source/helpers/string_helper.rst
index 2d23fb00c..19500aa0d 100644
--- a/user_guide_src/source/helpers/string_helper.rst
+++ b/user_guide_src/source/helpers/string_helper.rst
@@ -36,8 +36,7 @@ alpha, alunum, numeric, nozero, unique, md5, encrypt and sha1
- **unique**: Encrypted with MD5 and uniqid(). Note: The length
parameter is not available for this type. Returns a fixed length 32
character string.
-- **sha1**: An encrypted random number based on do_hash() from the
- :doc:`security helper <security_helper>`.
+- **sha1**: An encrypted random number based on ``sha1()``.
Usage example
diff --git a/user_guide_src/source/installation/upgrade_300.rst b/user_guide_src/source/installation/upgrade_300.rst
index 63c4227dc..c70737cff 100644
--- a/user_guide_src/source/installation/upgrade_300.rst
+++ b/user_guide_src/source/installation/upgrade_300.rst
@@ -41,8 +41,8 @@ need to rename the `$active_record` variable to `$query_builder`.
$active_group = 'default';
// $active_record = TRUE;
$query_builder = TRUE;
-
+
Step 5: Move your errors folder
===============================
-In version 3.0.0, the errors folder has been moved from "application/errors" to "application/views/errors". \ No newline at end of file
+In version 3.0.0, the errors folder has been moved from _application/errors_ to _application/views/errors_. \ No newline at end of file
diff --git a/user_guide_src/source/installation/upgrading.rst b/user_guide_src/source/installation/upgrading.rst
index 2badffc93..255c6a557 100644
--- a/user_guide_src/source/installation/upgrading.rst
+++ b/user_guide_src/source/installation/upgrading.rst
@@ -5,7 +5,8 @@ Upgrading From a Previous Version
Please read the upgrade notes corresponding to the version you are
upgrading from.
-- :doc:`Upgrading from 2.0.3 to 2.1.0 <upgrade_210>`
+- :doc:`Upgrading from 2.1.1 to 3.0.0 <upgrade_300>`
+- :doc:`Upgrading from 2.1.0 to 2.1.1 <upgrade_211>`
- :doc:`Upgrading from 2.0.2 to 2.0.3 <upgrade_203>`
- :doc:`Upgrading from 2.0.1 to 2.0.2 <upgrade_202>`
- :doc:`Upgrading from 2.0 to 2.0.1 <upgrade_201>`
diff --git a/user_guide_src/source/libraries/email.rst b/user_guide_src/source/libraries/email.rst
index daf000907..f99eb91df 100644
--- a/user_guide_src/source/libraries/email.rst
+++ b/user_guide_src/source/libraries/email.rst
@@ -182,6 +182,14 @@ formatting which is added to the header string for people who do not
accept HTML email. If you do not set your own message CodeIgniter will
extract the message from your HTML email and strip the tags.
+$this->email->set_header()
+-----------------------
+
+Appends additional headers to the e-mail::
+
+ $this->email->set_header('Header1', 'Value1');
+ $this->email->set_header('Header2', 'Value2');
+
$this->email->clear()
---------------------
diff --git a/user_guide_src/source/libraries/file_uploading.rst b/user_guide_src/source/libraries/file_uploading.rst
index d573fc770..414d84f0b 100644
--- a/user_guide_src/source/libraries/file_uploading.rst
+++ b/user_guide_src/source/libraries/file_uploading.rst
@@ -287,6 +287,10 @@ data related to the file you uploaded. Here is the array prototype::
[image_size_str] => width="800" height="200"
)
+To return one element from the array::
+
+ $this->upload->data('file_name'); // Returns: mypic.jpg
+
Explanation
***********
diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst
index 028b61c4c..3bcad7ba6 100644
--- a/user_guide_src/source/libraries/form_validation.rst
+++ b/user_guide_src/source/libraries/form_validation.rst
@@ -304,6 +304,10 @@ Give it a try! Submit your form without the proper data and you'll see
new error messages that correspond to your new rules. There are numerous
rules available which you can read about in the validation reference.
+.. note:: You can also pass an array of rules to set_rules(), instead of a string. Example::
+
+ $this->form_validation->set_rules('username', 'Username', array('required', 'min_length[5]'));
+
Prepping Data
=============
@@ -884,6 +888,7 @@ Rule Parameter Description
**valid_email** No Returns FALSE if the form element does not contain a valid email address.
**valid_emails** No Returns FALSE if any value provided in a comma separated list is not a valid email.
**valid_ip** No Returns FALSE if the supplied IP is not valid.
+ Accepts an optional parameter of 'ipv4' or 'ipv6' to specify an IP format.
**valid_base64** No Returns FALSE if the supplied string contains anything other than valid Base64 characters.
========================= ========== ============================================================================================= =======================
@@ -934,7 +939,7 @@ $this->form_validation->set_rules();
:param string $field: The field name
:param string $label: The field label
- :param string $rules: The rules, seperated by a pipe "|"
+ :param mixed $rules: The rules, as a string with rules separated by a pipe "|", or an array or rules.
:rtype: Object
Permits you to set validation rules, as described in the tutorial
diff --git a/user_guide_src/source/libraries/input.rst b/user_guide_src/source/libraries/input.rst
index 432bac3c7..c0b9c6589 100644
--- a/user_guide_src/source/libraries/input.rst
+++ b/user_guide_src/source/libraries/input.rst
@@ -42,14 +42,14 @@ this::
Please refer to the :doc:`Security class <security>` documentation for
information on using XSS Filtering in your application.
-Using POST, COOKIE, or SERVER Data
-==================================
+Using POST, GET, COOKIE, or SERVER Data
+=======================================
-CodeIgniter comes with three helper functions that let you fetch POST,
+CodeIgniter comes with four helper methods that let you fetch POST, GET,
COOKIE or SERVER items. The main advantage of using the provided
functions rather than fetching an item directly ($_POST['something'])
-is that the functions will check to see if the item is set and return
-false (boolean) if not. This lets you conveniently use data without
+is that the methods will check to see if the item is set and return
+NULL if not. This lets you conveniently use data without
having to test whether an item exists first. In other words, normally
you might do something like this::
@@ -59,9 +59,10 @@ With CodeIgniter's built in functions you can simply do this::
$something = $this->input->post('something');
-The three functions are:
+The four methods are:
- $this->input->post()
+- $this->input->get()
- $this->input->cookie()
- $this->input->server()
@@ -73,8 +74,8 @@ looking for::
$this->input->post('some_data');
-The function returns FALSE (boolean) if the item you are attempting to
-retrieve does not exist.
+The function returns NULL if the item you are attempting to retrieve
+does not exist.
The second optional parameter lets you run the data through the XSS
filter. It's enabled by setting the second parameter to boolean TRUE;
@@ -130,7 +131,9 @@ $this->input->cookie()
This function is identical to the post function, only it fetches cookie
data::
- $this->input->cookie('some_data', TRUE);
+ $this->input->cookie('some_cookie');
+ $this->input->cookie('some_cookie, TRUE); // with XSS filter
+
$this->input->server()
======================
@@ -195,25 +198,6 @@ parameters::
$this->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure);
-$this->input->cookie()
-======================
-
-Lets you fetch a cookie. The first parameter will contain the name of
-the cookie you are looking for (including any prefixes)::
-
- cookie('some_cookie');
-
-The function returns NULL if the item you are attempting to
-retrieve does not exist.
-
-The second optional parameter lets you run the data through the XSS
-filter. It's enabled by setting the second parameter to boolean TRUE;
-
-::
-
- cookie('some_cookie', TRUE);
-
-
$this->input->ip_address()
===========================
@@ -242,6 +226,9 @@ validates the IP automatically.
echo 'Valid';
}
+Accepts an optional second string parameter of 'ipv4' or 'ipv6' to specify
+an IP format. The default checks for both formats.
+
$this->input->user_agent()
===========================
diff --git a/user_guide_src/source/libraries/output.rst b/user_guide_src/source/libraries/output.rst
index baceaae7b..0472d14cf 100644
--- a/user_guide_src/source/libraries/output.rst
+++ b/user_guide_src/source/libraries/output.rst
@@ -49,6 +49,10 @@ 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.
+You can also set the character set of the document, by passing a second argument::
+
+ $this->output->set_content_type('css', 'utf-8');
+
$this->output->get_content_type();
==========================================
diff --git a/user_guide_src/source/libraries/pagination.rst b/user_guide_src/source/libraries/pagination.rst
index f1653c913..560755fb6 100644
--- a/user_guide_src/source/libraries/pagination.rst
+++ b/user_guide_src/source/libraries/pagination.rst
@@ -254,3 +254,27 @@ Adding a class to every anchor
If you want to add a class attribute to every link rendered by the
pagination class, you can set the config "anchor_class" equal to the
classname you want.
+
+::
+
+ $config['anchor_class'] = 'myclass'; // class="myclass"
+
+**********************************
+Changing the "rel" attribute value
+**********************************
+
+By default, the rel attribute will be automatically put under the
+following conditions:
+
+- rel="start" for the "first" link
+- rel="prev" for the "previous" link
+- rel="next" for the "next" link
+
+If you want to disable the rel attribute, or change its value, you
+can set the 'attr_rel' config option::
+
+ // Disable
+ $config['attr_rel'] = FALSE;
+
+ // Use a custom value on all anchors
+ $config['attr_rel'] = 'custom_value'; // produces: rel="custom_value" \ No newline at end of file
diff --git a/user_guide_src/source/libraries/sessions.rst b/user_guide_src/source/libraries/sessions.rst
index e8332ee97..5400524a9 100644
--- a/user_guide_src/source/libraries/sessions.rst
+++ b/user_guide_src/source/libraries/sessions.rst
@@ -245,7 +245,7 @@ session class::
CREATE TABLE IF NOT EXISTS `ci_sessions` (
session_id varchar(40) DEFAULT '0' NOT NULL,
- ip_address varchar(16) DEFAULT '0' NOT NULL,
+ ip_address varchar(45) DEFAULT '0' NOT NULL,
user_agent varchar(120) NOT NULL,
last_activity int(10) unsigned DEFAULT 0 NOT NULL,
user_data text NOT NULL,
diff --git a/user_guide_src/source/libraries/uri.rst b/user_guide_src/source/libraries/uri.rst
index cdd76e322..bb959b002 100644
--- a/user_guide_src/source/libraries/uri.rst
+++ b/user_guide_src/source/libraries/uri.rst
@@ -146,7 +146,7 @@ full URL::
The function would return this::
- /news/local/345
+ news/local/345
$this->uri->ruri_string()
==========================