diff options
Diffstat (limited to 'user_guide_src/source')
29 files changed, 666 insertions, 406 deletions
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index f5e2da738..8f5dfe540 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -19,6 +19,7 @@ Release Date: Not Released - General Changes - PHP 5.1.6 is no longer supported. CodeIgniter now requires PHP 5.2.4. + - Changed filenaming convention (class file names now must be Ucfirst and everything else in lowercase). - ``$_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. @@ -60,52 +61,78 @@ Release Date: Not Released - Helpers - :doc:`Date Helper <helpers/date_helper>` changes include: - - :php:func:`now()` now works with all timezone strings supported by PHP. - - Added an optional third parameter to :php:func:`timespan()` that constrains the number of time units displayed. - - Added an optional parameter to :php:func:`timezone_menu()` that allows more attributes to be added to the generated select tag. - - Deprecated ``standard_date()``, which now just uses the native ``date()`` with `DateTime constants <http://www.php.net/manual/en/class.datetime.php#datetime.constants.types>`_. - - Added function :php:func:`date_range()` that generates a list of dates between a specified period. + + - :php:func:`now()` now works with all timezone strings supported by PHP. + - Added an optional third parameter to :php:func:`timespan()` that constrains the number of time units displayed. + - Added an optional parameter to :php:func:`timezone_menu()` that allows more attributes to be added to the generated select tag. + - Deprecated ``standard_date()``, which now just uses the native ``date()`` with `DateTime constants <http://www.php.net/manual/en/class.datetime.php#datetime.constants.types>`_. + - Added function :php:func:`date_range()` that generates a list of dates between a specified period. + - :doc:`URL Helper <helpers/url_helper>` changes include: - - Deprecated *separator* options **dash** and **underscore** for function :php:func:`url_title()` (they are only aliases for '-' and '_' respectively). - - :php:func:`url_title()` will now trim extra dashes from beginning and end. - - :php:func:`anchor_popup()` will now fill the *href* attribute with the URL and its JS code will return FALSE instead. - - Added JS window name support to the :php:func:`anchor_popup()` function. - - Added support (auto-detection) for HTTP/1.1 response code 303 in :php:func:`redirect()`. - - Changed :php:func:`redirect()` to only choose the **refresh** method only on IIS servers, instead of all servers on Windows (when **auto** is used). - - Changed :php:func:`anchor()`, :php:func:`anchor_popup()`, and :php:func:`redirect()` to support protocol-relative URLs (e.g. *//ellislab.com/codeigniter*). + + - Deprecated *separator* options **dash** and **underscore** for function :php:func:`url_title()` (they are only aliases for '-' and '_' respectively). + - :php:func:`url_title()` will now trim extra dashes from beginning and end. + - :php:func:`anchor_popup()` will now fill the *href* attribute with the URL and its JS code will return FALSE instead. + - Added JS window name support to the :php:func:`anchor_popup()` function. + - Added support (auto-detection) for HTTP/1.1 response code 303 in :php:func:`redirect()`. + - Changed :php:func:`redirect()` to choose the **refresh** method only on IIS servers, instead of all servers on Windows (when **auto** is used). + - Changed :php:func:`anchor()`, :php:func:`anchor_popup()`, and :php:func:`redirect()` to support protocol-relative URLs (e.g. *//ellislab.com/codeigniter*). + - Added an optional second parameter to both :php:func:`base_url()` and :php:func:`site_url()` that allows enforcing of a protocol different than the one in the *base_url* configuration setting. + - :doc:`HTML Helper <helpers/html_helper>` changes include: - - Added more doctypes. - - Changed application and environment config files to be loaded in a cascade-like manner. - - The doctypes array is now cached and loaded only once. + + - Added more doctypes. + - Changed application and environment config files to be loaded in a cascade-like manner. + - The doctypes array is now cached and loaded only once. + - :doc:`Inflector Helper <helpers/inflector_helper>` changes include: - - Changed :php:func:`humanize()` to allow passing an input separator as its second parameter. - - Refactored :php:func:`plural()` and :php:func:`singular()` to avoid double pluralization and support more words. + + - Changed :php:func:`humanize()` to allow passing an input separator as its second parameter. + - Refactored :php:func:`plural()` and :php:func:`singular()` to avoid double pluralization and support more words. + - :doc:`Download Helper <helpers/download_helper>` changes include: - - Added an optional third parameter to :php:func:`force_download()` that enables/disables sending the actual file MIME type in the Content-Type header (disabled by default). - - Added a work-around in :php:func:`force_download()` for a bug Android <= 2.1, where the filename extension needs to be in uppercase. - - Added support for reading from an existing file path by passing NULL as the second parameter to :php:func:`force_download()` (useful for large files and/or safely transmitting binary data). + + - Added an optional third parameter to :php:func:`force_download()` that enables/disables sending the actual file MIME type in the Content-Type header (disabled by default). + - Added a work-around in :php:func:`force_download()` for a bug Android <= 2.1, where the filename extension needs to be in uppercase. + - Added support for reading from an existing file path by passing NULL as the second parameter to :php:func:`force_download()` (useful for large files and/or safely transmitting binary data). + - :doc:`Form Helper <helpers/form_helper>` changes include: - - :php:func:`form_dropdown()` will now also take an array for unity with other form helpers. - - :php:func:`form_prep()`'s second argument now only accepts a boolean value, which determines whether the value is escaped for a <textarea> or a regular <input> element. + + - :php:func:`form_dropdown()` will now also take an array for unity with other form helpers. + - :php:func:`form_prep()`'s second argument now only accepts a boolean value, which determines whether the value is escaped for a <textarea> or a regular <input> element. + - :doc:`Security Helper <helpers/security_helper>` changes include: - - :php:func:`do_hash()` now uses PHP's native ``hash()`` function (supporting more algorithms) and is deprecated. - - :php:func:`strip_image_tags()` is now an alias for the same method in the :doc:`Security Library <libraries/security>`. + + - :php:func:`do_hash()` now uses PHP's native ``hash()`` function (supporting more algorithms) and is deprecated. + - :php:func:`strip_image_tags()` is now an alias for the same method in the :doc:`Security Library <libraries/security>`. + - :doc:`Smiley Helper <helpers/smiley_helper>` changes include: - - Removed previously deprecated function ``js_insert_smiley()``. - - Changed application and environment config files to be loaded in a cascade-like manner. - - The smileys array is now cached and loaded only once. + + - Removed previously deprecated function ``js_insert_smiley()``. + - Changed application and environment config files to be loaded in a cascade-like manner. + - The smileys array is now cached and loaded only once. + - :doc:`File Helper <helpers/file_helper>` changes include: - - :php:func:`set_realpath()` can now also handle file paths as opposed to just directories. - - Added an optional paramater to :php:func:`delete_files()` to enable it to skip deleting files such as *.htaccess* and *index.html*. - - Deprecated function ``read_file()`` - it's just an alias for PHP's native ``file_get_contents()``. + + - :php:func:`set_realpath()` can now also handle file paths as opposed to just directories. + - Added an optional paramater to :php:func:`delete_files()` to enable it to skip deleting files such as *.htaccess* and *index.html*. + - Deprecated function ``read_file()`` - it's just an alias for PHP's native ``file_get_contents()``. + - :doc:`String Helper <helpers/string_helper>` changes include: - - Deprecated function ``repeater()`` - it's just an alias for PHP's native ``str_repeat()``. - - Deprecated function ``trim_slashes()`` - it's just an alias for PHP's native ``trim()`` (with a slash as its second argument). - - Deprecated randomization type options **unique** and **encrypt** for funcion :php:func:`random_string()` (they are only aliases for **md5** and **sha1** respectively). + + - Deprecated function ``repeater()`` - it's just an alias for PHP's native ``str_repeat()``. + - Deprecated function ``trim_slashes()`` - it's just an alias for PHP's native ``trim()`` (with a slash as its second argument). + - Deprecated randomization type options **unique** and **encrypt** for funcion :php:func:`random_string()` (they are only aliases for **md5** and **sha1** respectively). + + - :doc:`CAPTCHA Helper <helpers/captcha_helper>` changes include: + + - Added *word_length* and *pool* options to allow customization of the generated word. + - Added *colors* configuration to allow customization for the *background*, *border*, *text* and *grid* colors. + - :doc:`Directory Helper <helpers/directory_helper>` :php:func:`directory_map()` will now append ``DIRECTORY_SEPARATOR`` to directory names in the returned array. + - :doc:`Array Helper <helpers/array_helper>` :php:func:`element()` and :php:func:`elements()` now return NULL instead of FALSE when the required elements don't exist. - :doc:`Language Helper <helpers/language_helper>` :php:func:`lang()` now accepts an optional list of additional HTML attributes. - Deprecated the :doc:`Email Helper <helpers/email_helper>` as its ``valid_email()``, ``send_email()`` functions are now only aliases for PHP native functions ``filter_var()`` and ``mail()`` respectively. - - :doc:`CAPTCHA Helper <helpers/captcha_helper>` :php:func:`create_captcha` added word_length and pool options for setting length of randomly generated captcha word, and what characters to select from. - Database @@ -128,217 +155,295 @@ Release Date: Not Released - Added support for SQLite3 database driver. - Added Interbase/Firebird database support via the *ibase* driver. - Added ODBC support for ``create_database()``, ``drop_database()`` and ``drop_table()`` in :doc:`Database Forge <database/forge>`. + - :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 parameter that allows to disable escaping (useful for custom fields) for methods ``join()``, ``order_by()``, ``where_in()``, ``or_where_in()``, ``where_not_in()``, ``or_where_not_in()``, ``insert()``, ``insert_batch()``. - - Added support for ``join()`` with multiple conditions. - - Added support for *USING* in ``join()``. - - Added seed values support for random ordering with ``order_by(seed, 'RANDOM')``. - - Changed ``limit()`` to ignore NULL values instead of always casting to integer. - - Changed ``offset()`` to ignore empty values instead of always casting to integer. - - Methods ``insert_batch()`` and ``update_batch()`` now return an integer representing the number of rows affected by them. + + - 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 parameter that allows to disable escaping (useful for custom fields) for methods ``join()``, ``order_by()``, ``where_in()``, ``or_where_in()``, ``where_not_in()``, ``or_where_not_in()``, ``insert()``, ``insert_batch()``. + - Added support for ``join()`` with multiple conditions. + - Added support for *USING* in ``join()``. + - Added seed values support for random ordering with ``order_by(seed, 'RANDOM')``. + - Changed ``limit()`` to ignore NULL values instead of always casting to integer. + - Changed ``offset()`` to ignore empty values instead of always casting to integer. + - Methods ``insert_batch()`` and ``update_batch()`` now return an integer representing the number of rows affected by them. + - :doc:`Database Results <database/results>` changes include: - - 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. - - Added method ``unbuffered_row()`` for fetching a row without prefetching the whole result (consume less memory). - - Renamed former method ``_data_seek()`` to ``data_seek()`` and made it public. + + - 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. + - Added method ``unbuffered_row()`` for fetching a row without prefetching the whole result (consume less memory). + - Renamed former method ``_data_seek()`` to ``data_seek()`` and made it public. + - 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 support for ``backup()`` in :doc:`Database Utilities <database/utilities>`. + + - 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>`. + - Changed methods ``trans_begin()``, ``trans_commit()`` and ``trans_rollback()`` to use the PHP API instead of sending queries. + - Improved support of the PDO driver, including: - - Added support for ``create_database()``, ``drop_database()`` and ``drop_table()`` in :doc:`Database Forge <database/forge>`. - - Added support for ``list_fields()`` in :doc:`Database Results <database/results>`. - - Subdrivers are now isolated from each other instead of being in one large class. + + - Added support for ``create_database()``, ``drop_database()`` and ``drop_table()`` in :doc:`Database Forge <database/forge>`. + - Added support for ``list_fields()`` in :doc:`Database Results <database/results>`. + - Subdrivers are now isolated from each other instead of being in one large 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 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 as PostgreSQL does not support those features. - - Added a work-around for dead persistent connections to be re-created after a database restart. - - Changed ``db_connect()`` to include the (new) **schema** value into Postgre's **search_path** session variable. + + - ``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 as PostgreSQL does not support those features. + - Added a work-around for dead persistent connections to be re-created after a database restart. + - Changed ``db_connect()`` to include the (new) **schema** value into Postgre's **search_path** session variable. + - ``pg_escape_literal()`` is now used for escaping strings, if available. + - 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). + + - 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. - - Added ``db_set_charset()`` support (MSSQL driver). + + - 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. + - Added ``db_set_charset()`` support (MSSQL driver). + - Improved support of the Oracle (OCI8) driver, including: - - 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. - - ``num_rows()`` is now only called explicitly by the developer and no longer re-executes statements. + + - 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. + - ``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 support for ``replace()`` in :doc:`Query Builder <database/query_builder>`. + - Added support for ``drop_table()`` in :doc:`Database Forge <database/forge>`. + - :doc:`Database Forge <database/forge>` changes include: - - Added an optional second parameter to ``drop_table()`` that allows adding the **IF EXISTS** condition, which is no longer the default. - - Added support for passing a custom database object to the loader. - - Deprecated ``add_column()``'s third method. *AFTER* clause should now be added to the field definition array instead. - - Added support for usage of the *FIRST* clause in ``add_column()`` for MySQL and CUBRID. - - Overall improved support for all of the drivers. + + - Added an optional second parameter to ``drop_table()`` that allows adding the **IF EXISTS** condition, which is no longer the default. + - Added support for passing a custom database object to the loader. + - Deprecated ``add_column()``'s third method. *AFTER* clause should now be added to the field definition array instead. + - Added support for usage of the *FIRST* clause in ``add_column()`` for MySQL and CUBRID. + - Overall improved support for all of the drivers. + - :doc:`Database Utility <database/utilities>` changes include: - - Added support for passing a custom database object to the loader. - - Modified the class to no longer extend :doc:`Database Forge <database/forge>`, which has been a deprecated behavior for awhile. - - Overall improved support for all of the drivers. - - Added *foreign_key_checks* option to MySQL/MySQLi backup, allowing statement to disable/re-enable foreign key checks to be inserted into the backup output. + + - Added support for passing a custom database object to the loader. + - Modified the class to no longer extend :doc:`Database Forge <database/forge>`, which has been a deprecated behavior for awhile. + - Overall improved support for all of the drivers. + - Added *foreign_key_checks* option to MySQL/MySQLi backup, allowing statement to disable/re-enable foreign key checks to be inserted into the backup output. - Libraries - :doc:`Session Library <libraries/sessions>` changes include: - - Library changed to :doc:`Driver <general/drivers>` with classic Cookie driver as default. - - Added Native PHP Session driver to work with ``$_SESSION``. - - Custom drivers can be added anywhere in package paths and be loaded with the library. - - Drivers interchangeable on the fly. - - New **tempdata** feature allows setting user data items with an expiration time. - - Added default ``$config['sess_driver']`` and ``$config['sess_valid_drivers']`` items to *config.php* file. - - Cookie driver now respects php.ini's *session.gc_probability* and *session.gc_divisor* settings. - - Cookie driver now uses HMAC authentication instead of the simple md5 checksum. - - The Cookie driver now also checks authentication on encrypted session data. - - Changed the Cookie driver to select only one row when using database sessions. - - Cookie driver now only writes to database at end of request when using database. - - Cookie driver now uses PHP functions for faster array manipulation when using database. - - Added ``all_flashdata()`` method to session class. Returns an associative array of only flashdata. - - Added ``has_userdata()`` method to verify existence of userdata item. - - Added ``tempdata()``, ``set_tempdata()``, and ``unset_tempdata()`` methods for manipulating tempdata. - - ``keep_flashdata()`` now accepts an array of keys. + + - Library changed to :doc:`Driver <general/drivers>` with classic Cookie driver as default. + - Added Native PHP Session driver to work with ``$_SESSION``. + - Custom drivers can be added anywhere in package paths and be loaded with the library. + - Drivers interchangeable on the fly. + - New **tempdata** feature allows setting user data items with an expiration time. + - Added default ``$config['sess_driver']`` and ``$config['sess_valid_drivers']`` items to *config.php* file. + - Cookie driver now respects php.ini's *session.gc_probability* and *session.gc_divisor* settings. + - Cookie driver now uses HMAC authentication instead of the simple md5 checksum. + - The Cookie driver now also checks authentication on encrypted session data. + - Changed the Cookie driver to select only one row when using database sessions. + - Cookie driver now only writes to database at end of request when using database. + - Cookie driver now uses PHP functions for faster array manipulation when using database. + - Added ``all_flashdata()`` method to session class. Returns an associative array of only flashdata. + - Added ``has_userdata()`` method to verify existence of userdata item. + - Added ``tempdata()``, ``set_tempdata()``, and ``unset_tempdata()`` methods for manipulating tempdata. + - ``keep_flashdata()`` now accepts an array of keys. + - Added *debug* level log messages for key events in the session validation process. + - :doc:`File Uploading Library <libraries/file_uploading>` changes include: - - Added **max_filename_increment** config setting. - - Added an **index** parameter to the ``data()`` method. - - Added the **min_width** and **min_height** options for images. - - Removed method ``clean_file_name()`` and its usage in favor of :doc:`Security Library <libraries/security>`'s ``sanitize_filename()``. - - Added **file_ext_tolower** config setting. + + - Added **max_filename_increment** config setting. + - Added an **index** parameter to the ``data()`` method. + - Added the **min_width** and **min_height** options for images. + - Removed method ``clean_file_name()`` and its usage in favor of :doc:`Security Library <libraries/security>`'s ``sanitize_filename()``. + - Added **file_ext_tolower** config setting. + - :doc:`Cart library <libraries/cart>` changes include: - - ``insert()`` now auto-increments quantity for an item when inserted twice instead of resetting it, this is the default behaviour of large e-commerce sites. - - *Product Name* strictness can be disabled by switching the ``$product_name_safe`` property to FALSE. - - Added method ``remove()`` to remove a cart item, updating with quantity of 0 seemed like a hack but has remained to retain compatibility. - - Added method ``get_item()`` to enable retrieving data for a single cart item. - - Added unicode support for product names. + + - ``insert()`` now auto-increments quantity for an item when inserted twice instead of resetting it, this is the default behaviour of large e-commerce sites. + - *Product Name* strictness can be disabled by switching the ``$product_name_safe`` property to FALSE. + - Added method ``remove()`` to remove a cart item, updating with quantity of 0 seemed like a hack but has remained to retain compatibility. + - Added method ``get_item()`` to enable retrieving data for a single cart item. + - Added unicode support for product names. + - :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. - - If property *maintain_ratio* is set to TRUE, ``image_reproportion()`` now doesn't need both width and height to be specified. - - Property *maintain_ratio* is now taken into account when resizing images using ImageMagick library. - - Added support for maintaining transparency for PNG images in method ``text_watermark()``. + + - 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. + - If property *maintain_ratio* is set to TRUE, ``image_reproportion()`` now doesn't need both width and height to be specified. + - Property *maintain_ratio* is now taken into account when resizing images using ImageMagick library. + - Added support for maintaining transparency for PNG images in method ``text_watermark()``. + - :doc:`Form Validation library <libraries/form_validation>` changes include: - - Added method ``error_array()`` to return all error messages as an array. - - Added method ``set_data()`` to set an alternative data array to be validated instead of the default ``$_POST``. - - Added method ``reset_validation()`` which resets internal validation variables in case of multiple validation routines. - - Added support for setting error delimiters in the config file via ``$config['error_prefix']`` and ``$config['error_suffix']``. - - Internal method ``_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 method ``set_rules()`` to accept an array of rules as well as a string. - - Fields that have empty rules set no longer run through validation (and therefore are not considered erroneous). - - Added rule **differs** to check if the value of a field differs from the value of another field. - - Added rule **valid_url**. - - Added support for named parameters in error messages. - - :doc:`Language <libraries/language>` line keys must now be prefixed with **form_validation_**. - - Added rule **alpha_numeric_spaces**. - - Added support for setting :doc:`Table <libraries/table>` class defaults in a config file. + + - Added method ``error_array()`` to return all error messages as an array. + - Added method ``set_data()`` to set an alternative data array to be validated instead of the default ``$_POST``. + - Added method ``reset_validation()`` which resets internal validation variables in case of multiple validation routines. + - Added support for setting error delimiters in the config file via ``$config['error_prefix']`` and ``$config['error_suffix']``. + - Internal method ``_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 method ``set_rules()`` to accept an array of rules as well as a string. + - Fields that have empty rules set no longer run through validation (and therefore are not considered erroneous). + - Added rule **differs** to check if the value of a field differs from the value of another field. + - Added rule **valid_url**. + - Added support for named parameters in error messages. + - :doc:`Language <libraries/language>` line keys must now be prefixed with **form_validation_**. + - Added rule **alpha_numeric_spaces**. + - :doc:`Caching Library <libraries/caching>` changes include: - - Added Wincache driver. - - Added Redis driver. - - Added a *key_prefix* option for cache IDs. + + - Added Wincache driver. + - Added Redis driver. + - Added a *key_prefix* option for cache IDs. + - Updated driver ``is_supported()`` methods to log at the "debug" level. + - :doc:`Email library <libraries/email>` changes include: - - 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)``. - - Added dsn (delivery status notification) option. - - Renamed method _set_header() to set_header() and made it public to enable adding custom headers in the :doc:`Email Library <libraries/email>`. - - Successfully sent emails will automatically clear the parameters. - - Added a *return_path* parameter to the ``from()`` method. - - Removed the second parameter (character limit) from internal method ``_prep_quoted_printable()`` as it is never used. - - Internal method ``_prep_quoted_printable()`` will now utilize the native ``quoted_printable_encode()``, ``imap_8bit()`` functions (if available) when CRLF is set to "\r\n". - - Default charset now relies on the global ``$config['charset']`` setting. - - Removed unused protected method ``_get_ip()`` (:doc:`Input Library <libraries/input>`'s ``ip_address()`` should be used anyway). - - Internal method ``_prep_q_encoding()`` now utilizes PHP's *mbstring* and *iconv* extensions (when available) and no longer has a second (``$from``) argument. - - Added an optional parameter to ``print_debugger()`` to allow specifying which parts of the message should be printed ('headers', 'subject', 'body'). - - Added SMTP keepalive option to avoid opening the connection for each ``Email::send()``. Accessible as ``$smtp_keepalive``. - - Public method ``set_header()`` now filters the input by removing all "\\r" and "\\n" characters. + + - 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)``. + - Added dsn (delivery status notification) option. + - Renamed method _set_header() to set_header() and made it public to enable adding custom headers in the :doc:`Email Library <libraries/email>`. + - Successfully sent emails will automatically clear the parameters. + - Added a *return_path* parameter to the ``from()`` method. + - Removed the second parameter (character limit) from internal method ``_prep_quoted_printable()`` as it is never used. + - Internal method ``_prep_quoted_printable()`` will now utilize the native ``quoted_printable_encode()``, ``imap_8bit()`` functions (if available) when CRLF is set to "\r\n". + - Default charset now relies on the global ``$config['charset']`` setting. + - Removed unused protected method ``_get_ip()`` (:doc:`Input Library <libraries/input>`'s ``ip_address()`` should be used anyway). + - Internal method ``_prep_q_encoding()`` now utilizes PHP's *mbstring* and *iconv* extensions (when available) and no longer has a second (``$from``) argument. + - Added an optional parameter to ``print_debugger()`` to allow specifying which parts of the message should be printed ('headers', 'subject', 'body'). + - Added SMTP keepalive option to avoid opening the connection for each ``Email::send()``. Accessible as ``$smtp_keepalive``. + - Public method ``set_header()`` now filters the input by removing all "\\r" and "\\n" characters. + - :doc:`Pagination Library <libraries/pagination>` changes include: - - Added support for the anchor "rel" attribute. - - Added support for setting custom attributes. - - Deprecated usage of the "anchor_class" setting (use the new "attributes" setting instead). - - Added $config['reuse_query_string'] to allow automatic repopulation of query string arguments, combined with normal URI segments. - - Removed the default `` `` from a number of the configuration variables. - - Added the ability to use a proxy with the :doc:`XML-RPC Library <libraries/xmlrpc>`. + + - Added support for the anchor "rel" attribute. + - Added support for setting custom attributes. + - Deprecated usage of the "anchor_class" setting (use the new "attributes" setting instead). + - Added $config['reuse_query_string'] to allow automatic repopulation of query string arguments, combined with normal URI segments. + - Removed the default `` `` from a number of the configuration variables. + - Added the ability to use a proxy with the :doc:`XML-RPC Library <libraries/xmlrpc>`. + - :doc:`Encryption Library <libraries/encryption>` changes include: - - Added support for hashing algorithms other than SHA1 and MD5. - - Removed previously deprecated ``sha1()`` method. + + - Added support for hashing algorithms other than SHA1 and MD5. + - Removed previously deprecated ``sha1()`` method. + - :doc:`Profiler Library <general/profiling>` changes include: - - Database object names are now being displayed. - - The sum of all queries running times in seconds is now being displayed. + + - Database object names are now being displayed. + - The sum of all queries running times in seconds is now being displayed. + - Added support for displaying the HTTP DNT ("Do Not Track") header. + - Added support for displaying $_FILES. + - :doc:`Migration Library <libraries/migration>` changes include: - - Added support for timestamp-based migrations (enabled by default). - - Added ``$config['migration_type']`` to allow switching between *sequential* and *timestamp* migrations. + + - Added support for timestamp-based migrations (enabled by default). + - Added ``$config['migration_type']`` to allow switching between *sequential* and *timestamp* migrations. + - :doc:`User Agent Library <libraries/user_agent>` will now check if robots are pretending to be mobile clients (helps with e.g. Google indexing mobile website versions). + - Added support for setting :doc:`Table <libraries/table>` class defaults in a config file. - Core - :doc:`URI Library <libraries/uri>` changes include: - - Changed private methods to protected so that MY_URI can override them. - - Renamed internal method ``_parse_cli_args()`` to ``_parse_argv()``. - - Renamed internal method ``_detect_uri()`` to ``_parse_request_uri()``. - - Changed ``_parse_request_uri()`` to accept absolute URIs for compatibility with HTTP/1.1 as per `RFC2616 <http://www.ietf.org/rfc/rfc2616.txt>`. - - Added protected method ``_parse_query_string()`` to URI paths in the the **QUERY_STRING** value, like ``_parse_request_uri()`` does. - - Changed ``_fetch_uri_string()`` to try the **PATH_INFO** variable first when auto-detecting. - - Removed ``CI_CORE`` boolean constant from *CodeIgniter.php* (no longer Reactor and Core versions). + + - Changed private methods to protected so that MY_URI can override them. + - Renamed internal method ``_parse_cli_args()`` to ``_parse_argv()``. + - Renamed internal method ``_detect_uri()`` to ``_parse_request_uri()``. + - Changed ``_parse_request_uri()`` to accept absolute URIs for compatibility with HTTP/1.1 as per `RFC2616 <http://www.ietf.org/rfc/rfc2616.txt>`. + - Added protected method ``_parse_query_string()`` to URI paths in the the **QUERY_STRING** value, like ``_parse_request_uri()`` does. + - Changed ``_fetch_uri_string()`` to try the **PATH_INFO** variable first when auto-detecting. + - :doc:`Loader Library <libraries/loader>` changes include: - - Added method ``get_vars()`` to the Loader to retrieve all variables loaded with ``$this->load->vars()``. - - ``_ci_autoloader()`` is now a protected method. - - Added autoloading of drivers with ``$autoload['drivers']``. - - ``$config['rewrite_short_tags']`` now has no effect when using PHP 5.4 as ``<?=`` will always be available. - - Changed method ``config()`` to return whatever ``CI_Config::load()`` returns instead of always being void. - - Added support for model aliasing on autoload. + + - Added method ``get_vars()`` to the Loader to retrieve all variables loaded with ``$this->load->vars()``. + - ``_ci_autoloader()`` is now a protected method. + - Added autoloading of drivers with ``$autoload['drivers']``. + - ``$config['rewrite_short_tags']`` now has no effect when using PHP 5.4 as ``<?=`` will always be available. + - Changed method ``config()`` to return whatever ``CI_Config::load()`` returns instead of always being void. + - Added support for model aliasing on autoload. + - Changed method ``is_loaded()`` to ask for the (case sensitive) library name instead of its instance name. + - Removed ``$_base_classes`` property and unified all class data in ``$_ci_classes`` instead. + - Added method ``clear_vars()`` to allow clearing the cached variables for views. + - :doc:`Input Library <libraries/input>` changes include: - - Added ``method()`` to retrieve ``$_SERVER['REQUEST_METHOD']``. - - Added support for arrays and network addresses (e.g. 192.168.1.1/24) for use with the *proxy_ips* setting. - - Added method ``input_stream()`` to aid in using **php://input** stream data such as one passed via PUT, DELETE and PATCH requests. - - Changed method ``valid_ip()`` to use PHP's native ``filter_var()`` function. - - Changed internal method ``_sanitize_globals()`` to skip enforcing reversal of *register_globals* in PHP 5.4+, where this functionality no longer exists. - - Changed methods ``get()``, ``post()``, ``get_post()``, ``cookie()``, ``server()``, ``user_agent()`` to return NULL instead of FALSE when no value is found. - - Changed method ``_fetch_from_array()`` to parse array notation in field name. + + - Added ``method()`` to retrieve ``$_SERVER['REQUEST_METHOD']``. + - Added support for arrays and network addresses (e.g. 192.168.1.1/24) for use with the *proxy_ips* setting. + - Added method ``input_stream()`` to aid in using **php://input** stream data such as one passed via PUT, DELETE and PATCH requests. + - Changed method ``valid_ip()`` to use PHP's native ``filter_var()`` function. + - Changed internal method ``_sanitize_globals()`` to skip enforcing reversal of *register_globals* in PHP 5.4+, where this functionality no longer exists. + - Changed methods ``get()``, ``post()``, ``get_post()``, ``cookie()``, ``server()``, ``user_agent()`` to return NULL instead of FALSE when no value is found. + - Added method ``post_get()`` and changed ``get_post()`` to search in GET data first. Both methods' names now properly match their GET/POST data search priorities. + - Changed method ``_fetch_from_array()`` to parse array notation in field name. + - Added an option for ``_clean_input_keys()`` to return FALSE instead of terminating the whole script. + - :doc:`Common functions <general/common_functions>` changes include: - - Added function :php:func:`get_mimes()` to return the *application/config/mimes.php* array. - - Added support for HTTP code 303 ("See Other") in :php:func:`set_status_header()`. - - Removed redundant conditional to determine HTTP server protocol in :php:func:`set_status_header()`. - - Changed ``_exception_handler()`` to respect php.ini *display_errors* setting. - - Added function :php:func:`is_https()` to check if a secure connection is used. - - Added function :php:func:`function_usable()` to check if a function exists and is not disabled by `Suhosin <http://www.hardened-php.net/suhosin/>`. - - 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 function :php:func:`get_mimes()` to return the *application/config/mimes.php* array. + - Added support for HTTP code 303 ("See Other") in :php:func:`set_status_header()`. + - Removed redundant conditional to determine HTTP server protocol in :php:func:`set_status_header()`. + - Changed ``_exception_handler()`` to respect php.ini *display_errors* setting. + - Added function :php:func:`is_https()` to check if a secure connection is used. + - Added function :php:func:`function_usable()` to check if a function exists and is not disabled by `Suhosin <http://www.hardened-php.net/suhosin/>`. + - Removed the third (`$php_error`) from function :php:func:`log_message()`. + - :doc:`Output Library <libraries/output>` changes include: - - Added a second argument to method ``set_content_type()`` that allows setting the document charset as well. - - Added methods ``get_content_type()`` and ``get_header()``. - - Added method ``delete_cache()``. - - ``$config['time_reference']`` now supports all timezone strings supported by PHP. + + - Added a second argument to method ``set_content_type()`` that allows setting the document charset as well. + - Added methods ``get_content_type()`` and ``get_header()``. + - Added method ``delete_cache()``. + - :doc:`Config Library <libraries/config>` changes include: - - Changed ``site_url()`` method to accept an array as well. - - Removed internal method ``_assign_to_config()`` and moved it's implementation in *CodeIgniter.php* instead. + + - Changed ``site_url()`` method to accept an array as well. + - Removed internal method ``_assign_to_config()`` and moved its implementation to *CodeIgniter.php* instead. + - ``item()`` now returns NULL instead of FALSE when the required config item doesn't exist. + - :doc:`Security Library <libraries/security>` changes include: - - Added method ``strip_image_tags()``. - - Added ``$config['csrf_regeneration']``, which makes token regeneration optional. - - Added ``$config['csrf_exclude_uris']``, which allows you list URIs which will not have the CSRF validation methods run. + + - Added method ``strip_image_tags()``. + - Added ``$config['csrf_regeneration']``, which makes token regeneration optional. + - Added ``$config['csrf_exclude_uris']``, which allows you list URIs which will not have the CSRF validation methods run. + - Modified method ``sanitize_filename()`` to read a public ``$filename_bad_chars`` property for getting the invalid characters list. + - :doc:`URI Routing <general/routing>` changes include: - - Added possibility to route requests using callbacks. - - Added possibility to use dashes in the controller and method URI segments (translated to underscores). - - Deprecated methods ``fetch_directory()``, ``fetch_class()`` and ``fetch_method()`` in favor of their respective public properties. + + - Added possibility to route requests using callbacks. + - Added a new reserved route (*translate_uri_dashes*) to allow usage of dashes in the controller and method URI segments. + - Deprecated methods ``fetch_directory()``, ``fetch_class()`` and ``fetch_method()`` in favor of their respective public properties. + - :doc:`Language Library <libraries/language>` changes include: - - Changed method ``load()`` to filter the language name with ``ctype_digit()``. - - Added an optional second parameter to method ``line()`` to disable error login for line keys that were not found. - - Language files are now loaded in a cascading style with the one in **system/** always loaded and overriden afterwards, if another one is found. + + - Changed method ``load()`` to filter the language name with ``ctype_digit()``. + - Added an optional second parameter to method ``line()`` to disable error login for line keys that were not found. + - Language files are now loaded in a cascading style with the one in **system/** always loaded and overriden afterwards, if another one is found. + + - Removed ``CI_CORE`` boolean constant from *CodeIgniter.php* (no longer Reactor and Core versions). - Log Library will now try to create the **log_path** directory if it doesn't exist. + - 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>`. + - ``$config['time_reference']`` now supports all timezone strings supported by PHP. + - Fatal PHP errors are now also passed to ``_exception_handler()``, so they can be logged. + Bug fixes for 3.0 ------------------ @@ -366,7 +471,7 @@ 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 (#177) - CI_Form_validation::set_value() didn't set the default value if POST data is NULL. +- 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. @@ -393,7 +498,7 @@ Bug fixes for 3.0 - 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) - 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. @@ -418,7 +523,7 @@ Bug fixes for 3.0 - 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 ``protect_identifiers()`` ignored its 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. @@ -458,7 +563,7 @@ Bug fixes for 3.0 - Fixed a bug where the :doc:`Session Library <libraries/sessions>` accepted cookies with *last_activity* values being in the future. - Fixed a bug (#1897) - :doc:`Email Library <libraries/email>` triggered PHP E_WARNING errors when *mail* protocol used and ``to()`` is never called. - Fixed a bug (#1409) - :doc:`Email Library <libraries/email>` didn't properly handle multibyte characters when applying Q-encoding to headers. -- Fixed a bug where :doc:`Email Library <libraries/email>` didn't honor it's *wordwrap* setting while handling alternative messages. +- Fixed a bug where :doc:`Email Library <libraries/email>` didn't honor its *wordwrap* setting while handling alternative messages. - Fixed a bug (#1476, #1909) - :doc:`Pagination Library <libraries/pagination>` didn't take into account actual routing when determining the current page. - Fixed a bug (#1766) - :doc:`Query Builder <database/query_builder>` didn't always take into account the *dbprefix* setting. - Fixed a bug (#779) - :doc:`URI Class <libraries/uri>` didn't always trim slashes from the *uri_string* as shown in the documentation. @@ -494,14 +599,45 @@ Bug fixes for 3.0 - Fixed a bug (#2239) - :doc:`Email Library <libraries/email>` improperly handled the Subject when used with ``bcc_batch_mode`` resulting in E_WARNING messages and an empty Subject. - Fixed a bug (#2234) - :doc:`Query Builder <database/query_builder>` didn't reset JOIN cache for write-type queries. - Fixed a bug (#2298) - :doc:`Database Results <database/results>` method ``next_row()`` kept returning the last row, allowing for infinite loops. -- Fixed a bug (#2236) - :doc:`Form Helper <helpers/form_helper>` function ``set_value()`` didn't parse array notation for keys if the rule was not present in the :doc:`Form Validation Library <libraries/form_validation>`. +- Fixed a bug (#2236, #2639) - :doc:`Form Helper <helpers/form_helper>` functions :func:`set_value()`, :func:`set_select()`, :func:`set_radio()`, :func:`set_checkbox()` didn't parse array notation for keys if the rule was not present in the :doc:`Form Validation Library <libraries/form_validation>`. - Fixed a bug (#2353) - :doc:`Query Builder <database/query_builder>` erroneously prefixed literal strings with **dbprefix**. - Fixed a bug (#78) - :doc:`Cart Library <libraries/cart>` didn't allow non-English letters in product names. - Fixed a bug (#77) - :doc:`Database Class <database/index>` didn't properly handle the transaction "test mode" flag. - Fixed a bug (#2380) - :doc:`URI Routing <general/routing>` method ``fetch_method()`` returned 'index' if the requested method name matches its controller name. - Fixed a bug (#2388) - :doc:`Email Library <libraries/email>` used to ignore attachment errors, resulting in broken emails being sent. - Fixed a bug (#2498) - :doc:`Form Validation Library <libraries/form_validation>` rule **valid_base64** only checked characters instead of actual validity. -- Fixed a bug (#2515) - The script now halts when a fatal error occurs, instead of continuing. +- Fixed a bug (#2425) - OCI8 :doc:`database <database>` driver's method ``stored_procedure()`` didn't log an error unless **db_debug** was set to TRUE. +- Fixed a bug (#2490) - :doc:`Database Class <database/queries>` method ``query()`` returning boolean instead of a result object when the PostgreSQL-specific *RETURNING* clause is used. +- Fixed a bug (#249) - :doc:`Cache Library <libraries/caching>` didn't properly handle Memcache(d) configurations with missing options. +- Fixed a bug (#180) - :php:func:`config_item()` didn't take into account run-time configuration changes. +- Fixed a bug (#2551) - :doc:`Loader Library <libraries/loader>` method ``library()`` didn't properly check if a class that is being loaded already exists. +- Fixed a bug (#2560) - :doc:`Form Helper <helpers/form_helper>` function :php:func:`form_open()` set the 'method="post"' attribute only if the passed attributes equaled an empty string. +- Fixed a bug (#2585) - :doc:`Query Builder <database/query_builder>` methods ``min()``, ``max()``, ``avg()``, ``sum()`` didn't escape field names. +- Fixed an edge case (#2583) in the :doc:`Email Library <libraries/email>` where `Suhosin <http://www.hardened-php.net/suhosin/>` blocked messages sent via ``mail()`` due to trailing newspaces in headers. +- Fixed a bug (#2590) - :php:func:`log_message()` didn't actually cache the ``CI_Log`` class instance. +- Fixed a bug (#2609) - :php:func:`get_config()` optional argument was only effective on first function call. Also, it can now add items, in addition to updating existing items. +- Fixed a bug in the 'postgre' :doc:`database <database/index>` driver where the connection ID wasn't passed to ``pg_escape_string()``. +- Fixed a bug (#33) - Script execution was terminated when an invalid cookie key was encountered. +- Fixed a bug (#2681) - ``CI_Security::entity_decode()`` used the `PREG_REPLACE_EVAL` flag, which is deprecated since PHP 5.5. +- Fixed a bug (#2691) - nested transactions could end in a deadlock when an error is encountered with *db_debug* set to TRUE. +- Fixed a bug (#2515) - ``_exception_handler()`` used to send the 200 "OK" HTTP status code and didn't stop script exection even on fatal errors. + +Version 2.1.4 +============= + +Release Date: July 8, 2013 + +- General Changes + + - Improved security in ``xss_clean()``. + +Bug fixes for 2.1.4 +------------------- + +- Fixed a bug (#1936) - :doc:`Migration Library <libraries/migration>` method ``latest()`` had a typo when retrieving language values. +- Fixed a bug (#2021) - :doc:`Migration Library <libraries/migration>` configuration file was mistakenly using Windows style line feeds. +- Fixed a bug (#1273) - ``E_NOTICE`` being generated by :doc:`Query Builder <database/query_builder>`'s ``set_update_batch()`` method. +- Fixed a bug (#2337) - :doc:`Email Library <libraries/email>` method ``print_debugger()`` didn't apply ``htmlspecialchars()`` to headers. Version 2.1.3 ============= @@ -509,6 +645,7 @@ Version 2.1.3 Release Date: October 8, 2012 - Core + - :doc:`Common function <general/common_functions>` ``is_loaded()`` now returns a reference. Bug fixes for 2.1.3 @@ -532,6 +669,7 @@ Version 2.1.2 Release Date: June 29, 2012 - General Changes + - Improved security in ``xss_clean()``. Version 2.1.1 @@ -540,14 +678,17 @@ Version 2.1.1 Release Date: June 12, 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. Bug fixes for 2.1.1 @@ -559,7 +700,7 @@ Bug fixes for 2.1.1 - 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 - 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 (#726) - PDO put a 'dbname' argument in its 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. @@ -603,7 +744,7 @@ Release Date: November 14, 2011 - Libraries - - Changed $this->cart->insert() in the :doc:`Cart + - Changed ``$this->cart->insert()`` in the :doc:`Cart Library <libraries/cart>` to return the Row ID if a single item was inserted successfully. - Added support to set an optional parameter in your callback rules @@ -613,8 +754,7 @@ Release Date: November 14, 2011 incremental updates to your database schema. - Driver children can be located in any package path. - Added max_filename_increment config setting for Upload library. - - Added is_unique to the :doc:`Form Validation - library <libraries/form_validation>`. + - Added ``is_unique`` to the :doc:`Form Validation library <libraries/form_validation>`. - Added $config['use_page_numbers'] to the :doc:`Pagination library <libraries/pagination>`, which enables real page numbers in the URI. - Added TLS and SSL Encryption for SMTP. @@ -637,7 +777,6 @@ Bug fixes for 2.1.0 but the requested method did not. - Fixed a bug (Reactor #89) where MySQL export would fail if the table had hyphens or other non alphanumeric/underscore characters. -- Fixed a bug (#200) where MySQL queries would be malformed after calling $this->db->count_all() then $this->db->get() - Fixed a bug (#105) that stopped query errors from being logged unless database debugging was enabled - Fixed a bug (#160) - Removed unneeded array copy in the file cache driver. @@ -658,7 +797,7 @@ Bug fixes for 2.1.0 - Fixed a bug (#537) - Support for all wav type in browser. - Fixed a bug (#576) - Using ini_get() function to detect if apc is enabled or not. - Fixed invalid date time format in :doc:`Date helper <helpers/date_helper>` and :doc:`XMLRPC library <libraries/xmlrpc>`. -- Fixed a bug (#200) - MySQL queries would be malformed after calling count_all() then db->get(). +- Fixed a bug (#200) - MySQL queries would be malformed after calling db->count_all() then db->get(). Version 2.0.3 ============= diff --git a/user_guide_src/source/general/cli.rst b/user_guide_src/source/general/cli.rst index 998d2a907..4145d5ccc 100644 --- a/user_guide_src/source/general/cli.rst +++ b/user_guide_src/source/general/cli.rst @@ -33,7 +33,7 @@ Let's try it: Hello World! ========================== Let's create a simple controller so you can see it in action. Using your -text editor, create a file called tools.php, and put the following code +text editor, create a file called Tools.php, and put the following code in it:: <?php diff --git a/user_guide_src/source/general/common_functions.rst b/user_guide_src/source/general/common_functions.rst index a133fdc6d..e085ef808 100644 --- a/user_guide_src/source/general/common_functions.rst +++ b/user_guide_src/source/general/common_functions.rst @@ -68,10 +68,6 @@ accessing configuration information, however ``config_item()`` can be used to retrieve single keys. See :doc:`Config Library <../libraries/config>` documentation for more information. -.. important:: This function only returns values set in your configuration - files. It does not take into account config values that are - dynamically set at runtime. - show_error() ============ @@ -100,11 +96,10 @@ please see the :doc:`Error Handling <errors>` documentation. log_message() ============= -.. php:function:: log_message($level, $message, $php_error = FALSE) +.. php:function:: log_message($level, $message) :param string $level: Log level: 'error', 'debug' or 'info' :param string $message: Message to log - :param bool $php_error: Whether we're logging a native PHP error message :returns: void This function is an alias for ``CI_Log::write_log()``. For more info, diff --git a/user_guide_src/source/general/controllers.rst b/user_guide_src/source/general/controllers.rst index 04f23276d..d8ef824fb 100644 --- a/user_guide_src/source/general/controllers.rst +++ b/user_guide_src/source/general/controllers.rst @@ -18,7 +18,7 @@ Consider this URI:: example.com/index.php/blog/ In the above example, CodeIgniter would attempt to find a controller -named blog.php and load it. +named Blog.php and load it. **When a controller's name matches the first segment of a URI, it will be loaded.** @@ -27,7 +27,7 @@ Let's try it: Hello World! ========================== Let's create a simple controller so you can see it in action. Using your -text editor, create a file called blog.php, and put the following code +text editor, create a file called Blog.php, and put the following code in it:: <?php @@ -41,6 +41,8 @@ in it:: Then save the file to your *application/controllers/* directory. +.. important:: The file must be called 'Blog.php', with a capital 'B'. + Now visit the your site using a URL similar to this:: example.com/index.php/blog/ @@ -136,7 +138,7 @@ present, as will be the case when only your site root URL is requested. To specify a default controller, open your **application/config/routes.php** file and set this variable:: - $route['default_controller'] = 'blog'; + $route['default_controller'] = 'Blog'; Where Blog is the name of the controller class you want used. If you now load your main index.php file without specifying any URI segments you'll @@ -272,7 +274,7 @@ and place your controller classes within them. specify the folder. For example, let's say you have a controller located here:: - application/controllers/products/shoes.php + application/controllers/products/Shoes.php To call the above controller your URI will look something like this:: diff --git a/user_guide_src/source/general/creating_libraries.rst b/user_guide_src/source/general/creating_libraries.rst index 4fc8ed72f..4beb600da 100644 --- a/user_guide_src/source/general/creating_libraries.rst +++ b/user_guide_src/source/general/creating_libraries.rst @@ -42,8 +42,7 @@ Naming Conventions The Class File ============== -Classes should have this basic prototype (Note: We are using the name -Someclass purely as an example):: +Classes should have this basic prototype:: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); @@ -56,6 +55,8 @@ Someclass purely as an example):: /* End of file Someclass.php */ +.. note:: We are using the name Someclass purely as an example. + Using Your Class ================ @@ -81,7 +82,7 @@ constructor:: $params = array('type' => 'large', 'color' => 'red'); - $this->load->library('Someclass', $params); + $this->load->library('someclass', $params); If you use this feature you must set up your class constructor to expect data:: diff --git a/user_guide_src/source/general/libraries.rst b/user_guide_src/source/general/libraries.rst index 6e1c8b6dd..9bbda51bb 100644 --- a/user_guide_src/source/general/libraries.rst +++ b/user_guide_src/source/general/libraries.rst @@ -29,4 +29,4 @@ Creating Your Own Libraries =========================== Please read the section of the user guide that discusses how to -:doc:`create your own libraries <creating_libraries>`. +:doc:`create your own libraries <creating_libraries>`.
\ No newline at end of file diff --git a/user_guide_src/source/general/models.rst b/user_guide_src/source/general/models.rst index a028a9569..c4fd12476 100644 --- a/user_guide_src/source/general/models.rst +++ b/user_guide_src/source/general/models.rst @@ -84,8 +84,7 @@ Where **Model_name** is the name of your class. Class names **must** have the first letter capitalized with the rest of the name lowercase. Make sure your class extends the base Model class. -The file name will be a lower case version of your class name. For -example, if your class is this:: +The file name must match the class name. For example, if this is your class:: class User_model extends CI_Model { @@ -98,7 +97,7 @@ example, if your class is this:: Your file will be this:: - application/models/user_model.php + application/models/User_model.php Loading a Model =============== @@ -111,7 +110,7 @@ the following method:: If your model is located in a sub-directory, include the relative path from your models directory. For example, if you have a model located at -*application/models/blog/queries.php* you'll load it using:: +*application/models/blog/Queries.php* you'll load it using:: $this->load->model('blog/queries'); @@ -181,4 +180,4 @@ database. The following options for connecting are available to you: $config['pconnect'] = FALSE; $config['db_debug'] = TRUE; - $this->load->model('Model_name', '', $config);
\ No newline at end of file + $this->load->model('model_name', '', $config);
\ No newline at end of file diff --git a/user_guide_src/source/general/routing.rst b/user_guide_src/source/general/routing.rst index 123257fc8..5520f59fe 100644 --- a/user_guide_src/source/general/routing.rst +++ b/user_guide_src/source/general/routing.rst @@ -145,7 +145,7 @@ routing rules to process the back-references. Example:: Reserved Routes =============== -There are two reserved routes:: +There are three reserved routes:: $route['default_controller'] = 'welcome'; @@ -165,5 +165,17 @@ error page. It won't affect to the ``show_404()`` function, which will continue loading the default *error_404.php* file at *application/views/errors/error_404.php*. + +:: + + $route['translate_uri_dashes'] = FALSE; + +As evident by the boolean value, this is not exactly a route. This +option enables you to automatically replace dashes ('-') with +underscores in the controller and method URI segments, thus saving you +additional route entries if you need to do that. +This is required, because the dash isn't a valid class or method name +character and would cause a fatal error if you try to use it. + .. important:: The reserved routes must come before any wildcard or regular expression routes.
\ No newline at end of file diff --git a/user_guide_src/source/general/styleguide.rst b/user_guide_src/source/general/styleguide.rst index 144b362f5..5613eabec 100644 --- a/user_guide_src/source/general/styleguide.rst +++ b/user_guide_src/source/general/styleguide.rst @@ -71,13 +71,42 @@ identify a file as being complete and not truncated. echo "Here's my code!"; - /* End of file myfile.php */ + /* End of file Myfile.php */ /* Location: ./system/modules/mymodule/myfile.php */ .. note:: There should be no empty line or newline character(s) following the closing comments. If you happen to see one when submitting a pull request, please check your IDE settings and fix it. +File Naming +=========== + +Class files must be named in a Ucfirst-like manner, while any other file name +(configurations, views, generic scripts, etc.) should be in all lowercase. + +**INCORRECT**:: + + somelibrary.php + someLibrary.php + SOMELIBRARY.php + Some_Library.php + + Application_config.php + Application_Config.php + applicationConfig.php + +**CORRECT**:: + + Somelibrary.php + Some_library.php + + applicationconfig.php + application_config.php + +Furthermore, class file names should match the name of the class itself. +For example, if you have a class named `Myclass`, then its filename must +be **Myclass.php**. + Class and Method Naming ======================= diff --git a/user_guide_src/source/general/urls.rst b/user_guide_src/source/general/urls.rst index d678e4a0a..ca44e2f4c 100644 --- a/user_guide_src/source/general/urls.rst +++ b/user_guide_src/source/general/urls.rst @@ -32,24 +32,6 @@ The :doc:`URI Library <../libraries/uri>` and the :doc:`URL Helper with your URI data. In addition, your URLs can be remapped using the :doc:`URI Routing <routing>` feature for more flexibility. -Friendly URLs -============= - -As you might guess, since there's a straight relationship between -URI segments and the controller/method pair that's being called, -those two determining segments must represent a valid class and -method name. -You may however also use dashes in the class/method-representing -segments, and they will automatically be translated to underscores -in order to be valid routed segments. - -For example:: - - example.com/my-settings/change-password/ - -The above example will route to the ``My_settings`` controller and -its method ``change_password()``. - Removing the index.php file =========================== diff --git a/user_guide_src/source/general/views.rst b/user_guide_src/source/general/views.rst index 4b1ab3c34..2fc0cb2ca 100644 --- a/user_guide_src/source/general/views.rst +++ b/user_guide_src/source/general/views.rst @@ -45,7 +45,7 @@ Where name is the name of your view file. .. note:: The .php file extension does not need to be specified unless you use something other than .php. -Now, open the controller file you made earlier called blog.php, and +Now, open the controller file you made earlier called Blog.php, and replace the echo statement with the view loading method:: <?php diff --git a/user_guide_src/source/helpers/captcha_helper.rst b/user_guide_src/source/helpers/captcha_helper.rst index ca24e011f..3c56addf3 100644 --- a/user_guide_src/source/helpers/captcha_helper.rst +++ b/user_guide_src/source/helpers/captcha_helper.rst @@ -64,7 +64,15 @@ Once loaded you can generate a captcha like this:: 'img_height' => 30, 'expiration' => 7200, 'word_length' => 8, - 'pool' => '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'pool' => '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', + + // White background and border, black text and red grid + 'colors' => array( + 'background' => array(255, 255, 255), + 'border' => array(255, 255, 255), + 'text' => array(0, 0, 0), + 'grid' => array(255, 40, 40) + ) ); $cap = create_captcha($vals); @@ -82,6 +90,7 @@ Once loaded you can generate a captcha like this:: in the captcha folder before it will be deleted. The default is two hours. - **word_length** defaults to 8, **pool** defaults to '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' +- If any of the **colors** values is missing, it will be replaced by the default. Adding a Database ----------------- diff --git a/user_guide_src/source/helpers/date_helper.rst b/user_guide_src/source/helpers/date_helper.rst index 3a3454edc..5dfee8b48 100644 --- a/user_guide_src/source/helpers/date_helper.rst +++ b/user_guide_src/source/helpers/date_helper.rst @@ -414,9 +414,9 @@ Note some of the location lists have been abridged for clarity and formatting. =========== ===================================================================== Time Zone Location =========== ===================================================================== -UM2 (UTC - 12:00) Baker/Howland Island -UM1 (UTC - 11:00) Samoa Time Zone, Niue -UM0 (UTC - 10:00) Hawaii-Aleutian Standard Time, Cook Islands +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 @@ -428,7 +428,7 @@ UM4 (UTC - 04:00) Atlantic Standard Time, Eastern Caribbean UM35 (UTC - 03:30) Newfoundland Standard Time UM3 (UTC - 03:00) Argentina, Brazil, French Guiana, Uruguay UM2 (UTC - 02:00) South Georgia/South Sandwich Islands -UM (UTC -1:00) Azores, Cape Verde Islands +UM1 (UTC -1:00) Azores, Cape Verde Islands UTC (UTC) Greenwich Mean Time, Western European Time UP1 (UTC +1:00) Central European Time, West Africa Time UP2 (UTC +2:00) Central Africa Time, Eastern European Time @@ -452,6 +452,6 @@ UP11 (UTC +11:00) Magadan Time, Solomon Islands, Vanuatu UP115 (UTC +11:30) Norfolk Island UP12 (UTC +12:00) Fiji, Gilbert Islands, Kamchatka, New Zealand UP1275 (UTC +12:45) Chatham Islands Standard Time -UP1 (UTC +13:00) Phoenix Islands Time, Tonga +UP13 (UTC +13:00) Phoenix Islands Time, Tonga UP14 (UTC +14:00) Line Islands =========== =====================================================================
\ No newline at end of file diff --git a/user_guide_src/source/helpers/form_helper.rst b/user_guide_src/source/helpers/form_helper.rst index b2a9b6f0f..f49027baa 100644 --- a/user_guide_src/source/helpers/form_helper.rst +++ b/user_guide_src/source/helpers/form_helper.rst @@ -22,7 +22,7 @@ form_open() .. php:function:: form_open($action = '', $attributes = '', $hidden = array()) :param string $action: Form action/target URI string - :param string $attributes: HTML attributes + :param array $attributes: HTML attributes :param array $hidden: An array of hidden fields' definitions :returns: string @@ -41,7 +41,7 @@ Here's a simple example:: The above example would create a form that points to your base URL plus the "email/send" URI segments, like this:: - <form method="post" accept-charset="utf-8" action="http://example.com/index.php/email/send" /> + <form method="post" accept-charset="utf-8" action="http://example.com/index.php/email/send"> Adding Attributes ^^^^^^^^^^^^^^^^^ @@ -52,9 +52,13 @@ parameter, like this:: $attributes = array('class' => 'email', 'id' => 'myform'); echo form_open('email/send', $attributes); -The above example would create a form similar to this:: +Alternatively, you can specify the second parameter as a string:: + + echo form_open('email/send', 'class="email" id="myform"'); + +The above examples would create a form similar to this:: - <form method="post" accept-charset="utf-8" action="http://example.com/index.php/email/send" class="email" id="myform" /> + <form method="post" accept-charset="utf-8" action="http://example.com/index.php/email/send" class="email" id="myform"> Adding Hidden Input Fields ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -65,6 +69,8 @@ third parameter, like this:: $hidden = array('username' => 'Joe', 'member_id' => '234'); echo form_open('email/send', '', $hidden); +You can skip the second parameter by passing any falsy value to it. + The above example would create a form similar to this:: <form method="post" accept-charset="utf-8" action="http://example.com/index.php/email/send"> @@ -77,7 +83,7 @@ form_open_multipart() .. php:function:: form_open_multipart($action = '', $attributes = array(), $hidden = array()) :param string $action: Form action/target URI string - :param string $attributes: HTML attributes + :param array $attributes: HTML attributes :param array $hidden: An array of hidden fields' definitions :returns: string @@ -258,10 +264,10 @@ multiple select for you. Example:: $options = array( - 'small' => 'Small Shirt', - 'med' => 'Medium Shirt', - 'large' => 'Large Shirt', - 'xlarge' => 'Extra Large Shirt', + 'small' => 'Small Shirt', + 'med' => 'Medium Shirt', + 'large' => 'Large Shirt', + 'xlarge' => 'Extra Large Shirt', ); $shirts_on_sale = array('small', 'large'); @@ -407,16 +413,14 @@ The third parameter contains a boolean TRUE/FALSE to determine whether the box should be checked or not. Similar to the other form functions in this helper, you can also pass an -array of attributes to the function - -:: +array of attributes to the function:: $data = array( - 'name' => 'newsletter', - 'id' => 'newsletter', - 'value' => 'accept', - 'checked' => TRUE, - 'style' => 'margin:10px' + 'name' => 'newsletter', + 'id' => 'newsletter', + 'value' => 'accept', + 'checked' => TRUE, + 'style' => 'margin:10px' ); echo form_checkbox($data); @@ -523,11 +527,11 @@ Or you can pass an associative array containing any data you wish your form to contain:: $data = array( - 'name' => 'button', - 'id' => 'button', - 'value' => 'true', - 'type' => 'reset', - 'content' => 'Reset' + 'name' => 'button', + 'id' => 'button', + 'value' => 'true', + 'type' => 'reset', + 'content' => 'Reset' ); echo form_button($data); diff --git a/user_guide_src/source/helpers/smiley_helper.rst b/user_guide_src/source/helpers/smiley_helper.rst index 7069b465e..cfd52ffbc 100644 --- a/user_guide_src/source/helpers/smiley_helper.rst +++ b/user_guide_src/source/helpers/smiley_helper.rst @@ -17,7 +17,7 @@ This helper is loaded using the following code:: Overview ======== -The Smiley helper has a renderer that takes plain text simileys, like +The Smiley helper has a renderer that takes plain text smileys, like :-) and turns them into a image representation, like |smile!| It also lets you display a set of smiley images that when clicked will @@ -43,8 +43,8 @@ View as described. The Controller -------------- -In your `application/controllers/` folder, create a file called -smileys.php and place the code below in it. +In your **application/controllers/** directory, create a file called +Smileys.php and place the code below in it. .. important:: Change the URL in the :php:func:`get_clickable_smileys()` function below so that it points to your smiley folder. @@ -70,7 +70,7 @@ the :doc:`Table Class <../libraries/table>`:: } -In your `application/views/` folder, create a file called `smiley_view.php` +In your **application/views/** folder, create a file called **smiley_view.php** and place this code in it:: <html> @@ -156,7 +156,7 @@ string, the second must contain the URL to your smiley folder Example:: - $str = 'Here are some simileys: :-) ;-)'; + $str = 'Here are some smileys: :-) ;-)'; $str = parse_smileys($str, "http://example.com/images/smileys/"); echo $str; diff --git a/user_guide_src/source/helpers/url_helper.rst b/user_guide_src/source/helpers/url_helper.rst index 8b5361f94..7a49f188d 100644 --- a/user_guide_src/source/helpers/url_helper.rst +++ b/user_guide_src/source/helpers/url_helper.rst @@ -18,9 +18,10 @@ The following functions are available: site_url() ========== -.. php:function:: site_url($uri = '') +.. php:function:: site_url($uri = '', $protocol = NULL) :param string $uri: URI string + :param string $protocol: Protocol, e.g. 'http' or 'https' :returns: string Returns your site URL, as specified in your config file. The index.php @@ -51,9 +52,10 @@ please see the :doc:`Config Library <../libraries/config>` documentation. base_url() =========== -.. php:function:: base_url($uri = '') +.. php:function:: base_url($uri = '', $protocol = NULL) :param string $uri: URI string + :param string $protocol: Protocol, e.g. 'http' or 'https' :returns: string Returns your site base URL, as specified in your config file. Example:: diff --git a/user_guide_src/source/installation/downloads.rst b/user_guide_src/source/installation/downloads.rst index 45a8f80a7..93c5cc21b 100644 --- a/user_guide_src/source/installation/downloads.rst +++ b/user_guide_src/source/installation/downloads.rst @@ -2,62 +2,38 @@ Downloading CodeIgniter ####################### -- `CodeIgniter V 3.0.0 (Current - version) <http://codeigniter.com/downloads/>`_ -- `CodeIgniter V - 2.1.2 <http://codeigniter.com/download_files/reactor/CodeIgniter_2.1.2.zip>`_ -- `CodeIgniter V - 2.1.1 <http://codeigniter.com/download_files/reactor/CodeIgniter_2.1.1.zip>`_ -- `CodeIgniter V - 2.1.0 <http://codeigniter.com/download_files/reactor/CodeIgniter_2.1.0.zip>`_ -- `CodeIgniter V - 2.0.3 <http://codeigniter.com/download_files/reactor/CodeIgniter_2.0.3.zip>`_ -- `CodeIgniter V - 2.0.2 <http://codeigniter.com/download_files/reactor/CodeIgniter_2.0.2.zip>`_ -- `CodeIgniter V - 2.0.1 <http://codeigniter.com/download_files/reactor/CodeIgniter_2.0.1.zip>`_ -- `CodeIgniter V - 2.0.0 <http://codeigniter.com/download_files/reactor/CodeIgniter_2.0.0.zip>`_ -- `CodeIgniter V - 1.7.3 <http://codeigniter.com/download_files/CodeIgniter_1.7.3.zip>`_ -- `CodeIgniter V - 1.7.2 <http://codeigniter.com/download_files/CodeIgniter_1.7.2.zip>`_ -- `CodeIgniter V - 1.7.1 <http://codeigniter.com/download_files/CodeIgniter_1.7.1.zip>`_ -- `CodeIgniter V - 1.7.0 <http://codeigniter.com/download_files/CodeIgniter_1.7.0.zip>`_ -- `CodeIgniter V - 1.6.3 <http://codeigniter.com/download_files/CodeIgniter_1.6.3.zip>`_ -- `CodeIgniter V - 1.6.2 <http://codeigniter.com/download_files/CodeIgniter_1.6.2.zip>`_ -- `CodeIgniter V - 1.6.1 <http://codeigniter.com/download_files/CodeIgniter_1.6.1.zip>`_ -- `CodeIgniter V - 1.6.0 <http://codeigniter.com/download_files/CodeIgniter_1.6.0.zip>`_ -- `CodeIgniter V - 1.5.4 <http://codeigniter.com/download_files/CodeIgniter_1.5.4.zip>`_ -- `CodeIgniter V - 1.5.3 <http://codeigniter.com/download_files/CodeIgniter_1.5.3.zip>`_ -- `CodeIgniter V - 1.5.2 <http://codeigniter.com/download_files/CodeIgniter_1.5.2.zip>`_ -- `CodeIgniter V - 1.5.1 <http://codeigniter.com/download_files/CodeIgniter_1.5.1.zip>`_ -- `CodeIgniter V - 1.4.1 <http://codeigniter.com/download_files/CodeIgniter_1.4.1.zip>`_ -- `CodeIgniter V - 1.3.3 <http://codeigniter.com/download_files/CodeIgniter_1.3.3.zip>`_ -- `CodeIgniter V - 1.3.2 <http://codeigniter.com/download_files/CodeIgniter_1.3.2.zip>`_ -- `CodeIgniter V - 1.3.1 <http://codeigniter.com/download_files/CodeIgniter_1.3.1.zip>`_ -- `CodeIgniter V - 1.3 <http://codeigniter.com/download_files/CodeIgniter_1.3.zip>`_ -- `CodeIgniter V - 1.2 <http://codeigniter.com/download_files/CodeIgniter_1.2.zip>`_ -- `CodeIgniter V - 1.1 <http://codeigniter.com/download_files/CodeIgniter_1.1b.zip>`_ -- `CodeIgniter V - 1.0 <http://codeigniter.com/download_files/CodeIgniter_1.0b.zip>`_ +- `CodeIgniter v3.0.0 (Current version) <http://ellislab.com/codeigniter/download>`_ +- `CodeIgniter v2.1.4 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.1.4.zip>`_ (MD5 Checksum: e74a296c1d412a855c025b9cd468a513) +- `CodeIgniter v2.1.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.1.3.zip>`_ (MD5 Checksum: 781d06be06eaa36f10759ef82c8594d5) +- `CodeIgniter v2.1.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.1.2.zip>`_ (MD5 Checksum: c7a2980dff2774c97bd38bfbf450d8d5) +- `CodeIgniter v2.1.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.1.1.zip>`_ (MD5 Checksum: c4aa5f188f4ff16f919607b46a16c76c) +- `CodeIgniter v2.1.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.1.0.zip>`_ (MD5 Checksum: 8cb676b0f831114935d7dd1ae2e0d490) +- `CodeIgniter v2.0.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.0.3.zip>`_ (MD5 Checksum: 910475d50daf088bdd949c3d35b444d9) +- `CodeIgniter v2.0.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.0.2.zip>`_ (MD5 Checksum: e75bab8cf27d2fb2483c5bb61b85a524) +- `CodeIgniter v2.0.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.0.1.zip>`_ (MD5 Checksum: 675aa95896bfb16467436c0484f15f1f) +- `CodeIgniter v2.0.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.0.0.zip>`_ (MD5 Checksum: bd657863de45dbb397f3b3dbc4f13abb) +- `CodeIgniter v1.7.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.7.3.zip>`_ (MD5 Checksum: 16f50e7df4f44c1defe18355131049e9) +- `CodeIgniter v1.7.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.7.2.zip>`_ (MD5 Checksum: ff2f4d1b3ab921f91e006f38b3ae6540) +- `CodeIgniter v1.7.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.7.1.zip>`_ (MD5 Checksum: deca9709cf21b26dc0e4ec040b37e866) +- `CodeIgniter v1.7.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.7.0.zip>`_ (MD5 Checksum: 28037f2071f940d8756864460d949045) +- `CodeIgniter v1.6.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.6.3.zip>`_ (MD5 Checksum: 5ffab52b39b235ed6bd08ee5dd64d2f6) +- `CodeIgniter v1.6.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.6.2.zip>`_ (MD5 Checksum: 0922830f96dfd40874b39ad018a49206) +- `CodeIgniter v1.6.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.6.1.zip>`_ (MD5 Checksum: cc3f0b566e3654d351fa067aeee9bced) +- `CodeIgniter v1.6.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.6.0.zip>`_ (MD5 Checksum: 89efabb8c1d57bb51071e6a20bb5590d) +- `CodeIgniter v1.5.4 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.5.4.zip>`_ (MD5 Checksum: 0d6cc66b01d5ddecde483b3d5f51e4f8) +- `CodeIgniter v1.5.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.5.3.zip>`_ (MD5 Checksum: f44dd21d34a2842bd052879ca5de6630) +- `CodeIgniter v1.5.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.5.2.zip>`_ (MD5 Checksum: 78e7106b271f75af48e626f6e923c1aa) +- `CodeIgniter v1.5.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.5.1.zip>`_ (MD5 Checksum: 9dfd0dbed4f283a42a817e1e88f97481) +- `CodeIgniter v1.5.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.5.0.zip>`_ (MD5 Checksum: 116b805eae4b7e78ddd43a8aee733632) +- `CodeIgniter v1.4.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.4.1.zip>`_ (MD5 Checksum: 470005a83772e9d2e99dec2b4058e584) +- `CodeIgniter v1.4.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.4.0.zip>`_ (MD5 Checksum: 43ca6ff3447d6b5681f98a328b386338) +- `CodeIgniter v1.3.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.3.3.zip>`_ (MD5 Checksum: 55692ba4b55b53b58e4514e310288981) +- `CodeIgniter v1.3.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.3.2.zip>`_ (MD5 Checksum: 7dace6e1d6245b569943e8df952c7637) +- `CodeIgniter v1.3.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.3.1.zip>`_ (MD5 Checksum: f6c6f00830c60d7f98b948269ee81069) +- `CodeIgniter v1.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.3.zip>`_ (MD5 Checksum: 03b2f796df6af808ecff3a18b6000477) +- `CodeIgniter v1.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.2.zip>`_ (MD5 Checksum: f9289814fabe102bc35beb791d0c0f62) +- `CodeIgniter v1.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.1b.zip>`_ (MD5 Checksum: bf4cabb6a3ea3122a974270b8044befb) +- `CodeIgniter v1.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.0b.zip>`_ (MD5 Checksum: 427ca4255e2bdaacee976de1aa143ea0) ****** @@ -71,5 +47,4 @@ Please note that while every effort is made to keep this code base functional, we cannot guarantee the functionality of code taken from the develop branch. -Beginning with version 2.0.3, stable tags are also available via GitHub, -simply select the version from the Tags dropdown.
\ No newline at end of file +Beginning with version 2.0.3, stable versions are also available via `GitHub Releases <https://github.com/EllisLab/CodeIgniter/releases>`_.
\ No newline at end of file diff --git a/user_guide_src/source/installation/upgrade_214.rst b/user_guide_src/source/installation/upgrade_214.rst new file mode 100644 index 000000000..ba57e5976 --- /dev/null +++ b/user_guide_src/source/installation/upgrade_214.rst @@ -0,0 +1,14 @@ +############################# +Upgrading from 2.1.3 to 2.1.4 +############################# + +Before performing an update you should take your site offline by +replacing the index.php file with a static one. + +Step 1: Update your CodeIgniter files +===================================== + +Replace all files and directories in your "system" folder. + +.. note:: If you have any custom developed files in these folders please + make copies of them first.
\ No newline at end of file diff --git a/user_guide_src/source/installation/upgrade_300.rst b/user_guide_src/source/installation/upgrade_300.rst index 926af312d..e8fdd0b15 100644 --- a/user_guide_src/source/installation/upgrade_300.rst +++ b/user_guide_src/source/installation/upgrade_300.rst @@ -1,5 +1,5 @@ ############################# -Upgrading from 2.1.3 to 3.0.0 +Upgrading from 2.1.4 to 3.0.0 ############################# .. note:: These upgrade notes are for a version that is yet to be released. @@ -17,22 +17,63 @@ they will need to be made fresh in this new one. .. note:: If you have any custom developed files in these folders please make copies of them first. +************************************** +Step 2: Update your classes file names +************************************** + +Starting with CodeIgniter 3.0, all class filenames (libraries, drivers, controllers +and models) must be named in a Ucfirst-like manner or in other words - they must +start with a capital letter. + +For example, if you have the following library file: + + application/libraries/mylibrary.php + +... then you'll have to rename it to: + + application/libraries/Mylibrary.php + +The same goes for driver libraries and extensions and/or overrides of CodeIgniter's +own libraries and core classes. + + application/libraries/MY_email.php + application/core/MY_log.php + +The above files should respectively be renamed to the following: + + application/libraries/MY_Email.php + application/core/MY_Log.php + +Controllers: + + application/controllers/welcome.php -> application/controllers/Welcome.php + +Models: + + application/models/misc_model.php -> application/models/Misc_model.php + +Please note that this DOES NOT affect directories, configuration files, views, +helpers, hooks and anything else - it is only applied to classes. + +You must now follow just one simple rule - class names in Ucfirst and everything else +in lowercase. + ******************************** -Step 2: Replace config/mimes.php +Step 3: Replace config/mimes.php ******************************** This config file has been updated to contain more user mime-types, please copy it to _application/config/mimes.php*. ************************************************************** -Step 3: Remove $autoload['core'] from your config/autoload.php +Step 4: 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: Move your Log class overrides or extensions +Step 5: Move your Log class overrides or extensions *************************************************** The Log Class is considered as a "core" class and is now located in the @@ -40,10 +81,10 @@ The Log Class is considered as a "core" class and is now located in the or extensions to work, you need to move them to **application/core/**:: application/libraries/Log.php -> application/core/Log.php - application/libraries/MY_Log.php -> application/core/MY_log.php + application/libraries/MY_Log.php -> application/core/MY_Log.php ********************************************************* -Step 5: Convert your Session usage from library to driver +Step 6: Convert your Session usage from library to driver ********************************************************* When you load (or autoload) the Session library, you must now load it as a driver instead of a library. This means @@ -67,7 +108,7 @@ standard for Drivers. Also beware that some functions which are not part of the the drivers, so your extension may have to be broken down into separate library and driver class extensions. *************************************** -Step 6: Update your config/database.php +Step 7: 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 @@ -78,14 +119,14 @@ need to rename the `$active_record` variable to `$query_builder` // $active_record = TRUE; $query_builder = TRUE; -******************************* -Step 7: Move your errors folder -******************************* +******************************************* +Step 8: Move your error templates directory +******************************************* In version 3.0.0, the errors folder has been moved from _application/errors* to _application/views/errors*. ******************************************************* -Step 8: Update your config/routes.php containing (:any) +Step 9: Update your config/routes.php containing (:any) ******************************************************* Historically, CodeIgniter has always provided the **:any** wildcard in routing, @@ -104,47 +145,62 @@ regular expression:: (.+) // matches ANYTHING (:any) // matches any character, except for '/' -***************************************** -Step 9: Update your libraries' file names -***************************************** +************************************************************************* +Step 10: Many functions now return NULL instead of FALSE on missing items +************************************************************************* -CodeIgniter 3.0 only allows library file names to be named in a *ucfirst* manner -(meaning that the first letter of the class name must be a capital). For example, -if you have the following library file: +Many methods and functions now return NULL instead of FALSE when the required items don't exist: - application/libraries/mylibrary.php + - :doc:`Config Class <../libraries/config>` -... then you'll have to rename it to: + - config->item() + - config->slash_item() - application/libraries/Mylibrary.php + - :doc:`Input Class <../libraries/input>` -The same goes for driver libraries and extensions and/or overrides of CodeIgniter's -own libraries and core classes. + - input->get() + - input->post() + - input->get_post() + - input->cookie() + - input->server() + - input->input_stream() + - input->get_request_header() - application/libraries/MY_email.php - application/core/MY_log.php + - :doc:`Session Class <../libraries/sessions>` -The above files should respectively be renamed to the following: + - session->userdata() + - session->flashdata() - application/libraries/MY_Email.php - application/core/MY_Log.php + - :doc:`URI Class <../libraries/uri>` + + - uri->segment() + - uri->rsegment() + + - :doc:`Array Helper <../helpers/array_helper>` + + - element() + - elements() + +******************************************************** +Step 11: Update usage of Input Class's get_post() method +******************************************************** -***************************************************************************** -Step 10: Check the calls to Array Helper's element() and elements() functions -***************************************************************************** +Previously, the :doc:`Input Class <../libraries/input>` method ``get_post()`` +was searching first in POST data, then in GET data. This method has been +modified so that it searches in GET then in POST, as its name suggests. -The default return value of these functions, when the required elements -don't exist, has been changed from FALSE to NULL. +A method has been added, ``post_get()``, which searches in POST then in GET, as +``get_post()`` was doing before. *********************************************************************** -Step 11: Check the calls to Directory Helper's directory_map() function +Step 12: Update usage of Directory Helper's directory_map() function *********************************************************************** In the resulting array, directories now end with a trailing directory separator (i.e. a slash, usually). ************************************************************* -Step 12: Update usage of Database Forge's drop_table() method +Step 13: Update usage of Database Forge's drop_table() method ************************************************************* Up until now, ``drop_table()`` added an IF EXISTS clause by default or it didn't work @@ -162,11 +218,11 @@ If your application relies on IF EXISTS, you'll have to change its usage. // Produces DROP TABLE IF EXISTS `table_name` $this->dbforge->drop_table('table_name', TRUE); -.. note:: The given example users MySQL-specific syntax, but it should work across +.. note:: The given example uses MySQL-specific syntax, but it should work across all drivers with the exception of ODBC. *********************************************************** -Step 13: Change usage of Email library with multiple emails +Step 14: Change usage of Email library with multiple emails *********************************************************** The :doc:`Email Library <../libraries/email>` will automatically clear the @@ -181,7 +237,7 @@ pass FALSE as the first parameter in the ``send()`` method: } *************************************************** -Step 14: Update your Form_validation language lines +Step 15: Update your Form_validation language lines *************************************************** Two improvements have been made to the :doc:`Form Validation Library @@ -212,7 +268,7 @@ files and error messages format: later. **************************************************************** -Step 15: Remove usage of (previously) deprecated functionalities +Step 16: Remove usage of (previously) deprecated functionalities **************************************************************** In addition to the ``$autoload['core']`` configuration setting, there's a diff --git a/user_guide_src/source/installation/upgrading.rst b/user_guide_src/source/installation/upgrading.rst index 4f276207c..6d2e788dd 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.1.3 to 3.0.0 <upgrade_300>` +- :doc:`Upgrading from 2.1.4 to 3.0.0 <upgrade_300>` +- :doc:`Upgrading from 2.1.3 to 2.1.4 <upgrade_214>` - :doc:`Upgrading from 2.1.2 to 2.1.3 <upgrade_213>` - :doc:`Upgrading from 2.1.1 to 2.1.2 <upgrade_212>` - :doc:`Upgrading from 2.1.0 to 2.1.1 <upgrade_211>` diff --git a/user_guide_src/source/libraries/config.rst b/user_guide_src/source/libraries/config.rst index 08d9c2905..654dc4ded 100644 --- a/user_guide_src/source/libraries/config.rst +++ b/user_guide_src/source/libraries/config.rst @@ -90,7 +90,7 @@ example, to fetch your language choice you'll do this:: $lang = $this->config->item('language'); -The function returns FALSE (boolean) if the item you are trying to fetch +The function returns NULL if the item you are trying to fetch does not exist. If you are using the second parameter of the $this->config->load diff --git a/user_guide_src/source/libraries/file_uploading.rst b/user_guide_src/source/libraries/file_uploading.rst index a92d3af34..a295d7427 100644 --- a/user_guide_src/source/libraries/file_uploading.rst +++ b/user_guide_src/source/libraries/file_uploading.rst @@ -83,7 +83,7 @@ place this code and save it to your **application/views/** directory:: The Controller ============== -Using a text editor, create a controller called upload.php. In it, place +Using a text editor, create a controller called Upload.php. In it, place this code and save it to your **application/controllers/** directory:: <?php diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index 8b35fdc75..8534175bb 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -431,7 +431,7 @@ Here's how your controller should now look:: } } - protected function username_check($str) + public function username_check($str) { if ($str == 'test') { @@ -866,6 +866,7 @@ Rule Parameter Description **is_unique** Yes Returns FALSE if the form element is not unique to the table and field name in the is_unique[table.field] parameter. Note: This rule requires :doc:`Query Builder <../database/query_builder>` to be enabled in order to work. +**min_length** Yes Returns FALSE if the form element is shorter then the parameter value. min_length[3] **max_length** Yes Returns FALSE if the form element is longer then the parameter value. max_length[12] **exact_length** Yes Returns FALSE if the form element is not exactly the parameter value. exact_length[8] **greater_than** Yes Returns FALSE if the form element is less than or equal to the parameter value or not greater_than[8] diff --git a/user_guide_src/source/libraries/input.rst b/user_guide_src/source/libraries/input.rst index 177f5cb64..fb245d7cd 100644 --- a/user_guide_src/source/libraries/input.rst +++ b/user_guide_src/source/libraries/input.rst @@ -98,7 +98,7 @@ The method returns NULL if there are no items in the POST. $this->input->get() =================== -This method is identical to the post method, only it fetches get data +This method is identical to the POST method, only it fetches GET data :: $this->input->get('some_data', TRUE); @@ -116,18 +116,26 @@ The method returns NULL if there are no items in the GET. $this->input->get(); // returns all GET items without XSS filtering +$this->input->post_get() +======================== + +This method will search through both the POST and GET streams for +data, looking first in POST, and then in GET:: + + $this->input->post_get('some_data', TRUE); + $this->input->get_post() ======================== -This method will search through both the post and get streams for -data, looking first in post, and then in get:: +This method will search through both the POST and GET streams for +data, looking first in GET, and then in POST:: $this->input->get_post('some_data', TRUE); $this->input->cookie() ====================== -This method is identical to the post method, only it fetches cookie data +This method is identical to the POST method, only it fetches cookie data :: $this->input->cookie('some_cookie'); diff --git a/user_guide_src/source/libraries/loader.rst b/user_guide_src/source/libraries/loader.rst index b048f4881..91db5afbd 100644 --- a/user_guide_src/source/libraries/loader.rst +++ b/user_guide_src/source/libraries/loader.rst @@ -192,7 +192,7 @@ $this->load->model('model_name'); If your model is located in a subdirectory, include the relative path from your models directory. For example, if you have a model located at -application/models/blog/queries.php you'll load it using:: +application/models/blog/Queries.php you'll load it using:: $this->load->model('blog/queries'); @@ -234,6 +234,11 @@ $this->load->get_vars() This method retrieves all variables available to your views. +$this->load->clear_vars() +========================= + +Clears cached view variables. + $this->load->helper('file_name') ================================ @@ -261,6 +266,32 @@ $this->load->config('file_name') This method is an alias of the :doc:`config file loading method <config>`: ``$this->config->load()`` +$this->load->is_loaded('library_name') +====================================== + +The ``is_loaded()`` method allows you to check if a class has already +been loaded or not. + +.. note:: The word "class" here refers to libraries and drivers. + +If the requested class has been loaded, the method returns its assigned +name in the CI Super-object and FALSE if it's not:: + + $this->load->library('form_validation'); + $this->load->is_loaded('Form_validation'); // returns 'form_validation' + + $this->load->is_loaded('Nonexistent_library'); // returns FALSE + +.. important:: If you have more than one instance of a class (assigned to + different properties), then the first one will be returned. + +:: + + $this->load->library('form_validation', $config, 'fv'); + $this->load->library('form_validation'); + + $this->load->is_loaded('Form_validation'); // returns 'fv' + Application "Packages" ====================== diff --git a/user_guide_src/source/libraries/migration.rst b/user_guide_src/source/libraries/migration.rst index b734f5c34..9dc3c08da 100644 --- a/user_guide_src/source/libraries/migration.rst +++ b/user_guide_src/source/libraries/migration.rst @@ -86,7 +86,7 @@ Then in **application/config/migration.php** set **$config['migration_version'] Usage Example ************* -In this example some simple code is placed in **application/controllers/migrate.php** +In this example some simple code is placed in **application/controllers/Migrate.php** to update the schema.:: <?php diff --git a/user_guide_src/source/libraries/xmlrpc.rst b/user_guide_src/source/libraries/xmlrpc.rst index a43c48837..d2d695ee3 100644 --- a/user_guide_src/source/libraries/xmlrpc.rst +++ b/user_guide_src/source/libraries/xmlrpc.rst @@ -296,7 +296,7 @@ Client to send a request to the Server and receive a response. The Client ---------- -Using a text editor, create a controller called xmlrpc_client.php. In +Using a text editor, create a controller called Xmlrpc_client.php. In it, place this code and save it to your application/controllers/ folder:: @@ -337,7 +337,7 @@ folder:: The Server ---------- -Using a text editor, create a controller called xmlrpc_server.php. In +Using a text editor, create a controller called Xmlrpc_server.php. In it, place this code and save it to your application/controllers/ folder:: diff --git a/user_guide_src/source/tutorial/news_section.rst b/user_guide_src/source/tutorial/news_section.rst index d7754e9f3..ad9ed41d3 100644 --- a/user_guide_src/source/tutorial/news_section.rst +++ b/user_guide_src/source/tutorial/news_section.rst @@ -16,7 +16,7 @@ are the place where you retrieve, insert, and update information in your database or other data stores. They represent your data. Open up the application/models directory and create a new file called -news_model.php and add the following code. Make sure you've configured +News_model.php and add the following code. Make sure you've configured your database properly as described `here <../database/configuration.html>`_. @@ -85,7 +85,7 @@ Now that the queries are written, the model should be tied to the views that are going to display the news items to the user. This could be done in our pages controller created earlier, but for the sake of clarity, a new "news" controller is defined. Create the new controller at -application/controllers/news.php. +application/controllers/News.php. :: @@ -127,7 +127,7 @@ the views. public function index() { - data['news'] = $this->news_model->get_news(); + $data['news'] = $this->news_model->get_news(); $data['title'] = 'News archive'; $this->load->view('templates/header', $data); diff --git a/user_guide_src/source/tutorial/static_pages.rst b/user_guide_src/source/tutorial/static_pages.rst index 97c74601d..330a50ecf 100644 --- a/user_guide_src/source/tutorial/static_pages.rst +++ b/user_guide_src/source/tutorial/static_pages.rst @@ -20,7 +20,7 @@ match: As URL schemes become more complex, this may change. But for now, this is all we will need to know. -Create a file at application/controllers/pages.php with the following +Create a file at application/controllers/Pages.php with the following code. :: |