summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-07 21:34:38 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-07 21:34:38 +0200
commitfeec9db5e6514f242e17b4504536d746660fd02c (patch)
treecec0ce356bd58892b9b3af50d14c2eb70c9b5b48 /user_guide_src/source
parentbd738c80a623700b3b11e876abb764ca6d57769d (diff)
parent25c08390bd93ba27d89a8682b37c8c6184a53c07 (diff)
Merge upstream branch
Diffstat (limited to 'user_guide_src/source')
-rw-r--r--user_guide_src/source/changelog.rst105
-rw-r--r--user_guide_src/source/database/results.rst20
-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/environments.rst10
-rw-r--r--user_guide_src/source/general/models.rst14
-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_200.rst9
-rw-r--r--user_guide_src/source/installation/upgrade_300.rst7
-rw-r--r--user_guide_src/source/libraries/config.rst12
-rw-r--r--user_guide_src/source/libraries/email.rst8
-rw-r--r--user_guide_src/source/libraries/input.rst17
-rw-r--r--user_guide_src/source/libraries/loader.rst6
-rw-r--r--user_guide_src/source/libraries/output.rst4
-rw-r--r--user_guide_src/source/libraries/uri.rst2
17 files changed, 156 insertions, 76 deletions
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index bdb418f86..66da20c40 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -9,8 +9,7 @@ Release Date: Not Released
- License
- - CodeIgniter has been relicensed with the Open Software License (3.0),
- eliminating its old proprietary licensing.
+ - CodeIgniter has been relicensed with the Open Software License (3.0), eliminating its old proprietary licensing.
- All system files are licensed with OSL 3.0.
- Config, error, and sample files shipped in the application folder are
@@ -20,9 +19,11 @@ Release Date: Not Released
- General Changes
- PHP 5.1.6 is no longer supported. CodeIgniter now requires PHP 5.2.4.
+ - ``$_SERVER['CI_ENV']`` can now be set to control the ``ENVIRONMENT`` constant.
- Added an optional backtrace to php-error template.
- Added Android to the list of user agents.
- - Added Windows 7 to the list of user platforms.
+ - 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.
@@ -38,38 +39,40 @@ Release Date: Not Released
Only entries in ``$autoload['libraries']`` are auto-loaded now.
- Added some more doctypes.
- 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.
- Helpers
- - url_title() will now trim extra dashes from beginning and end.
+ - ``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.
+ - 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 new :doc:`Query Builder <database/query_builder>` methods that return
+ - 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 function, this enables ordering by custom fields.
+ - 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.
- 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' 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
+ - 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.
@@ -77,8 +80,10 @@ Release Date: Not Released
- 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.
+ - 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.
- 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).
@@ -100,6 +105,8 @@ Release Date: Not Released
- 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).
+ - Added port handling support for MSSQL on UNIX-based systems.
- Libraries
@@ -107,17 +114,15 @@ Release Date: Not Released
- CI_Loader::_ci_autoloader() is now a protected method.
- 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:
+ - :doc:`Cart library <libraries/cart>` 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
+ - 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 compatibility.
- :doc:`Image Manipulation library <libraries/image_lib>` 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
- if they are set manually after initialization.
+ - 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.
- :doc:`Form Validation library <libraries/form_validation>` changes include:
@@ -133,6 +138,8 @@ Release Date: Not Released
- Allowed for setting table class defaults in a config file.
- Added a Wincache driver to the :doc:`Caching Library <libraries/caching>`.
- Added dsn (delivery status notification) option to the :doc:`Email Library <libraries/email>`.
+ - Input library now supports IPv6.
+ - Renamed method _set_header() to set_header() and made it public to enable adding custom headers in the :doc:`Email Library <libraries/email>`.
- Core
@@ -146,30 +153,32 @@ 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.
Bug fixes for 3.0
------------------
-- Unlink raised an error if cache file did not exist when you try to delete it.
+- 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 Active Record nested transactions because _trans_depth was not getting incremented.
+- 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 (#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
-- Fixed a bug (#608) - Fixes an issue with the Image_lib class not clearing properties completely
-- Fixed bugs (#157 and #174) - the Image_lib clear() function now resets all variables to their default values.
+- Fixed a bug (#647) - _get_mod_time() in Zip library no longer generates stat failed errors.
+- Fixed a bug (#608) - Fixes an issue with the Image_lib class not clearing properties completely.
+- Fixed a bug (#157, #174) - the Image_lib clear() function now resets all variables to their default values.
- Fixed a bug where using $this->dbforge->create_table() with PostgreSQL database could lead to fetching whole table.
- Fixed a bug (#795) - Fixed form method and accept-charset when passing an empty array.
-- Fixed a bug (#797) - timespan was using incorrect seconds for year and month.
+- 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 reuturning resource on <samp>db_pconnect()</samp>.
+- 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 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 :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.
- 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 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.
@@ -180,7 +189,7 @@ Bug fixes for 3.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 (#1036) - is_write_type() method in the :doc:`Database Library <database/index>` didn't return TRUE for RENAME 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.
@@ -193,18 +202,18 @@ Bug fixes for 3.0
- Fixed a bug (#499) - a CSRF cookie was created even with CSRF protection being disabled.
- Fixed a bug (#306) - ODBC's insert_id() method was calling non-existent function odbc_insert_id(), which resulted in a fatal error.
- Fixed a bug in Oracle's DB_result class where the cursor id passed to it was always NULL.
-- Fixed a bug (#64) - Regular expression in DB_active_rec.php failed to handle queries containing SQL bracket delimiters in the join condition.
+- Fixed a bug (#64) - Regular expression in DB_query_builder.php failed to handle queries containing SQL bracket delimiters in the join condition.
- Fixed a bug in the :doc:`Session Library <libraries/sessions>` where a PHP E_NOTICE error was triggered by _unserialize() due to results from databases such as MSSQL and Oracle being space-padded on the right.
- 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 <libraries/form_validation>`.
- 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 (#136) - PostgreSQL, MySQL and MySQLi's escape_str() method 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 <database/forge>` didn't utilize the configured database character set.
- Fixed a bug (#23, #1238) - delete_all() in the `Database Caching Library <database/caching>` used to delete .htaccess and index.html files, which is a potential security risk.
- Fixed a bug in :doc:`Trackback Library <libraries/trackback>` 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 (#122) Where routed uri string was being reported incorrectly in sub-directories
+- Fixed a bug (#122) Where routed uri string was being reported incorrectly in sub-directories.
- Fixed a bug (#1242) - read_dir() in the :doc:`Zip Library <libraries/zip>` 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.
@@ -214,6 +223,20 @@ Bug fixes for 3.0
- 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.
- Fixed a bug (#128) - :doc:`Language Library <libraries/language>` did not correctly keep track of loaded language files.
+- Fixed a bug (#1242) - Added Windows path compatibility to function read_dir of ZIP library.
+- Fixed a bug (#1314) - sess_destroy() did not destroy userdata.
+- Fixed a bug (#1349) - get_extension() in the :doc:`File Uploading Library <libraries/file_uploading>` returned the original filename when it didn't have an actual extension.
+- Fixed a bug (#1273) - E_NOTICE being generated by :doc:`Query Builder <database/query_builder>`'s set_update_batch() method.
+- Fixed a bug (#44, #110) - :doc:`Upload library <libraries/file_uploading>`'s clean_file_name() method didn't clear '!' and '#' characters.
+- 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 (#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.
Version 2.1.1
=============
@@ -236,7 +259,9 @@ Bug fixes for 2.1.1
- 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
+- 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.
Version 2.1.0
=============
diff --git a/user_guide_src/source/database/results.rst b/user_guide_src/source/database/results.rst
index 865345762..ac4fc3733 100644
--- a/user_guide_src/source/database/results.rst
+++ b/user_guide_src/source/database/results.rst
@@ -136,6 +136,26 @@ parameter:
| **$row = $query->next_row('array')**
| **$row = $query->previous_row('array')**
+.. note:: all the functions above will load the whole result into memory (prefetching) use unbuffered_row() for processing large result sets.
+
+unbuffered_row($type)
+=====
+
+This function returns a single result row without prefetching the whole result in memory as row() does.
+If your query has more than one row, it returns the current row and moves the internal data pointer ahead.
+The result is returned as $type could be 'object' (default) or 'array' that will return an associative array.
+
+
+
+ $query = $this->db->query("YOUR QUERY");
+
+ while ($row = $query->unbuffered_row())
+ {
+ echo $row->title;
+ echo $row->name;
+ echo $row->body;
+ }
+
***********************
Result Helper Functions
***********************
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/environments.rst b/user_guide_src/source/general/environments.rst
index 40725feba..fa1b096e2 100644
--- a/user_guide_src/source/general/environments.rst
+++ b/user_guide_src/source/general/environments.rst
@@ -11,10 +11,16 @@ when "live".
The ENVIRONMENT Constant
========================
-By default, CodeIgniter comes with the environment constant set to
+By default, CodeIgniter comes with the environment constant set to use
+the value provided in ``$_SERVER['CI_ENV']``, otherwise defaults to
'development'. At the top of index.php, you will see::
- define('ENVIRONMENT', 'development');
+ define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
+
+This server variable can be set in your .htaccess file, or Apache
+config using `SetEnv <https://httpd.apache.org/docs/2.2/mod/mod_env.html#setenv>`_.
+Alternative methods are available for nginx and other servers, or you can
+remove this logic entirely and set the constant based on the HTTP_HOST or IP.
In addition to affecting some basic framework behavior (see the next
section), you may use this constant in your own development to
diff --git a/user_guide_src/source/general/models.rst b/user_guide_src/source/general/models.rst
index 0156b0460..87f63e416 100644
--- a/user_guide_src/source/general/models.rst
+++ b/user_guide_src/source/general/models.rst
@@ -16,7 +16,7 @@ blog. You might have a model class that contains functions to insert,
update, and retrieve your blog data. Here is an example of what such a
model class might look like::
- class Blogmodel extends CI_Model {
+ class Blog_model extends CI_Model {
var $title = '';
var $content = '';
@@ -104,7 +104,7 @@ Your models will typically be loaded and called from within your
:doc:`controller <controllers>` functions. To load a model you will use
the following function::
- $this->load->model('Model_name');
+ $this->load->model('model_name');
If your model is located in a sub-folder, include the relative path from
your models folder. For example, if you have a model located at
@@ -115,14 +115,14 @@ application/models/blog/queries.php you'll load it using::
Once loaded, you will access your model functions using an object with
the same name as your class::
- $this->load->model('Model_name');
+ $this->load->model('model_name');
- $this->Model_name->function();
+ $this->model_name->function();
If you would like your model assigned to a different object name you can
specify it via the second parameter of the loading function::
- $this->load->model('Model_name', 'fubar');
+ $this->load->model('model_name', 'fubar');
$this->fubar->function();
@@ -133,7 +133,7 @@ view::
function blog()
{
- $this->load->model('Blog');
+ $this->load->model('blog');
$data['query'] = $this->Blog->get_last_ten_entries();
@@ -165,7 +165,7 @@ database. The following options for connecting are available to you:
defined in your database config file will be used:
::
- $this->load->model('Model_name', '', TRUE);
+ $this->load->model('model_name', '', TRUE);
- You can manually pass database connectivity settings via the third
parameter::
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_200.rst b/user_guide_src/source/installation/upgrade_200.rst
index b39f4fd23..29f44bd9e 100644
--- a/user_guide_src/source/installation/upgrade_200.rst
+++ b/user_guide_src/source/installation/upgrade_200.rst
@@ -87,7 +87,14 @@ All native CodeIgniter classes now use the PHP 5 \__construct()
convention. Please update extended libraries to call
parent::\__construct().
-Step 8: Update your user guide
+Step 8: Move any core extensions to application/core
+====================================================
+
+Any extensions to core classes (e.g. MY_Controller.php) in your
+application/libraries folder must be moved to the new
+application/core folder.
+
+Step 9: Update your user guide
==============================
Please replace your local copy of the user guide with the new version,
diff --git a/user_guide_src/source/installation/upgrade_300.rst b/user_guide_src/source/installation/upgrade_300.rst
index e434e8d45..63c4227dc 100644
--- a/user_guide_src/source/installation/upgrade_300.rst
+++ b/user_guide_src/source/installation/upgrade_300.rst
@@ -40,4 +40,9 @@ 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
+ $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
diff --git a/user_guide_src/source/libraries/config.rst b/user_guide_src/source/libraries/config.rst
index c81cad7b3..08d9c2905 100644
--- a/user_guide_src/source/libraries/config.rst
+++ b/user_guide_src/source/libraries/config.rst
@@ -149,11 +149,13 @@ folders:
- Your own custom configuration files
.. note::
- CodeIgniter always tries to load the configuration files for
- the current environment first. If the file does not exist, the global
- config file (i.e., the one in application/config/) is loaded. This means
- you are not obligated to place **all** of your configuration files in an
- environment folder − only the files that change per environment.
+ CodeIgniter always loads the global config file first (i.e., the one in application/config/),
+ then tries to load the configuration files for the current environment.
+ This means you are not obligated to place **all** of your configuration files in an
+ environment folder. Only the files that change per environment. Additionally you don't
+ have to copy **all** the config items in the environment config file. Only the config items
+ that you wish to change for your environment. The config items declared in your environment
+ folders always overwrite those in your global config files.
Helper Functions
================
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/input.rst b/user_guide_src/source/libraries/input.rst
index 1f2ea650a..432bac3c7 100644
--- a/user_guide_src/source/libraries/input.rst
+++ b/user_guide_src/source/libraries/input.rst
@@ -18,7 +18,7 @@ The security filtering function is called automatically when a new
:doc:`controller <../general/controllers>` is invoked. It does the
following:
-- If $config['allow_get_array'] is FALSE(default is TRUE), destroys
+- If $config['allow_get_array'] is FALSE (default is TRUE), destroys
the global GET array.
- Destroys all global variables in the event register_globals is
turned on.
@@ -53,14 +53,7 @@ false (boolean) 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::
- if ( ! isset($_POST['something']))
- {
- $something = FALSE;
- }
- else
- {
- $something = $_POST['something'];
- }
+ $something = isset($_POST['something']) ? $_POST['something'] : NULL;
With CodeIgniter's built in functions you can simply do this::
@@ -95,7 +88,7 @@ To return an array of all POST items call without any parameters.
To return all POST items and pass them through the XSS filter set the
first parameter NULL while setting the second parameter to boolean;
-The function returns FALSE (boolean) if there are no items in the POST.
+The function returns NULL if there are no items in the POST.
::
@@ -115,7 +108,7 @@ To return an array of all GET items call without any parameters.
To return all GET items and pass them through the XSS filter set the
first parameter NULL while setting the second parameter to boolean;
-The function returns FALSE (boolean) if there are no items in the GET.
+The function returns NULL if there are no items in the GET.
::
@@ -210,7 +203,7 @@ the cookie you are looking for (including any prefixes)::
cookie('some_cookie');
-The function returns FALSE (boolean) if the item you are attempting to
+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
diff --git a/user_guide_src/source/libraries/loader.rst b/user_guide_src/source/libraries/loader.rst
index 2090404bf..aadf9740a 100644
--- a/user_guide_src/source/libraries/loader.rst
+++ b/user_guide_src/source/libraries/loader.rst
@@ -116,12 +116,12 @@ assign it to a variable if you want the data returned::
$string = $this->load->view('myfile', '', true);
-$this->load->model('Model_name');
+$this->load->model('model_name');
==================================
::
- $this->load->model('Model_name');
+ $this->load->model('model_name');
If your model is located in a sub-folder, include the relative path from
@@ -134,7 +134,7 @@ application/models/blog/queries.php you'll load it using::
If you would like your model assigned to a different object name you can
specify it via the second parameter of the loading function::
- $this->load->model('Model_name', 'fubar');
+ $this->load->model('model_name', 'fubar');
$this->fubar->function();
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/uri.rst b/user_guide_src/source/libraries/uri.rst
index ee60b77d7..cdd76e322 100644
--- a/user_guide_src/source/libraries/uri.rst
+++ b/user_guide_src/source/libraries/uri.rst
@@ -25,7 +25,7 @@ The segment numbers would be this:
#. metro
#. crime_is_up
-By default the function returns FALSE (boolean) if the segment does not
+By default the function returns NULL if the segment does not
exist. There is an optional second parameter that permits you to set
your own default value if the segment is missing. For example, this
would tell the function to return the number zero in the event of