diff options
Diffstat (limited to 'user_guide_src')
60 files changed, 753 insertions, 1484 deletions
diff --git a/user_guide_src/README.rst b/user_guide_src/README.rst index b31db7cf8..a8e151dd8 100644 --- a/user_guide_src/README.rst +++ b/user_guide_src/README.rst @@ -19,7 +19,7 @@ without any parameters. It should load up and tell you which version you have installed. Note: If you're not on Python 2.7, then you must upgrade. E.g. Install 2.7.2 -from http://python.org/download/releases/2.7.2/ +from https://python.org/download/releases/2.7.2/ Installation ============ diff --git a/user_guide_src/cilexer/cilexer/cilexer.py b/user_guide_src/cilexer/cilexer/cilexer.py index 4ecfd0bc4..d15773d4e 100644 --- a/user_guide_src/cilexer/cilexer/cilexer.py +++ b/user_guide_src/cilexer/cilexer/cilexer.py @@ -26,9 +26,9 @@ # THE SOFTWARE. # # Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) -# Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) +# Copyright (c) 2014 - 2016, British Columbia Institute of Technology (https://bcit.ca/) # -# http://opensource.org/licenses/MIT MIT License +# https://opensource.org/licenses/MIT MIT License import re import copy diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/layout.html b/user_guide_src/source/_themes/sphinx_rtd_theme/layout.html index 20ede7d32..908590ebf 100644 --- a/user_guide_src/source/_themes/sphinx_rtd_theme/layout.html +++ b/user_guide_src/source/_themes/sphinx_rtd_theme/layout.html @@ -70,7 +70,7 @@ {%- endblock %} {%- block extrahead %} {% endblock %} - {# Keep modernizr in head - http://modernizr.com/docs/#installing #} + {# Keep modernizr in head - https://modernizr.com/docs/#installing #} <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> </head> diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/versions.html b/user_guide_src/source/_themes/sphinx_rtd_theme/versions.html index 8b3eb79d2..a574bd7ef 100644 --- a/user_guide_src/source/_themes/sphinx_rtd_theme/versions.html +++ b/user_guide_src/source/_themes/sphinx_rtd_theme/versions.html @@ -29,7 +29,7 @@ </dd> </dl> <hr/> - Free document hosting provided by <a href="http://www.readthedocs.org">Read the Docs</a>. + Free document hosting provided by <a href="https://www.readthedocs.org">Read the Docs</a>. </div> </div> diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index c983f1b5c..766da7587 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -2,6 +2,131 @@ Change Log ########## +Version 3.2.0 +============= + +Release Date: Not Released + +- General Changes + + - Officially dropped any kind of support for anything under PHP 5.4.8. + - Updated Welcome view and HTML error templates with new styling. + - Updated configurable directory paths to handle missing trailing ``DIRECTORY_SEPARATOR`` automatically. + - Added support for HTTP status codes 103, 207, 308, 421 and 451 to :doc:`common function <general/common_functions>` :php:func:`set_status_header()`. + +- Core + + - Removed ``$config['rewrite_short_tags']`` (irrelevant on PHP 5.4+). + - Removed previously deprecated ``$config['global_xss_filtering']``. + - Removed previously deprecated :doc:`Routing Class <general/routing>` methods ``fetch_directory()``, ``fetch_class()`` and ``fetch_method()`` (use the respective class properties instead). + - Removed previously deprecated :doc:`Config Library <libraries/config>` method ``system_url()`` (encourages insecure practices). + - Changed :doc:`URI Library <libraries/uri>` to ignore the ``$config['url_suffix']``, ``$config['permitted_uri_chars']`` configuration settings for CLI requests. + - Changed :doc:`Loader <libraries/loader>` method ``model()`` to always check if the loaded class extends ``CI_Model``. + - Changed :doc:`Output Library <libraries/output>` method ``_display()`` default parameter value to ``NULL`` instead of empty string. + + - :doc:`Input Library <libraries/input>` changes include: + + - Removed previously deprecated ``$config['allow_get_array']``. + - Removed previously deprecated ``$config['standardize_newlines']``. + - Removed previously deprecated method ``is_cli_request()`` (use :php:func:`is_cli()` instead). + - Changed the ``set_cookie()`` method's default expiry time to 0 (expires when browser is closed). + - Changed the ``set_cookie()`` method to delete the cookie if a negative expiry time is passed to it. + +- Libraries + + - Removed previously deprecated *Cart Library*. + - Removed previously deprecated *Javascript Library* (it was always experimental in the first place). + - Added UNIX socket connection support to :doc:`Session Library <libraries/sessions>` 'redis' driver. + - Updated :doc:`ZIP Library <libraries/zip>` method ``read_dir()`` to include hidden (dot-prefixed) files. + + - :doc:`Cache Library <libraries/caching>` changes include: + + - Added 'apcu' driver. + - Added UNIX socket connection support to the 'memcached' driver. + - Added 'database' configuration option to the 'redis' driver, allowing to auto-select another database. + - Added method ``get_loaded_driver()`` to return the currently used driver. + - Changed the 'memcached' driver to ignore configurations that don't specify a hostname. + - Removed the *socket_type* configuration setting from the 'redis' driver. + - Changed data serialization logic in 'redis' driver for better performance. + + - :doc:`Form Validation Library <libraries/form_validation>` changes include: + + - Removed previously deprecated method ``prep_for_form()`` / rule *prep_for_form*. + - Changed method ``set_rules()`` to throw a ``BadMethodCallException`` when its first parameter is not an array and the ``$rules`` one is unused. + - Added rule **valid_mac**, which replicates PHP's native ``filter_var()`` with ``FILTER_VALIDATE_MAC``. + - Added ability to validate entire arrays at once, if ``is_array`` is within the list of rules. + - Added ability to fetch processed data via a second parameter to ``run()``. + + - :doc:`HTML Table Library <libraries/table>` changes include: + + - Changed method ``clear()`` to also reset captions. + + - :doc:`Email Library <libraries/email>` changes include: + + - Changed the default value of the **validate** option to ``TRUE``. + - Changed the ``send()`` method to always return ``TRUE`` when sending multiple batches of emails. + + + - :doc:`Image Manipulation Library <libraries/image_lib>` changes include: + + - Added option to change the output filename via the ``new_name`` option when rendering images with ``dynamic_output``. + - Updated to serve multibyte filenames when rendering images with ``dynamic_output``, if possible. + +- :doc:`Database <database/index>` changes include: + + - Removed previously deprecated 'sqlite' driver (used for SQLite version 2; no longer shipped with PHP 5.4+). + - Removed method ``db_set_charset()`` and the ability to change a connection character set at runtime. + - Changed method ``initialize()`` to return void and instead throw a ``RuntimeException`` in case of failure. + - Changed method ``db_connect()`` to always set the connection character set (if supported by the driver) and to fail if it can't. + + - :doc:`Database Forge <database/forge>`: + + - Added support for declaring date/time type fields default values as ``CURRENT_TIMESTAMP`` and similar. + + - :doc:`Query Builder <database/query_builder>`: + + - Added methods ``having_in()``, ``or_having_in()``, ``not_having_in()``, ``or_not_having_in()``. + - Updated method ``join()`` to allow accepting ``NATURAL`` clauses in its third parameter. + - Updated logic to allow dots in alias names. + +- Helpers + + - Removed previously deprecated *Email Helper* (had only two functions, aliases for PHP's native ``filter_var()`` and ``mail()``). + - Removed previously deprecated *Smiley Helper*. + - Removed previously deprecated :doc:`Date Helper <helpers/date_helper>` function ``standard_date()`` (use PHP's native ``date()`` instead). + - Removed previously deprecated :doc:`Security Helper <helpers/security_helper>` function ``do_hash()`` (use PHP's native ``hash()`` instead). + - Removed previously deprecated :doc:`File Helper <helpers/file_helper>` function ``read_file()`` (use PHP's native ``file_get_contents()`` instead). + - Added new function :php:func:`ordinal_format()` to :doc:`Inflector Helper <helpers/inflector_helper>`. + + - :doc:`Download Helper <helpers/download_helper>` changes include: + + - Updated :php:func:`force_download()` to allow existing files to be renamed for download. + - Updated :php:func:`force_download()` to better utilize available server memory. + - Updated :php:func:`force_download()` to serve multibyte filenames when possible, via the ``filename*`` attribute specified by IETF `RFC 6266 <https://tools.ietf.org/html/rfc6266>`_. + + - :doc:`String Helper <helpers/string_helper>` changes include: + + - Removed previously deprecated function ``trim_slashes()`` (use PHP's native ``trim()`` with ``'/'`` instead). + - Removed previously deprecated function ``repeater()`` (use PHP's native ``str_repeat()`` instead). + + - :doc:`HTML Helper <helpers/html_helper>` changes include: + + - Removed previously deprecated function ``br()`` (use PHP's native ``str_repeat()`` with ``'<br />'`` instead). + - Removed previously deprecated function ``nbs()`` (use PHP's native ``str_repeat()`` with ``' '`` instead). + - Updated function :php:func:`meta()` with support for "charset" and "property" properties. + - Changed function :php:func:`doctype()` default document type to HTML 5. + + - :doc:`Form Helper <helpers/form_helper>` changes include: + + - Removed previously deprecated function ``form_prep()`` (use :php:func:`html_escape()` instead). + - Removed the second (out of three) parameter from the :php:func:`form_upload()` function (it was never used). + + - :doc:`CAPTCHA Helper <helpers/captcha_helper>` changes include: + + - Added 'img_alt' option with a default value of 'captcha'. + - Added ability to generate ``data:image/png;base64`` URIs instead of writing image files to disk. + - Updated to always create PNG images instead of JPEG. + Version 3.1.10 ============== @@ -586,7 +711,7 @@ Release Date: March 30, 2015 - License - - CodeIgniter has been relicensed with the `MIT License <http://opensource.org/licenses/MIT>`_, eliminating its old proprietary licensing. + - CodeIgniter has been relicensed with the `MIT License <https://opensource.org/licenses/MIT>`_, eliminating its old proprietary licensing. - General Changes @@ -644,7 +769,7 @@ Release Date: March 30, 2015 - 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. - Added function :php:func:`date_range()` that generates a list of dates between a specified period. - - Deprecated ``standard_date()``, which now just uses the native ``date()`` with `DateTime constants <http://php.net/manual/en/class.datetime.php#datetime.constants.types>`_. + - Deprecated ``standard_date()``, which now just uses the native ``date()`` with `DateTime constants <https://secure.php.net/manual/en/class.datetime.php#datetime.constants.types>`_. - Changed :php:func:`now()` to work with all timezone strings supported by PHP. - Changed :php:func:`days_in_month()` to use the native ``cal_days_in_month()`` PHP function, if available. @@ -669,7 +794,7 @@ Release Date: March 30, 2015 - :doc:`Inflector Helper <helpers/inflector_helper>` changes include: - Changed :php:func:`humanize()` to allow passing an input separator as its second parameter. - - Changed :php:func:`humanize()` and :php:func:`underscore()` to utilize `mbstring <http://php.net/mbstring>`_, if available. + - Changed :php:func:`humanize()` and :php:func:`underscore()` to utilize `mbstring <https://secure.php.net/mbstring>`_, if available. - Changed :php:func:`plural()` and :php:func:`singular()` to avoid double pluralization and support more words. - :doc:`Download Helper <helpers/download_helper>` changes include: @@ -681,15 +806,15 @@ Release Date: March 30, 2015 - :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()` is now DEPRECATED and only acts as an alias for :doc:`common function <general/common_functions>` :php:func:`html_escape()`. + - ``form_prep()`` is now DEPRECATED and only acts as an alias for :doc:`common function <general/common_functions>` :php:func:`html_escape()`. - :php:func:`set_value()` will now also accept a third argument, allowing to turn off HTML escaping of the value. - :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. + - ``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: + - *Smiley Helper* changes include: - Deprecated the whole helper as too specific for CodeIgniter. - Removed previously deprecated function ``js_insert_smiley()``. @@ -720,12 +845,12 @@ Release Date: March 30, 2015 - :doc:`Text Helper <helpers/text_helper>` changes include: - Changed the default tag for use in :php:func:`highlight_phrase()` to ``<mark>`` (formerly ``<strong>``). - - Changed :php:func:`character_limiter()`, :php:func:`word_wrap()` and :php:func:`ellipsize()` to utilize `mbstring <http://php.net/mbstring>`_ or `iconv <http://php.net/iconv>`_, if available. + - Changed :php:func:`character_limiter()`, :php:func:`word_wrap()` and :php:func:`ellipsize()` to utilize `mbstring <https://secure.php.net/mbstring>`_ or `iconv <https://secure.php.net/iconv>`_, if available. - :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. + - Deprecated the *Email Helper* as its ``valid_email()``, ``send_email()`` functions are now only aliases for PHP native functions ``filter_var()`` and ``mail()`` respectively. - Database @@ -900,7 +1025,7 @@ Release Date: March 30, 2015 - Added support for templating via an array in addition to the encoded string. - Changed method ``get_total_days()`` to be an alias for :doc:`Date Helper <helpers/date_helper>` :php:func:`days_in_month()`. - - :doc:`Cart Library <libraries/cart>` changes include: + - *Cart Library* changes include: - Deprecated the library as too specific for CodeIgniter. - Added method ``remove()`` to remove a cart item, updating with quantity of 0 seemed like a hack but has remained to retain compatibility. @@ -1037,7 +1162,7 @@ Release Date: March 30, 2015 - 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>`. + - Changed ``_parse_request_uri()`` to accept absolute URIs for compatibility with HTTP/1.1 as per `RFC2616 <https://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 URI string detection logic to always default to **REQUEST_URI** unless configured otherwise or under CLI. - Removed methods ``_remove_url_suffix()``, ``_explode_segments()`` and moved their logic into ``_set_uri_string()``. @@ -1132,7 +1257,7 @@ Release Date: March 30, 2015 - UTF-8 Library changes include: - - ``UTF8_ENABLED`` now requires only one of `Multibyte String <http://php.net/mbstring>`_ or `iconv <http://php.net/iconv>`_ to be available instead of both. + - ``UTF8_ENABLED`` now requires only one of `Multibyte String <https://secure.php.net/mbstring>`_ or `iconv <https://secure.php.net/iconv>`_ to be available instead of both. - Changed method ``clean_string()`` to utilize ``mb_convert_encoding()`` if it is available. - Renamed method ``_is_ascii()`` to ``is_ascii()`` and made it public. @@ -1144,9 +1269,9 @@ Release Date: March 30, 2015 - Added :doc:`compatibility layers <general/compatibility_functions>` for: - - `Multibyte String <http://php.net/mbstring>`_ (limited support). - - `Hash <http://php.net/hash>`_ (``hash_equals()``, ``hash_pbkdf2()``). - - `Password Hashing <http://php.net/password>`_. + - `Multibyte String <https://secure.php.net/mbstring>`_ (limited support). + - `Hash <https://secure.php.net/hash>`_ (``hash_equals()``, ``hash_pbkdf2()``). + - `Password Hashing <https://secure.php.net/password>`_. - `Standard Functions ``array_column()``, ``array_replace()``, ``array_replace_recursive()``, ``hex2bin()``, ``quoted_printable_encode()``. - Removed ``CI_CORE`` boolean constant from *CodeIgniter.php* (no longer Reactor and Core versions). @@ -1169,7 +1294,7 @@ Bug fixes for 3.0 - Fixed a bug where :doc:`Database Forge <database/forge>` method ``create_table()`` with PostgreSQL database could lead to fetching the whole table. - Fixed a bug (#795) - :doc:`Form Helper <helpers/form_helper>` :php:func:`form_open()` didn't add the default form *method* and *accept-charset* when an empty array is passed to it. - Fixed a bug (#797) - :doc:`Date Helper <helpers/date_helper>` :php:func:`timespan()` was using incorrect seconds for year and month. -- Fixed a bug in :doc:`Cart Library <libraries/cart>` method ``contents()`` where if called without a TRUE (or equal) parameter, it would fail due to a typo. +- Fixed a bug in *Cart Library* method ``contents()`` where if called without a TRUE (or equal) parameter, it would fail due to a typo. - Fixed a bug (#406) - SQLSRV DB driver not returning resource on ``db_pconnect()``. - Fixed a bug in :doc:`Image Manipulation Library <libraries/image_lib>` method ``gd_loaded()`` where it was possible for the script execution to end or a PHP E_WARNING message to be emitted. - Fixed a bug in the :doc:`Pagination library <libraries/pagination>` where when use_page_numbers=TRUE previous link and page 1 link did not have the same url. @@ -1251,7 +1376,7 @@ Bug fixes for 3.0 - Fixed a bug (#79) - :doc:`Form Validation Library <libraries/form_validation>` didn't properly validate array fields that use associative keys or have custom indexes. - Fixed a bug (#427) - :doc:`Form Validation Library <libraries/form_validation>` method ``strip_image_tags()`` was an alias to a non-existent method. - Fixed a bug (#1545) - :doc:`Query Builder <database/query_builder>` method ``limit()`` wasn't executed properly under Oracle. -- Fixed a bug (#1551) - :doc:`Date Helper <helpers/date_helper>` function :php:func:`standard_date()` didn't properly format *W3C* and *ATOM* standard dates. +- Fixed a bug (#1551) - :doc:`Date Helper <helpers/date_helper>` function ``standard_date()`` didn't properly format *W3C* and *ATOM* standard dates. - Fixed a bug where :doc:`Query Builder <database/query_builder>` method ``join()`` escaped literal values as if they were fields. - Fixed a bug (#135) - PHP Error logging was impossible without the errors being displayed. - Fixed a bug (#1613) - :doc:`Form Helper <helpers/form_helper>` functions :php:func:`form_multiselect()`, :php:func:`form_dropdown()` didn't properly handle empty array option groups. @@ -1306,7 +1431,7 @@ Bug fixes for 3.0 - 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, #2639) - :doc:`Form Helper <helpers/form_helper>` functions :php:func:`set_value()`, :php:func:`set_select()`, :php:func:`set_radio()`, :php: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 (#78) - *Cart Library* 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. @@ -1526,7 +1651,7 @@ Release Date: November 14, 2011 - Database - - Added a `CUBRID <http://www.cubrid.org/>`_ driver to the :doc:`Database + - Added a `CUBRID <https://www.cubrid.org/>`_ driver to the :doc:`Database Driver <database/index>`. Thanks to the CUBRID team for supplying this patch. - Added a PDO driver to the :doc:`Database Driver <database/index>`. @@ -1541,9 +1666,8 @@ Release Date: November 14, 2011 - Libraries - - Changed ``$this->cart->insert()`` in the :doc:`Cart - Library <libraries/cart>` to return the Row ID if a single - item was inserted successfully. + - Changed ``$this->cart->insert()`` in the *Cart Library* + to return the Row ID if a single item was inserted successfully. - Added support to set an optional parameter in your callback rules of validation using the :doc:`Form Validation Library <libraries/form_validation>`. @@ -1651,9 +1775,8 @@ Release Date: August 20, 2011 string. See upgrade notes if using database sessions. - Added $this->db->set_dbprefix() to the :doc:`Database Driver <database/queries>`. - - Changed $this->cart->insert() in the :doc:`Cart - Library <libraries/cart>` to return the Row ID if a single - item was inserted successfully. + - Changed ``$this->cart->insert()`` in the *Cart Library* + to return the Row ID if a single item was inserted successfully. - Added $this->load->get_var() to the :doc:`Loader library <libraries/loader>` to retrieve global vars set with $this->load->view() and $this->load->vars(). @@ -1678,8 +1801,8 @@ Bug fixes for 2.0.3 properly escaped. - Fixed issue #199 - Attributes passed as string does not include a space between it and the opening tag. -- Fixed a bug where the method $this->cart->total_items() from :doc:`Cart - Library <libraries/cart>` now returns the sum of the quantity +- Fixed a bug where the method ``$this->cart->total_items()`` from + *Cart Library* now returns the sum of the quantity of all items in the cart instead of your total count. - Fixed a bug where not setting 'null' when adding fields in db_forge for mysql and mysqli drivers would default to NULL instead of NOT @@ -1715,8 +1838,8 @@ Hg Tag: v2.0.2 - Helpers - - Removed the previously deprecated dohash() from the :doc:`Security - helper <./helpers/security_helper>`; use do_hash() instead. + - Removed the previously deprecated ``dohash()`` from the :doc:`Security + helper <./helpers/security_helper>`; use ``do_hash()`` instead. - Changed the 'plural' function so that it doesn't ruin the captalization of your string. It also take into consideration acronyms which are all caps. @@ -1958,7 +2081,7 @@ Hg Tag: v2.0.0 helper <./helpers/text_helper>`. - Added accept-charset to the list of inserted attributes of form_open() in the :doc:`Form Helper <helpers/form_helper>`. - - Deprecated the dohash() function in favour of do_hash() for + - Deprecated the ``dohash()`` function in favour of ``do_hash()`` for naming consistency. - Non-backwards compatible change made to get_dir_file_info() in the :doc:`File Helper <helpers/file_helper>`. No longer recurses @@ -1978,7 +2101,7 @@ Hg Tag: v2.0.0 string already has a scheme. - Modified get_file_info in the file helper, changing filectime() to filemtime() for dates. - - Modified smiley_js() to add optional third parameter to return + - Modified ``smiley_js()`` to add optional third parameter to return only the javascript with no script tags. - The img() function of the :doc:`HTML helper <./helpers/html_helper>` will now generate an empty @@ -2098,7 +2221,7 @@ Hg Tag: v1.7.2 - Libraries - - Added a new :doc:`Cart Class <libraries/cart>`. + - Added a new *Cart Class*. - Added the ability to pass $config['file_name'] for the :doc:`File Uploading Class <libraries/file_uploading>` and rename the uploaded file. @@ -2125,7 +2248,7 @@ Hg Tag: v1.7.2 - Modified form_hidden() in the :doc:`Form helper <helpers/form_helper>` to accept multi-dimensional arrays. - - Modified form_prep() in the :doc:`Form + - Modified ``form_prep()`` in the :doc:`Form helper <helpers/form_helper>` to keep track of prepped fields to avoid multiple prep/mutation from subsequent calls which can occur when using Form Validation and form helper functions to @@ -2133,7 +2256,7 @@ Hg Tag: v1.7.2 - Modified directory_map() in the :doc:`Directory helper <helpers/directory_helper>` to allow the inclusion of hidden files, and to return FALSE on failure to read directory. - - Modified the :doc:`Smiley helper <helpers/smiley_helper>` to work + - Modified the *Smiley helper* to work with multiple fields and insert the smiley at the last known cursor position. @@ -2184,7 +2307,7 @@ Bug fixes for 1.7.2 - Fixed a case sensitive string replacement in xss_clean() - Fixed a bug in form_textarea() where form data was not prepped correctly. -- Fixed a bug in form_prep() causing it to not preserve entities in +- Fixed a bug in ``form_prep()`` causing it to not preserve entities in the user's original input when called back into a form element - Fixed a bug in _protect_identifiers() where the swap prefix ($swap_pre) was not being observed. @@ -2877,7 +3000,7 @@ Release Date: January 30, 2008 class. <./libraries/sessions>` - Removed 'last_visit' from the Session class. - Added a language entry for valid_ip validation error. - - Modified prep_for_form() in the Validation class to accept + - Modified ``prep_for_form()`` in the Validation class to accept arrays, adding support for POST array validation (via callbacks only) - Added an "integer" rule into the Validation library. @@ -2901,8 +3024,7 @@ Release Date: January 30, 2008 helper. <./helpers/html_helper>` - Added img() to the :doc:`HTML helper. <./helpers/html_helper>` - Added ability to :doc:`"extend" Helpers <./general/helpers>`. - - Added an :doc:`email helper <./helpers/email_helper>` into core - helpers. + - Added an *Email Helper* into core helpers. - Added strip_quotes() function to :doc:`string helper <./helpers/string_helper>`. - Added reduce_multiples() function to :doc:`string @@ -3103,7 +3225,7 @@ Release Date: July 12, 2007 - Fixed various doc typos. - Documented two functions from the :doc:`String helper <./helpers/string_helper>` that were missing from the - user guide: trim_slashes() and reduce_double_slashes(). + user guide: ``trim_slashes()`` and ``reduce_double_slashes()``. - Docs now validate to XHTML 1 transitional - Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits @@ -3134,7 +3256,7 @@ Release Date: April 15, 2007 - Added array to string into the profiler - Code Igniter references updated to CodeIgniter - pMachine references updated to EllisLab -- Fixed a bug in the repeater function of :doc:`string +- Fixed a bug in the ``repeater()`` function of :doc:`string helper <./helpers/string_helper>`. - Fixed a bug in ODBC driver - Fixed a bug in result_array() that was returning an empty array when @@ -3233,8 +3355,7 @@ Release Date: October 30, 2006 - Added :doc:`Download Helper <./helpers/download_helper>`. - Added :doc:`simple_query() <./database/queries>` function to the database classes -- Added :doc:`standard_date() <./helpers/date_helper>` function to - the Date Helper. +- Added ``standard_date()`` function function to the :doc:`Date Helper <helpers/date_helper>`. - Added :doc:`$query->free_result() <./database/results>` to database class. - Added :doc:`$query->list_fields() <./database/metadata>` function to @@ -3242,7 +3363,7 @@ Release Date: October 30, 2006 - Added :doc:`$this->db->platform() <./database/helpers>` function - Added new :doc:`File Helper <./helpers/file_helper>`: get_filenames() -- Added new helper: :doc:`Smiley Helper <./helpers/smiley_helper>` +- Added new helper: *Smiley Helper* - Added support for <ul> and <ol> lists in the :doc:`HTML Helper <./helpers/html_helper>` - Added the ability to rewrite :doc:`short @@ -3275,7 +3396,7 @@ Release Date: October 30, 2006 - Fixed a bug in the validation class. - Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags. -- Fixed a problem in the form_prep() function that was double encoding +- Fixed a problem in the ``form_prep()`` function that was double encoding entities. - Fixed a bug that affects some versions of PHP when output buffering is nested. @@ -3637,7 +3758,7 @@ Release Date: March 10, 2006 - Fixed a pagination problem in the scaffolding. - Fixed a bug in the mysql class "where" function. - Fixed a regex problem in some code that trimmed duplicate slashes. -- Fixed a bug in the br() function in the HTML helper +- Fixed a bug in the ``br()`` function in the HTML helper - Fixed a syntax mistake in the form_dropdown function in the Form Helper. - Removed the "style" attributes form the form helpers. diff --git a/user_guide_src/source/conf.py b/user_guide_src/source/conf.py index 35b732693..f59660886 100644 --- a/user_guide_src/source/conf.py +++ b/user_guide_src/source/conf.py @@ -48,9 +48,9 @@ copyright = u'2014 - 2018, British Columbia Institute of Technology' # built documents. # # The short X.Y version. -version = '3.1.10-dev' +version = '3.2.0-dev' # The full version, including alpha/beta/rc tags. -release = '3.1.10-dev' +release = '3.2.0-dev' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/user_guide_src/source/contributing/index.rst b/user_guide_src/source/contributing/index.rst index be776ec1f..5bdeffde5 100644 --- a/user_guide_src/source/contributing/index.rst +++ b/user_guide_src/source/contributing/index.rst @@ -31,7 +31,7 @@ Support Please note that GitHub is not for general support questions! If you are having trouble using a feature of CodeIgniter, ask for help on our -`forums <http://forum.codeigniter.com/>`_ instead. +`forums <https://forum.codeigniter.com/>`_ instead. If you are not sure whether you are using something correctly or if you have found a bug, again - please ask on the forums first. @@ -104,15 +104,15 @@ Compatibility ============= CodeIgniter recommends PHP 5.6 or newer to be used, but it should be -compatible with PHP 5.3.7 so all code supplied must stick to this -requirement. If PHP 5.4 (and above) functions or features are used then -there must be a fallback for PHP 5.3.7. +compatible with PHP 5.4.8 so all code supplied must stick to this +requirement. If PHP 5.5 (and above) functions or features are used then +there must be a fallback for PHP 5.4.8. Branching ========= CodeIgniter uses the `Git-Flow -<http://nvie.com/posts/a-successful-git-branching-model/>`_ branching model +<https://nvie.com/posts/a-successful-git-branching-model/>`_ branching model which requires all pull requests to be sent to the "develop" branch. This is where the next planned version will be developed. The "master" branch will always contain the latest stable version and is kept clean so a "hotfix" (e.g: diff --git a/user_guide_src/source/database/db_driver_reference.rst b/user_guide_src/source/database/db_driver_reference.rst index 1f036cd77..c240526e0 100644 --- a/user_guide_src/source/database/db_driver_reference.rst +++ b/user_guide_src/source/database/db_driver_reference.rst @@ -17,8 +17,8 @@ This article is intended to be a reference for them. .. php:method:: initialize() - :returns: TRUE on success, FALSE on failure - :rtype: bool + :rtype: void + :throws: RuntimeException In case of failure Initialize database settings, establish a connection to the database. @@ -61,14 +61,6 @@ This article is intended to be a reference for them. Select / switch the current database. - .. php:method:: db_set_charset($charset) - - :param string $charset: Character set name - :returns: TRUE on success, FALSE on failure - :rtype: bool - - Set client character set. - .. php:method:: platform() :returns: Platform name @@ -313,9 +305,10 @@ This article is intended to be a reference for them. Gets a list containing field data about a table. - .. php:method:: escape_identifiers($item) + .. php:method:: escape_identifiers($item, $split = TRUE) :param mixed $item: The item or array of items to escape + :param bool $split: Whether to split identifiers when a dot is encountered :returns: The input item(s), escaped :rtype: mixed @@ -436,4 +429,4 @@ This article is intended to be a reference for them. insert the table prefix (if it exists) in the proper position, and escape only the correct identifiers. - This method is used extensively by the Query Builder class.
\ No newline at end of file + This method is used extensively by the Query Builder class. diff --git a/user_guide_src/source/database/query_builder.rst b/user_guide_src/source/database/query_builder.rst index 38bc7fcff..860b34d4c 100644 --- a/user_guide_src/source/database/query_builder.rst +++ b/user_guide_src/source/database/query_builder.rst @@ -452,6 +452,52 @@ setting it to FALSE. Identical to having(), only separates multiple clauses with "OR". +**$this->db->having_in()** + +Generates a HAVING field IN ('item', 'item') SQL query joined with AND if +appropriate + +:: + + $names = array('Frank', 'Todd', 'James'); + $this->db->having_in('username', $names); + // Produces: HAVING username IN ('Frank', 'Todd', 'James') + + +**$this->db->or_having_in()** + +Generates a HAVING field IN ('item', 'item') SQL query joined with OR if +appropriate + +:: + + $names = array('Frank', 'Todd', 'James'); + $this->db->or_having_in('username', $names); + // Produces: OR username IN ('Frank', 'Todd', 'James') + +**$this->db->having_not_in()** + +Generates a HAVING field NOT IN ('item', 'item') SQL query joined with +AND if appropriate + +:: + + $names = array('Frank', 'Todd', 'James'); + $this->db->having_not_in('username', $names); + // Produces: HAVING username NOT IN ('Frank', 'Todd', 'James') + + +**$this->db->or_having_not_in()** + +Generates a HAVING field NOT IN ('item', 'item') SQL query joined with OR +if appropriate + +:: + + $names = array('Frank', 'Todd', 'James'); + $this->db->or_having_not_in('username', $names); + // Produces: OR username NOT IN ('Frank', 'Todd', 'James') + **************** Ordering results **************** diff --git a/user_guide_src/source/general/alternative_php.rst b/user_guide_src/source/general/alternative_php.rst index 418d2e6eb..7f3a05e56 100644 --- a/user_guide_src/source/general/alternative_php.rst +++ b/user_guide_src/source/general/alternative_php.rst @@ -10,20 +10,6 @@ alternative syntax for control structures and short tag echo statements. If you are not familiar with this syntax, it allows you to eliminate the braces from your code, and eliminate "echo" statements. -Automatic Short Tag Support -=========================== - -.. note:: If you find that the syntax described in this page does not - work on your server it might be that "short tags" are disabled in your - PHP ini file. CodeIgniter will optionally rewrite short tags on-the-fly, - allowing you to use that syntax even if your server doesn't support it. - This feature can be enabled in your *config/config.php* file. - -Please note that if you do use this feature, if PHP errors are -encountered in your **view files**, the error message and line number -will not be accurately shown. Instead, all errors will be shown as -``eval()`` errors. - Alternative Echos ================= @@ -72,4 +58,4 @@ Here is another example, using ``if``/``elseif``/``else``. Notice the colons:: <h3>Hi unknown user</h3> - <?php endif; ?>
\ No newline at end of file + <?php endif; ?> diff --git a/user_guide_src/source/general/cli.rst b/user_guide_src/source/general/cli.rst index 764a6b835..e4f57aefb 100644 --- a/user_guide_src/source/general/cli.rst +++ b/user_guide_src/source/general/cli.rst @@ -13,7 +13,7 @@ What is the CLI? The command-line interface is a text-based method of interacting with computers. For more information, check the `Wikipedia -article <http://en.wikipedia.org/wiki/Command-line_interface>`_. +article <https://en.wikipedia.org/wiki/Command-line_interface>`_. Why run via the command-line? ============================= diff --git a/user_guide_src/source/general/common_functions.rst b/user_guide_src/source/general/common_functions.rst index 3e3e42264..ef9058b2c 100644 --- a/user_guide_src/source/general/common_functions.rst +++ b/user_guide_src/source/general/common_functions.rst @@ -24,9 +24,9 @@ loading any libraries or helpers. Example:: - if (is_php('5.3')) + if (is_php('5.5')) { - $str = quoted_printable_encode($str); + echo json_last_error_msg(); } Returns boolean TRUE if the installed version of PHP is equal to or @@ -110,7 +110,7 @@ loading any libraries or helpers. set_status_header(401); // Sets the header as: Unauthorized - `See here <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>`_ for + `See here <https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>`_ for a full list of headers. .. php:function:: remove_invisible_characters($str[, $url_encoded = TRUE]) @@ -185,4 +185,4 @@ loading any libraries or helpers. .. note:: This function was introduced because Suhosin terminated script execution, but this turned out to be a bug. A fix has been available for some time (version 0.9.34), but is - unfortunately not released yet.
\ No newline at end of file + unfortunately not released yet. diff --git a/user_guide_src/source/general/compatibility_functions.rst b/user_guide_src/source/general/compatibility_functions.rst index 584968663..0ae36e710 100644 --- a/user_guide_src/source/general/compatibility_functions.rst +++ b/user_guide_src/source/general/compatibility_functions.rst @@ -26,13 +26,12 @@ Password Hashing **************** This set of compatibility functions offers a "backport" of PHP's -standard `Password Hashing extension <http://php.net/password>`_ +standard `Password Hashing extension <https://secure.php.net/password>`_ that is otherwise available only since PHP 5.5. Dependencies ============ -- PHP 5.3.7 - ``CRYPT_BLOWFISH`` support for ``crypt()`` Constants @@ -51,7 +50,7 @@ Function reference :rtype: array For more information, please refer to the `PHP manual for - password_get_info() <http://php.net/password_get_info>`_. + password_get_info() <https://secure.php.net/password_get_info>`_. .. php:function:: password_hash($password, $algo[, $options = array()]) @@ -62,7 +61,7 @@ Function reference :rtype: string For more information, please refer to the `PHP manual for - password_hash() <http://php.net/password_hash>`_. + password_hash() <https://secure.php.net/password_hash>`_. .. note:: Unless you provide your own (and valid) salt, this function has a further dependency on an available CSPRNG source. Each @@ -81,7 +80,7 @@ Function reference :rtype: bool For more information, please refer to the `PHP manual for - password_needs_rehash() <http://php.net/password_needs_rehash>`_. + password_needs_rehash() <https://secure.php.net/password_needs_rehash>`_. .. php:function:: password_verify($password, $hash) @@ -91,7 +90,7 @@ Function reference :rtype: bool For more information, please refer to the `PHP manual for - password_verify() <http://php.net/password_verify>`_. + password_verify() <https://secure.php.net/password_verify>`_. ********************* Hash (Message Digest) @@ -117,7 +116,7 @@ Function reference :rtype: string For more information, please refer to the `PHP manual for - hash_equals() <http://php.net/hash_equals>`_. + hash_equals() <https://secure.php.net/hash_equals>`_. .. php:function:: hash_pbkdf2($algo, $password, $salt, $iterations[, $length = 0[, $raw_output = FALSE]]) @@ -131,14 +130,14 @@ Function reference :rtype: string For more information, please refer to the `PHP manual for - hash_pbkdf2() <http://php.net/hash_pbkdf2>`_. + hash_pbkdf2() <https://secure.php.net/hash_pbkdf2>`_. **************** Multibyte String **************** This set of compatibility functions offers limited support for PHP's -`Multibyte String extension <http://php.net/mbstring>`_. Because of +`Multibyte String extension <https://secure.php.net/mbstring>`_. Because of the limited alternative solutions, only a few functions are available. .. note:: When a character set parameter is ommited, @@ -147,7 +146,7 @@ the limited alternative solutions, only a few functions are available. Dependencies ============ -- `iconv <http://php.net/iconv>`_ extension +- `iconv <https://secure.php.net/iconv>`_ extension .. important:: This dependency is optional and these functions will always be declared. If iconv is not available, they WILL @@ -170,7 +169,7 @@ Function reference :rtype: string For more information, please refer to the `PHP manual for - mb_strlen() <http://php.net/mb_strlen>`_. + mb_strlen() <https://secure.php.net/mb_strlen>`_. .. php:function:: mb_strpos($haystack, $needle[, $offset = 0[, $encoding = NULL]]) @@ -182,7 +181,7 @@ Function reference :rtype: mixed For more information, please refer to the `PHP manual for - mb_strpos() <http://php.net/mb_strpos>`_. + mb_strpos() <https://secure.php.net/mb_strpos>`_. .. php:function:: mb_substr($str, $start[, $length = NULL[, $encoding = NULL]]) @@ -194,7 +193,7 @@ Function reference :rtype: string For more information, please refer to the `PHP manual for - mb_substr() <http://php.net/mb_substr>`_. + mb_substr() <https://secure.php.net/mb_substr>`_. ****************** Standard Functions @@ -220,13 +219,4 @@ Function reference :rtype: array For more information, please refer to the `PHP manual for - array_column() <http://php.net/array_column>`_. - -.. php:function:: hex2bin($data) - - :param array $data: Hexadecimal representation of data - :returns: Binary representation of the given data - :rtype: string - - For more information, please refer to the `PHP manual for hex2bin() - <http://php.net/hex2bin>`_. + array_column() <https://secure.php.net/array_column>`_. diff --git a/user_guide_src/source/general/controllers.rst b/user_guide_src/source/general/controllers.rst index 14e583636..77d19c1cf 100644 --- a/user_guide_src/source/general/controllers.rst +++ b/user_guide_src/source/general/controllers.rst @@ -181,7 +181,7 @@ be passed as a parameter to the ``_remap()`` method:: Any extra segments after the method name are passed into ``_remap()`` as an optional second parameter. This array can be used in combination with -PHP's `call_user_func_array() <http://php.net/call_user_func_array>`_ +PHP's `call_user_func_array() <https://secure.php.net/call_user_func_array>`_ to emulate CodeIgniter's default behavior. Example:: diff --git a/user_guide_src/source/general/credits.rst b/user_guide_src/source/general/credits.rst index d0f14b3bd..66b51a7ad 100644 --- a/user_guide_src/source/general/credits.rst +++ b/user_guide_src/source/general/credits.rst @@ -12,7 +12,7 @@ It was, for years, developed and maintained by EllisLab, the ExpressionEngine Development Team and a group of community members called the Reactor Team. In 2014, CodeIgniter was acquired by the `British Columbia Institute of Technology -<http://www.bcit.ca/>`_ and was then officially announced as a community-maintained +<https://www.bcit.ca/>`_ and was then officially announced as a community-maintained project. Bleeding edge development is spearheaded by the handpicked contributors diff --git a/user_guide_src/source/general/requirements.rst b/user_guide_src/source/general/requirements.rst index f2729f3d5..5b6a0109d 100644 --- a/user_guide_src/source/general/requirements.rst +++ b/user_guide_src/source/general/requirements.rst @@ -2,9 +2,9 @@ Server Requirements ################### -`PHP <http://php.net/>`_ version 5.6 or newer is recommended. +`PHP <https://secure.php.net/>`_ version 5.6 or newer is recommended. -It should work on 5.3.7 as well, but we strongly advise you NOT to run +It should work on 5.4.8 as well, but we strongly advise you NOT to run such old versions of PHP, because of potential security and performance issues, as well as missing features. @@ -15,7 +15,7 @@ Currently supported databases are: - Oracle via the *oci8* and *pdo* drivers - PostgreSQL via the *postgre* and *pdo* drivers - MS SQL via the *mssql*, *sqlsrv* (version 2005 and above only) and *pdo* drivers - - SQLite via the *sqlite* (version 2), *sqlite3* (version 3) and *pdo* drivers + - SQLite via the *sqlite3* and *pdo* drivers - CUBRID via the *cubrid* and *pdo* drivers - Interbase/Firebird via the *ibase* and *pdo* drivers - - ODBC via the *odbc* and *pdo* drivers (you should know that ODBC is actually an abstraction layer)
\ No newline at end of file + - ODBC via the *odbc* and *pdo* drivers (you should know that ODBC is actually an abstraction layer) diff --git a/user_guide_src/source/general/routing.rst b/user_guide_src/source/general/routing.rst index 909289d8d..9c6a339cc 100644 --- a/user_guide_src/source/general/routing.rst +++ b/user_guide_src/source/general/routing.rst @@ -125,7 +125,7 @@ page after they log in, you may find this example useful:: passed to ``Auth::login()``. For those of you who don't know regular expressions and want to learn -more about them, `regular-expressions.info <http://www.regular-expressions.info/>`_ +more about them, `regular-expressions.info <https://www.regular-expressions.info/>`_ might be a good starting point. .. note:: You can also mix and match wildcards with regular expressions. diff --git a/user_guide_src/source/general/security.rst b/user_guide_src/source/general/security.rst index 744a2c934..fb8cd31ff 100644 --- a/user_guide_src/source/general/security.rst +++ b/user_guide_src/source/general/security.rst @@ -130,7 +130,7 @@ with that. Please read below. Also, DON'T invent your own algorithms. Only use strong password hashing algorithms like BCrypt, which is used - in PHP's own `Password Hashing <http://php.net/password>`_ functions. + in PHP's own `Password Hashing <https://secure.php.net/password>`_ functions. Please use them, even if you're not running PHP 5.5+, CodeIgniter provides them for you. diff --git a/user_guide_src/source/general/styleguide.rst b/user_guide_src/source/general/styleguide.rst index 9b4a84e14..6c141efbc 100644 --- a/user_guide_src/source/general/styleguide.rst +++ b/user_guide_src/source/general/styleguide.rst @@ -160,7 +160,7 @@ programmers, but can prove invaluable when returning to your own code months down the line. There is not a required format for comments, but the following are recommended. -`DocBlock <http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#basics.docblock>`_ +`DocBlock <https://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#basics.docblock>`_ style comments preceding class, method, and property declarations so they can be picked up by IDEs:: @@ -319,7 +319,7 @@ Use **===** and **!==** as necessary. See also information regarding `typecasting -<http://php.net/manual/en/language.types.type-juggling.php#language.types.typecasting>`_, +<https://secure.php.net/manual/en/language.types.type-juggling.php#language.types.typecasting>`_, which can be quite useful. Typecasting has a slightly different effect which may be desirable. When casting a variable as a string, for instance, NULL and boolean FALSE variables become empty strings, 0 (and @@ -346,7 +346,7 @@ Compatibility ============= CodeIgniter recommends PHP 5.6 or newer to be used, but it should be -compatible with PHP 5.3.7. Your code must either be compatible with this +compatible with PHP 5.4.8. Your code must either be compatible with this requirement, provide a suitable fallback, or be an optional feature that dies quietly without affecting a user's application. @@ -542,7 +542,7 @@ the ability to change this in the php.ini, you can often enable it with:: ini_set('display_errors', 1); .. note:: Setting the `display_errors - <http://php.net/manual/en/errorfunc.configuration.php#ini.display-errors>`_ + <https://secure.php.net/manual/en/errorfunc.configuration.php#ini.display-errors>`_ setting with ``ini_set()`` at runtime is not identical to having it enabled in the PHP environment. Namely, it will not have any effect if the script has fatal errors. @@ -633,4 +633,4 @@ Whenever appropriate, provide function argument defaults, which helps prevent PHP errors with mistaken calls and provides common fallback values which can save a few lines of code. Example:: - function foo($bar = '', $baz = FALSE)
\ No newline at end of file + function foo($bar = '', $baz = FALSE) diff --git a/user_guide_src/source/helpers/captcha_helper.rst b/user_guide_src/source/helpers/captcha_helper.rst index be1b20aaf..a1c13c5c8 100644 --- a/user_guide_src/source/helpers/captcha_helper.rst +++ b/user_guide_src/source/helpers/captcha_helper.rst @@ -50,7 +50,8 @@ Once loaded you can generate a CAPTCHA like this:: echo $cap['image']; - The captcha function requires the GD image library. -- Only the **img_path** and **img_url** are required. +- The **img_path** and **img_url** are both required if you want to write images to disk. + To create ``data:image/png;base64`` images, simply omit these options. - If a **word** is not supplied, the function will generate a random ASCII string. You might put together your own word library that you can draw randomly from. @@ -89,10 +90,6 @@ Here is an example of usage with a database. On the page where the CAPTCHA will be shown you'll have something like this:: $this->load->helper('captcha'); - $vals = array( Â Â Â Â - 'img_path' => './captcha/', Â Â Â Â - 'img_url' => 'http://example.com/captcha/' Â Â Â Â - ); $cap = create_captcha($vals); $data = array( Â Â Â Â @@ -155,7 +152,7 @@ The following functions are available: The **image** is the actual image tag:: - <img src="http://example.com/captcha/12345.jpg" width="140" height="50" /> + <img src="data:image/png;base64,RHVtbXkgZXhhbXBsZQ==" width="140" height="50" /> The **time** is the micro timestamp used as the image name without the file extension. It will be a number like this: 1139612155.3422 diff --git a/user_guide_src/source/helpers/cookie_helper.rst b/user_guide_src/source/helpers/cookie_helper.rst index 2ad51e78c..25c4c3a0b 100644 --- a/user_guide_src/source/helpers/cookie_helper.rst +++ b/user_guide_src/source/helpers/cookie_helper.rst @@ -25,7 +25,7 @@ Available Functions The following functions are available: -.. php:function:: set_cookie($name[, $value = ''[, $expire = ''[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = NULL[, $httponly = NULL]]]]]]]) +.. php:function:: set_cookie($name[, $value = ''[, $expire = 0[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = NULL[, $httponly = NULL]]]]]]]) :param mixed $name: Cookie name *or* associative array of all of the parameters available to this function :param string $value: Cookie value @@ -42,7 +42,7 @@ The following functions are available: a description of its use, as this function is an alias for ``CI_Input::set_cookie()``. -.. php:function:: get_cookie($index[, $xss_clean = NULL]) +.. php:function:: get_cookie($index[, $xss_clean = FALSE]) :param string $index: Cookie name :param bool $xss_clean: Whether to apply XSS filtering to the returned value diff --git a/user_guide_src/source/helpers/date_helper.rst b/user_guide_src/source/helpers/date_helper.rst index 6bc6c2b05..c63a9d291 100644 --- a/user_guide_src/source/helpers/date_helper.rst +++ b/user_guide_src/source/helpers/date_helper.rst @@ -50,7 +50,7 @@ The following functions are available: :returns: MySQL-formatted date :rtype: string - This function is identical to PHP's `date() <http://php.net/manual/en/function.date.php>`_ + This function is identical to PHP's `date() <https://secure.php.net/manual/en/function.date.php>`_ function, except that it lets you use MySQL style date codes, where each code letter is preceded with a percent sign, e.g. `%Y %m %d` @@ -67,45 +67,6 @@ The following functions are available: If a timestamp is not included in the second parameter the current time will be used. -.. php:function:: standard_date([$fmt = 'DATE_RFC822'[, $time = NULL]]) - - :param string $fmt: Date format - :param int $time: UNIX timestamp - :returns: Formatted date or FALSE on invalid format - :rtype: string - - Lets you generate a date string in one of several standardized formats. - - Example:: - - $format = 'DATE_RFC822'; - $time = time(); - echo standard_date($format, $time); - - .. note:: This function is DEPRECATED. Use the native ``date()`` combined with - `DateTime's format constants - <https://secure.php.net/manual/en/class.datetime.php#datetime.constants.types>`_ - instead:: - - echo date(DATE_RFC822, time()); - - **Supported formats:** - - =============== ======================= ====================================== - Constant Description Example - =============== ======================= ====================================== - DATE_ATOM Atom 2005-08-15T16:13:03+0000 - DATE_COOKIE HTTP Cookies Sun, 14 Aug 2005 16:13:03 UTC - DATE_ISO8601 ISO-8601 2005-08-14T16:13:03+00:00 - DATE_RFC822 RFC 822 Sun, 14 Aug 05 16:13:03 UTC - DATE_RFC850 RFC 850 Sunday, 14-Aug-05 16:13:03 UTC - DATE_RFC1036 RFC 1036 Sunday, 14-Aug-05 16:13:03 UTC - DATE_RFC1123 RFC 1123 Sun, 14 Aug 2005 16:13:03 UTC - DATE_RFC2822 RFC 2822 Sun, 14 Aug 2005 16:13:03 +0000 - DATE_RSS RSS Sun, 14 Aug 2005 16:13:03 UTC - DATE_W3C W3C 2005-08-14T16:13:03+0000 - =============== ======================= ====================================== - .. php:function:: local_to_gmt([$time = '']) :param int $time: UNIX timestamp diff --git a/user_guide_src/source/helpers/download_helper.rst b/user_guide_src/source/helpers/download_helper.rst index 1a4065073..e11d92a14 100644 --- a/user_guide_src/source/helpers/download_helper.rst +++ b/user_guide_src/source/helpers/download_helper.rst @@ -26,7 +26,7 @@ The following functions are available: .. php:function:: force_download([$filename = ''[, $data = ''[, $set_mime = FALSE]]]) - :param string $filename: Filename + :param mixed $filename: Filename :param mixed $data: File contents :param bool $set_mime: Whether to try to send the actual MIME type :rtype: void @@ -37,8 +37,11 @@ The following functions are available: file data. If you set the second parameter to NULL and ``$filename`` is an existing, readable - file path, then its content will be read instead. - + file path, then its content will be read instead. You may also set ``$filename`` + as an associative array with a single element, where the key of that element would be + the local file you are trying to read and where the value is the name of the downloadable + file that will be sent to browser. An example of this is provided below. + If you set the third parameter to boolean TRUE, then the actual file MIME type (based on the filename extension) will be sent, so that if your browser has a handler for that type - it can use it. @@ -53,4 +56,10 @@ The following functions are available: do the following:: // Contents of photo.jpg will be automatically read - force_download('/path/to/photo.jpg', NULL);
\ No newline at end of file + force_download('/path/to/photo.jpg', NULL); + + If you want to download an existing file from your server, but change the name + of the actual file sent to browser, you will need this:: + + // Contents of photo.jpg will be automatically read and sent as my-photo.jpg + force_download(array('/path/to/photo.jpg' => 'my-photo.jpg'), NULL);
\ No newline at end of file diff --git a/user_guide_src/source/helpers/email_helper.rst b/user_guide_src/source/helpers/email_helper.rst deleted file mode 100644 index 1ee97d902..000000000 --- a/user_guide_src/source/helpers/email_helper.rst +++ /dev/null @@ -1,75 +0,0 @@ -############ -Email Helper -############ - -The Email Helper provides some assistive functions for working with -Email. For a more robust email solution, see CodeIgniter's :doc:`Email -Class <../libraries/email>`. - -.. important:: The Email helper is DEPRECATED and is currently - only kept for backwards compatibility. - -.. contents:: - :local: - -.. raw:: html - - <div class="custom-index container"></div> - -Loading this Helper -=================== - -This helper is loaded using the following code:: - - $this->load->helper('email'); - -Available Functions -=================== - -The following functions are available: - - -.. php:function:: valid_email($email) - - :param string $email: E-mail address - :returns: TRUE if a valid email is supplied, FALSE otherwise - :rtype: bool - - Checks if the input is a correctly formatted e-mail address. Note that is - doesn't actually prove that the address will be able recieve mail, but - simply that it is a validly formed address. - - Example:: - - if (valid_email('email@somesite.com')) - { - echo 'email is valid'; - } - else - { - echo 'email is not valid'; - } - - .. note:: All that this function does is to use PHP's native ``filter_var()``:: - - (bool) filter_var($email, FILTER_VALIDATE_EMAIL); - -.. php:function:: send_email($recipient, $subject, $message) - - :param string $recipient: E-mail address - :param string $subject: Mail subject - :param string $message: Message body - :returns: TRUE if the mail was successfully sent, FALSE in case of an error - :rtype: bool - - Sends an email using PHP's native `mail() <http://php.net/function.mail>`_ - function. - - .. note:: All that this function does is to use PHP's native ``mail`` - - :: - - mail($recipient, $subject, $message); - - For a more robust email solution, see CodeIgniter's :doc:`Email Library - <../libraries/email>`.
\ No newline at end of file diff --git a/user_guide_src/source/helpers/file_helper.rst b/user_guide_src/source/helpers/file_helper.rst index 833cddea4..e96546a11 100644 --- a/user_guide_src/source/helpers/file_helper.rst +++ b/user_guide_src/source/helpers/file_helper.rst @@ -23,32 +23,6 @@ Available Functions The following functions are available: - -.. php:function:: read_file($file) - - :param string $file: File path - :returns: File contents or FALSE on failure - :rtype: string - - Returns the data contained in the file specified in the path. - - Example:: - - $string = read_file('./path/to/file.php'); - - The path can be a relative or full server path. Returns FALSE (boolean) on failure. - - .. note:: The path is relative to your main site index.php file, NOT your - controller or view files. CodeIgniter uses a front controller so paths - are always relative to the main site index. - - .. note:: This function is DEPRECATED. Use the native ``file_get_contents()`` - instead. - - .. important:: If your server is running an **open_basedir** restriction this - function might not work if you are trying to access a file above the - calling script. - .. php:function:: write_file($path, $data[, $mode = 'wb']) :param string $path: File path @@ -76,7 +50,7 @@ The following functions are available: write_file('./path/to/file.php', $data, 'r+'); - The default mode is 'wb'. Please see the `PHP user guide <http://php.net/manual/en/function.fopen.php>`_ + The default mode is 'wb'. Please see the `PHP user guide <https://secure.php.net/manual/en/function.fopen.php>`_ for mode options. .. note: In order for this function to write data to a file, its permissions must @@ -199,4 +173,4 @@ The following functions are available: :: - echo octal_permissions(fileperms('./index.php')); // 644
\ No newline at end of file + echo octal_permissions(fileperms('./index.php')); // 644 diff --git a/user_guide_src/source/helpers/form_helper.rst b/user_guide_src/source/helpers/form_helper.rst index 8da5d22b5..43a20e18c 100644 --- a/user_guide_src/source/helpers/form_helper.rst +++ b/user_guide_src/source/helpers/form_helper.rst @@ -243,10 +243,9 @@ The following functions are available: function above except that it uses the "password" input type. -.. php:function:: form_upload([$data = ''[, $value = ''[, $extra = '']]]) +.. php:function:: form_upload([$data = '', $extra = '']]) :param array $data: Field attributes data - :param string $value: Field value :param mixed $extra: Extra attributes to be added to the tag either as an array or a literal string :returns: An HTML file upload input field tag :rtype: string @@ -724,20 +723,3 @@ The following functions are available: <span class="error">The "password" field doesn't match the "repeat_password" field!</span> */ - -.. php:function:: form_prep($str) - - :param string $str: Value to escape - :returns: Escaped value - :rtype: string - - Allows you to safely use HTML and characters such as quotes within form - elements without breaking out of the form. - - .. note:: If you use any of the form helper functions listed in this page the form - values will be prepped automatically, so there is no need to call this - function. Use it only if you are creating your own form elements. - - .. note:: This function is DEPRECATED and is just an alias for - :doc:`common function <../general/common_functions>` - :func:`html_escape()` - please use that instead. diff --git a/user_guide_src/source/helpers/html_helper.rst b/user_guide_src/source/helpers/html_helper.rst index 2c748bea0..e4738b157 100644 --- a/user_guide_src/source/helpers/html_helper.rst +++ b/user_guide_src/source/helpers/html_helper.rst @@ -286,7 +286,7 @@ The following functions are available: // Generates: <meta name="description" content="My Great Site" /> echo meta('Content-type', 'text/html; charset=utf-8', 'equiv'); - // Note the third parameter. Can be "equiv" or "name" + // Note the third parameter. Can be "charset", "http-equiv", "name" or "property" // Generates: <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> echo meta(array('name' => 'robots', 'content' => 'no-cache')); @@ -310,8 +310,13 @@ The following functions are available: 'content' => 'no-cache' ), array( - 'name' => 'Content-type', - 'content' => 'text/html; charset=utf-8', 'type' => 'equiv' + 'name' => 'Content-Type', + 'type' => 'http-equiv', + 'content' => 'text/html; charset=utf-8' + ), + array( + 'name' => 'UTF-8', + 'type' => 'charset' ) ); @@ -321,23 +326,24 @@ The following functions are available: // <meta name="description" content="My Great Site" /> // <meta name="keywords" content="love, passion, intrigue, deception" /> // <meta name="robots" content="no-cache" /> - // <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> + // <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + // <meta charset="UTF-8" /> -.. php:function:: doctype([$type = 'xhtml1-strict']) +.. php:function:: doctype([$type = 'html5']) :param string $type: Doctype name :returns: HTML DocType tag :rtype: string - Helps you generate document type declarations, or DTD's. XHTML 1.0 - Strict is used by default, but many doctypes are available. + Helps you generate document type declarations, or DTD's. HTML 5 + is used by default, but many doctypes are available. Example:: - echo doctype(); // <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + echo doctype(); // <!DOCTYPE html> - echo doctype('html4-trans'); // <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> + echo doctype('html4-trans'); // <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "https://www.w3.org/TR/html4/strict.dtd"> The following is a list of doctype choices. These are configurable, and pulled from application/config/doctypes.php @@ -345,63 +351,23 @@ The following functions are available: =============================== =================== ================================================================================================================================================== Document type Option Result =============================== =================== ================================================================================================================================================== - XHTML 1.1 xhtml11 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> - XHTML 1.0 Strict xhtml1-strict <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - XHTML 1.0 Transitional xhtml1-trans <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - XHTML 1.0 Frameset xhtml1-frame <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> - XHTML Basic 1.1 xhtml-basic11 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd"> + XHTML 1.1 xhtml11 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "https://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> + XHTML 1.0 Strict xhtml1-strict <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + XHTML 1.0 Transitional xhtml1-trans <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + XHTML 1.0 Frameset xhtml1-frame <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> + XHTML Basic 1.1 xhtml-basic11 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "https://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd"> HTML 5 html5 <!DOCTYPE html> - HTML 4 Strict html4-strict <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> - HTML 4 Transitional html4-trans <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> - HTML 4 Frameset html4-frame <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> - MathML 1.01 mathml1 <!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd"> - MathML 2.0 mathml2 <!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd"> - SVG 1.0 svg10 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> - SVG 1.1 Full svg11 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> - SVG 1.1 Basic svg11-basic <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd"> - SVG 1.1 Tiny svg11-tiny <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd"> - XHTML+MathML+SVG (XHTML host) xhtml-math-svg-xh <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"> - XHTML+MathML+SVG (SVG host) xhtml-math-svg-sh <!DOCTYPE svg:svg PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"> - XHTML+RDFa 1.0 xhtml-rdfa-1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> - XHTML+RDFa 1.1 xhtml-rdfa-2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd"> + HTML 4 Strict html4-strict <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "https://www.w3.org/TR/html4/strict.dtd"> + HTML 4 Transitional html4-trans <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd"> + HTML 4 Frameset html4-frame <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "https://www.w3.org/TR/html4/frameset.dtd"> + MathML 1.01 mathml1 <!DOCTYPE math SYSTEM "https://www.w3.org/Math/DTD/mathml1/mathml.dtd"> + MathML 2.0 mathml2 <!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "https://www.w3.org/Math/DTD/mathml2/mathml2.dtd"> + SVG 1.0 svg10 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "https://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> + SVG 1.1 Full svg11 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> + SVG 1.1 Basic svg11-basic <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "https://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd"> + SVG 1.1 Tiny svg11-tiny <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "https://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd"> + XHTML+MathML+SVG (XHTML host) xhtml-math-svg-xh <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "https://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"> + XHTML+MathML+SVG (SVG host) xhtml-math-svg-sh <!DOCTYPE svg:svg PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "https://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"> + XHTML+RDFa 1.0 xhtml-rdfa-1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "https://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> + XHTML+RDFa 1.1 xhtml-rdfa-2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "https://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd"> =============================== =================== ================================================================================================================================================== - -.. php:function:: br([$count = 1]) - - :param int $count: Number of times to repeat the tag - :returns: HTML line break tag - :rtype: string - - Generates line break tags (<br />) based on the number you submit. - Example:: - - echo br(3); - - The above would produce: - - .. code-block:: html - - <br /><br /><br /> - - .. note:: This function is DEPRECATED. Use the native ``str_repeat()`` - in combination with ``<br />`` instead. - -.. php:function:: nbs([$num = 1]) - - :param int $num: Number of space entities to produce - :returns: A sequence of non-breaking space HTML entities - :rtype: string - - Generates non-breaking spaces ( ) based on the number you submit. - Example:: - - echo nbs(3); - - The above would produce: - - .. code-block:: html - - - - .. note:: This function is DEPRECATED. Use the native ``str_repeat()`` - in combination with `` `` instead. diff --git a/user_guide_src/source/helpers/inflector_helper.rst b/user_guide_src/source/helpers/inflector_helper.rst index df0c568c0..ca781d2ad 100644 --- a/user_guide_src/source/helpers/inflector_helper.rst +++ b/user_guide_src/source/helpers/inflector_helper.rst @@ -85,7 +85,7 @@ The following functions are available: echo humanize('my-dog-spot', '-'); // Prints 'My Dog Spot' -.. php:function:: is_countable($word) +.. php:function:: word_is_countable($word) :param string $word: Input string :returns: TRUE if the word is countable or FALSE if not @@ -93,4 +93,23 @@ The following functions are available: Checks if the given word has a plural version. Example:: - is_countable('equipment'); // Returns FALSE
\ No newline at end of file + word_is_countable('equipment'); // Returns FALSE + + .. note:: This function used to be called ``is_countable()`` in + in previous CodeIgniter versions. + +.. php:function:: ordinal_format($number) + + :param int $number: non-negative natural number to be converted + :returns: Ordinal numeral for given number or original value on failure + :rtype: string + + Returns the ordinal numeral (1st, 2nd, 3rd etc.) for a + non-negative natural number. If the input is not a natural number + greater than 0, the function will return the original value. Examples:: + + echo ordinal_format(1); // Returns 1st + echo ordinal_format(3); // Returns 3rd + echo ordinal_format(21); // Returns 21st + echo ordinal_format(102); // Returns 102nd + echo ordinal_format(-5); // Invalid input, will return -5 diff --git a/user_guide_src/source/helpers/security_helper.rst b/user_guide_src/source/helpers/security_helper.rst index 103880cf9..e981bc6b6 100644 --- a/user_guide_src/source/helpers/security_helper.rst +++ b/user_guide_src/source/helpers/security_helper.rst @@ -48,31 +48,6 @@ The following functions are available: For more info, please see the :doc:`Security Library <../libraries/security>` documentation. - -.. php:function:: do_hash($str[, $type = 'sha1']) - - :param string $str: Input - :param string $type: Algorithm - :returns: Hex-formatted hash - :rtype: string - - Permits you to create one way hashes suitable for encrypting - passwords. Will use SHA1 by default. - - See `hash_algos() <http://php.net/function.hash_algos>`_ - for a full list of supported algorithms. - - Examples:: - - $str = do_hash($str); // SHA1 - $str = do_hash($str, 'md5'); // MD5 - - .. note:: This function was formerly named ``dohash()``, which has been - removed in favor of ``do_hash()``. - - .. note:: This function is DEPRECATED. Use the native ``hash()`` instead. - - .. php:function:: strip_image_tags($str) :param string $str: Input string @@ -103,4 +78,4 @@ The following functions are available: Example:: - $string = encode_php_tags($string);
\ No newline at end of file + $string = encode_php_tags($string); diff --git a/user_guide_src/source/helpers/smiley_helper.rst b/user_guide_src/source/helpers/smiley_helper.rst deleted file mode 100644 index 3e7669942..000000000 --- a/user_guide_src/source/helpers/smiley_helper.rst +++ /dev/null @@ -1,169 +0,0 @@ -############# -Smiley Helper -############# - -The Smiley Helper file contains functions that let you manage smileys -(emoticons). - -.. important:: The Smiley helper is DEPRECATED and should not be used. - It is currently only kept for backwards compatibility. - -.. contents:: - :local: - -.. raw:: html - - <div class="custom-index container"></div> - -Loading this Helper -=================== - -This helper is loaded using the following code:: - - $this->load->helper('smiley'); - -Overview -======== - -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 -be inserted into a form field. For example, if you have a blog that -allows user commenting you can show the smileys next to the comment -form. Your users can click a desired smiley and with the help of some -JavaScript it will be placed into the form field. - -Clickable Smileys Tutorial -========================== - -Here is an example demonstrating how you might create a set of clickable -smileys next to a form field. This example requires that you first -download and install the smiley images, then create a controller and the -View as described. - -.. important:: Before you begin, please `download the smiley images - <https://ellislab.com/asset/ci_download_files/smileys.zip>`_ - and put them in a publicly accessible place on your server. - This helper also assumes you have the smiley replacement array - located at `application/config/smileys.php` - -The Controller --------------- - -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. - -You'll notice that in addition to the smiley helper, we are also using -the :doc:`Table Class <../libraries/table>`:: - - <?php - - class Smileys extends CI_Controller { - - public function index() - { - $this->load->helper('smiley'); - $this->load->library('table'); - - $image_array = get_clickable_smileys('http://example.com/images/smileys/', 'comments'); - $col_array = $this->table->make_columns($image_array, 8); - - $data['smiley_table'] = $this->table->generate($col_array); - $this->load->view('smiley_view', $data); - } - - } - -In your **application/views/** directory, create a file called **smiley_view.php** -and place this code in it:: - - <html> - <head> - <title>Smileys</title> - <?php echo smiley_js(); ?> - </head> - <body> - <form name="blog"> - <textarea name="comments" id="comments" cols="40" rows="4"></textarea> - </form> - <p>Click to insert a smiley!</p> - <?php echo $smiley_table; ?> </body> </html> - When you have created the above controller and view, load it by visiting http://www.example.com/index.php/smileys/ - </body> - </html> - -Field Aliases -------------- - -When making changes to a view it can be inconvenient to have the field -id in the controller. To work around this, you can give your smiley -links a generic name that will be tied to a specific id in your view. - -:: - - $image_array = get_smiley_links("http://example.com/images/smileys/", "comment_textarea_alias"); - -To map the alias to the field id, pass them both into the -:func:`smiley_js()` function:: - - $image_array = smiley_js("comment_textarea_alias", "comments"); - -Available Functions -=================== - -.. php:function:: get_clickable_smileys($image_url[, $alias = ''[, $smileys = NULL]]) - - :param string $image_url: URL path to the smileys directory - :param string $alias: Field alias - :returns: An array of ready to use smileys - :rtype: array - - Returns an array containing your smiley images wrapped in a clickable - link. You must supply the URL to your smiley folder and a field id or - field alias. - - Example:: - - $image_array = get_clickable_smileys('http://example.com/images/smileys/', 'comment'); - -.. php:function:: smiley_js([$alias = ''[, $field_id = ''[, $inline = TRUE]]]) - - :param string $alias: Field alias - :param string $field_id: Field ID - :param bool $inline: Whether we're inserting an inline smiley - :returns: Smiley-enabling JavaScript code - :rtype: string - - Generates the JavaScript that allows the images to be clicked and - inserted into a form field. If you supplied an alias instead of an id - when generating your smiley links, you need to pass the alias and - corresponding form id into the function. This function is designed to be - placed into the <head> area of your web page. - - Example:: - - <?php echo smiley_js(); ?> - -.. php:function:: parse_smileys([$str = ''[, $image_url = ''[, $smileys = NULL]]]) - - :param string $str: Text containing smiley codes - :param string $image_url: URL path to the smileys directory - :param array $smileys: An array of smileys - :returns: Parsed smileys - :rtype: string - - Takes a string of text as input and replaces any contained plain text - smileys into the image equivalent. The first parameter must contain your - string, the second must contain the URL to your smiley folder - - Example:: - - $str = 'Here are some smileys: :-) ;-)'; - $str = parse_smileys($str, 'http://example.com/images/smileys/'); - echo $str; - -.. |smile!| image:: ../images/smile.gif
\ No newline at end of file diff --git a/user_guide_src/source/helpers/string_helper.rst b/user_guide_src/source/helpers/string_helper.rst index 6dabc60d3..4663bb08b 100644 --- a/user_guide_src/source/helpers/string_helper.rst +++ b/user_guide_src/source/helpers/string_helper.rst @@ -27,7 +27,6 @@ Available Functions The following functions are available: - .. php:function:: random_string([$type = 'alnum'[, $len = 8]]) :param string $type: Randomization type @@ -102,24 +101,6 @@ The following functions are available: .. note:: To use multiple separate calls to this function simply call the function with no arguments to re-initialize. -.. php:function:: repeater($data[, $num = 1]) - - :param string $data: Input - :param int $num: Number of times to repeat - :returns: Repeated string - :rtype: string - - Generates repeating copies of the data you submit. Example:: - - $string = "\n"; - echo repeater($string, 30); - - The above would generate 30 newlines. - - .. note:: This function is DEPRECATED. Use the native ``str_repeat()`` - instead. - - .. php:function:: reduce_double_slashes($str) :param string $str: Input string @@ -134,7 +115,6 @@ The following functions are available: $string = "http://example.com//index.php"; echo reduce_double_slashes($string); // results in "http://example.com/index.php" - .. php:function:: strip_slashes($data) :param mixed $data: Input string or an array of strings @@ -163,21 +143,6 @@ The following functions are available: and handle string inputs. This however makes it just an alias for ``stripslashes()``. -.. php:function:: trim_slashes($str) - - :param string $str: Input string - :returns: Slash-trimmed string - :rtype: string - - Removes any leading/trailing slashes from a string. Example:: - - $string = "/this/that/theother/"; - echo trim_slashes($string); // results in this/that/theother - - .. note:: This function is DEPRECATED. Use the native ``trim()`` instead: - | - | trim($str, '/'); - .. php:function:: reduce_multiples($str[, $character = ''[, $trim = FALSE]]) :param string $str: Text to search in diff --git a/user_guide_src/source/helpers/url_helper.rst b/user_guide_src/source/helpers/url_helper.rst index e117d37c0..adeab8c58 100644 --- a/user_guide_src/source/helpers/url_helper.rst +++ b/user_guide_src/source/helpers/url_helper.rst @@ -204,7 +204,7 @@ The following functions are available: | echo anchor_popup('news/local/123', 'Click Me!', array()); .. note:: The **window_name** is not really an attribute, but an argument to - the JavaScript `window.open() <http://www.w3schools.com/jsref/met_win_open.asp>` + the JavaScript `window.open() <https://www.w3schools.com/jsref/met_win_open.asp>` method, which accepts either a window name or a window target. .. note:: Any other attribute than the listed above will be parsed as an diff --git a/user_guide_src/source/images/smile.gif b/user_guide_src/source/images/smile.gif Binary files differdeleted file mode 100644 index bf0922504..000000000 --- a/user_guide_src/source/images/smile.gif +++ /dev/null diff --git a/user_guide_src/source/installation/downloads.rst b/user_guide_src/source/installation/downloads.rst index 5407e44e1..60d1881b3 100644 --- a/user_guide_src/source/installation/downloads.rst +++ b/user_guide_src/source/installation/downloads.rst @@ -2,7 +2,8 @@ Downloading CodeIgniter ####################### -- `CodeIgniter v3.1.10-dev (Current version) <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1-stable>`_ +- `CodeIgniter v3.2.0-dev (Current version) <https://codeload.github.com/bcit-ci/CodeIgniter/zip/develop>`_ +- `CodeIgniter v3.1.10-dev <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1-stable>`_ - `CodeIgniter v3.1.9 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1.9>`_ - `CodeIgniter v3.1.8 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1.8>`_ - `CodeIgniter v3.1.7 <https://codeload.github.com/bcit-ci/CodeIgniter/zip/3.1.7>`_ @@ -37,7 +38,7 @@ Downloading CodeIgniter GitHub ****** -`Git <http://git-scm.com/about>`_ is a distributed version control system. +`Git <https://git-scm.com/about>`_ is a distributed version control system. Public Git access is available at `GitHub <https://github.com/bcit-ci/CodeIgniter>`_. Please note that while every effort is made to keep this code base diff --git a/user_guide_src/source/installation/upgrade_220.rst b/user_guide_src/source/installation/upgrade_220.rst index 91f9e00cd..489dd6312 100644 --- a/user_guide_src/source/installation/upgrade_220.rst +++ b/user_guide_src/source/installation/upgrade_220.rst @@ -7,7 +7,7 @@ Upgrading from 2.1.4 to 2.2.x without Mcrypt, then this is a breaking change. You must install the Mcrypt extension in order to upgrade. For information on installing Mcrypt please see the PHP `documentation - <http://php.net/manual/en/mcrypt.setup.php>`. + <https://secure.php.net/manual/en/mcrypt.setup.php>`. Before performing an update you should take your site offline by replacing the index.php file with a static one. diff --git a/user_guide_src/source/installation/upgrade_300.rst b/user_guide_src/source/installation/upgrade_300.rst index 5b2d3947d..188144844 100644 --- a/user_guide_src/source/installation/upgrade_300.rst +++ b/user_guide_src/source/installation/upgrade_300.rst @@ -532,9 +532,9 @@ the ``EXT`` constant has been removed. Use just '.php' instead. Smiley helper ============= -The :doc:`Smiley Helper <../helpers/smiley_helper>` is a legacy feature from EllisLab's -ExpressionEngine product. However, it is too specific for a general purpose framework like -CodeIgniter and as such it is now deprecated. +The *Smiley Helper* is a legacy feature from EllisLab's ExpressionEngine product. +However, it is too specific for a general purpose framework like CodeIgniter +and as such it is now deprecated. Also, the previously deprecated ``js_insert_smiley()`` (since version 1.7.2) is now removed. @@ -545,8 +545,8 @@ Following numerous vulnerability reports, the :doc:`Encrypt Library <../librarie been deprecated and a new, :doc:`Encryption Library <../libraries/encryption>` is added to take its place. -The new library requires either the `MCrypt extension <http://php.net/mcrypt>`_ (and /dev/urandom -availability) or PHP 5.3.3 and the `OpenSSL extension <http://php.net/openssl>`_. +The new library requires either the `MCrypt extension <https://secure.php.net/mcrypt>`_ (and /dev/urandom +availability) or PHP 5.3.3 and the `OpenSSL extension <https://secure.php.net/openssl>`_. While this might be rather inconvenient, it is a requirement that allows us to have properly implemented cryptographic functions. @@ -559,12 +559,12 @@ implemented cryptographic functions. The Cart library ================ -The :doc:`Cart Library <../libraries/cart>`, similarly to the :doc:`Smiley Helper -<../helpers/smiley_helper>` is too specific for CodeIgniter. It is now deprecated -and scheduled for removal in CodeIgniter 3.1+. +The *Cart Library*, similarly to the *Smiley Helper* is too specific for +CodeIgniter. It is now deprecated and scheduled for removal in +CodeIgniter 3.1+. -.. note:: The library is still available, but you're strongly encouraged to remove its usage sooner - rather than later. +.. note:: The library is still available, but you're strongly encouraged to + remove its usage sooner rather than later. Database drivers 'mysql', 'sqlite', 'mssql', 'pdo/dblib' ======================================================== @@ -624,7 +624,7 @@ CodeIgniter 3.1+. String helper repeater() ======================== -:doc:`String Helper <../helpers/string_helper>` function :php:func:`repeater()` is now just an alias for +:doc:`String Helper <../helpers/string_helper>` function ``repeater()`` is now just an alias for PHP's native ``str_repeat()`` function. It is deprecated and scheduled for removal in CodeIgniter 3.1+. .. note:: This function is still available, but you're strongly encouraged to remove its usage sooner @@ -633,7 +633,7 @@ PHP's native ``str_repeat()`` function. It is deprecated and scheduled for remov String helper trim_slashes() ============================ -:doc:`String Helper <../helpers/string_helper>` function :php:func:`trim_slashes()` is now just an alias +:doc:`String Helper <../helpers/string_helper>` function ``trim_slashes()`` is now just an alias for PHP's native ``trim()`` function (with a slash passed as its second argument). It is deprecated and scheduled for removal in CodeIgniter 3.1+. @@ -643,8 +643,8 @@ scheduled for removal in CodeIgniter 3.1+. Form helper form_prep() ======================= -:doc:`Form Helper <../helpers/form_helper>` function :php:func:`form_prep()` -is now just an alias for :doc:`common function </general/common_functions>` +:doc:`Form Helper <../helpers/form_helper>` function ``form_prep()`` is now +just an alias for :doc:`common function </general/common_functions>` :func:`html_escape()`. It is deprecated and will be removed in the future. Please use :php:func:`html_escape()` instead. @@ -655,14 +655,13 @@ Please use :php:func:`html_escape()` instead. Email helper functions ====================== -:doc:`Email Helper <../helpers/email_helper>` only has two functions +The *Email Helper* only has two functions: - - :php:func:`valid_email()` - - :php:func:`send_email()` + - ``valid_email()`` + - ``send_email()`` Both of them are now aliases for PHP's native ``filter_var()`` and ``mail()`` functions, respectively. -Therefore the :doc:`Email Helper <../helpers/email_helper>` altogether is being deprecated and -is scheduled for removal in CodeIgniter 3.1+. +Therefore, the *Email Helper* altogether is being deprecated and is scheduled for removal in CodeIgniter 3.1+. .. note:: These functions are still available, but you're strongly encouraged to remove their usage sooner rather than later. @@ -671,7 +670,7 @@ Date helper standard_date() =========================== :doc:`Date Helper <../helpers/date_helper>` function ``standard_date()`` is being deprecated due -to the availability of native PHP `constants <http://php.net/manual/en/class.datetime.php#datetime.constants.types>`_, +to the availability of native PHP `constants <https://secure.php.net/manual/en/class.datetime.php#datetime.constants.types>`_, which when combined with ``date()`` provide the same functionality. Furthermore, they have the exact same names as the ones supported by ``standard_date()``. Here are examples of how to replace its usage: @@ -845,8 +844,8 @@ CodeIgniter 3.1+. The Javascript library ====================== -The :doc:`Javascript Library <../libraries/javascript>` has always had an -'experimental' status and was never really useful, nor a proper solution. +The *Javascript Library* has always had an 'experimental' status and was +never really useful, nor a proper solution. It is now deprecated and scheduled for removal in CodeIgniter 3.1+. diff --git a/user_guide_src/source/installation/upgrade_310.rst b/user_guide_src/source/installation/upgrade_310.rst index 9e0108691..cae814327 100644 --- a/user_guide_src/source/installation/upgrade_310.rst +++ b/user_guide_src/source/installation/upgrade_310.rst @@ -35,4 +35,4 @@ does not provide a function that allows to safely escape user-supplied strings f inside an SQL query (which our :doc:`Query Builder <../database/query_builder>` relies on). Thus, user inputs MUST be bound, as shown in :doc:`Running Queries <../database/queries>`, -under the "Query Bindings" section.
\ No newline at end of file +under the "Query Bindings" section. diff --git a/user_guide_src/source/installation/upgrade_320.rst b/user_guide_src/source/installation/upgrade_320.rst new file mode 100644 index 000000000..a9dc274c7 --- /dev/null +++ b/user_guide_src/source/installation/upgrade_320.rst @@ -0,0 +1,270 @@ +############################# +Upgrading from 3.1.x to 3.2.x +############################# + +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/* directory. + +.. note:: If you have any custom developed files in these directories, + please make copies of them first. + +Step 2: Check your PHP version +============================== + +We recommend always running versions that are `currently supported +<https://secure.php.net/supported-versions.php>`_, which right now is at least PHP 5.6. + +PHP 5.3.x versions are now officially not supported by CodeIgniter, and while 5.4.8+ +may be at least runnable, we strongly discourage you from using any PHP versions below +the ones listed on the `PHP.net Supported Versions <https://secure.php.net/supported-versions.php>`_ +page. + +Step 3: Remove calls to ``CI_Model::__construct()`` +=================================================== + +The class constructor for ``CI_Model`` never contained vital code or useful +logic, only a single line to log a message. A change in CodeIgniter 3.1.7 +moved this log message elsewhere and that naturally made the constructor +completely unnecessary. However, it was left in place to avoid immedate BC +breaks in a minor release. + +In version 3.2.0, that constructor is entirely removed, which would result +in fatal errors on attempts to call it. Particularly in code like this: +:: + + class Some_model extends CI_Model { + + public function __construct() + { + parent::__construct(); // calls CI_Model::__construct() + + do_some_other_thing(); + } + } + +All you need to do is remove that ``parent::__construct()`` call. On a side +note, the following seems to be a very common practice: +:: + + class Some_class extends CI_Something { + + public function __construct() + { + parent::__construct(); + } + } + +Please, do NOT do this! It's pointless; it serves no purpose and doesn't do +anything. If a parent class has a ``__construct()`` method, it will be +inherited by all its child classes and will execute just fine - you DON'T +have to explicitly call it unless you want to extend its logic. + +Step 4: Change database connection handling +=========================================== + +"Loading" a database, whether by using the *config/autoload.php* settings +or manually via calling ``$this->load->database()`` or the less-known +``DB()`` function, will now throw a ``RuntimeException`` in case of a +failure. + +In addition, being unable to set the configured character set is now also +considered a connection failure. + +.. note:: This has been the case for most database drivers in the in the + past as well (i.e. all but the 'mysql', 'mysqli' and 'postgre' + drivers). + +What this means is that if you're unable to connect to a database, or +have an erroneous character set configured, CodeIgniter will no longer +fail silently, but will throw an exception instead. + +You may choose to explicitly catch it (and for that purpose you can't use +*config/autoload.php* to load the :doc:`Database Class <../database/index>`) +:: + + try + { + $this->load->database(); + } + catch (RuntimeException $e) + { + // Handle the failure + } + +Or you may leave it to CodeIgniter's default exception handler, which would +log the error message and display an error screen if you're running in +development mode. + +Remove db_set_charset() calls +----------------------------- + +With the above-mentioned changes, the purpose of the ``db_set_charset()`` +method would now only be to change the connection character set at runtime. +That doesn't make sense and that's the reason why most database drivers +don't support it at all. +Thus, ``db_set_charset()`` is no longer necessary and is removed. + +Step 5: Check logic related to URI parsing of CLI requests +========================================================== + +When running a CodeIgniter application from the CLI, the +:doc:`URI Library <../libraries/uri>` will now ignore the +``$config['url_suffix']`` and ``$config['permitted_uri_chars']`` +configuration settings. + +These two options don't make sense under the command line (which is why +this change was made) and therefore you shouldn't be affected by this, but +if you've relied on them for some reason, you'd probably have to make some +changes to your code. + +Step 6: Check Cache Library configurations for Redis, Memcache(d) +================================================================= + +The new improvements for the 'redis' and 'memcached' drivers of the +:doc:`Cache Library <../libraries/caching>` may require some small +adjustments to your configuration values ... + +Redis +----- + +If you're using the 'redis' driver with a UNIX socket connection, you'll +have to move the socket path from ``$config['socket']`` to +``$config['host']`` instead. + +The ``$config['socket_type']`` option is also removed, although that won't +affect your application - it will be ignored and the connection type will +be determined by the format used for ``$config['host']`` instead. + +Memcache(d) +----------- + +The 'memcached' will now ignore configurations that don't specify a ``host`` +value (previously, it just set the host to the default '127.0.0.1'). + +Therefore, if you've added a configuration that only sets e.g. a ``port``, +you will now have to explicitly set the ``host`` to '127.0.0.1' as well. + +Step 7: Check usage of the Email library +======================================== + +The :doc:`Email Library <../libraries/email>` will now by default check the +validity of all e-mail addresses passed to it. This check used to be Off by +default, and required explicitly setting the **validate** option to ``TRUE`` +in order to enable it. + +Naturally, a validity check should not result in any problems, but this is +technically a backwards-compatibility break and you should check that +everything works fine. +If something indeed goes wrong with that, please report it as a bug to us, +and you can disable the **validate** option to revert to the old behavior. + +Step 8: Check usage of doctype() HTML helper +============================================ + +The :doc:`HTML Helper <../helpers/html_helper>` function +:php:func:`doctype()` used to default to 'xhtml1-strict' (XHTML 1.0 Strict) +when no document type was specified. That default value is now changed to +'html5', which obviously stands for the modern HTML 5 standard. + +Nothing should be really broken by this change, but if your application +relies on the default value, you should double-check it and either +explicitly set the desired format, or adapt your front-end to use proper +HTML 5 formatting. + +Step 9: Check usage of form_upload() Form helper +================================================ + +The :doc:`Form Helper <../helpers/form_helper>` function +:php:func:`form_upload()` used to have 3 parameters, the second of which +(``$value``) was never used, as it doesn't make sense for an HTML ``input`` +tag of the "file" type. + +That dead parameter is now removed, and so if you've used the third one +(``$extra``), having code like this:: + + form_upload('name', 'irrelevant value', $extra); + +You should change it to:: + + form_upload('name', $extra); + +Step 10: Remove usage of previously deprecated functionalities +============================================================== + +The following is a list of functionalities deprecated in previous +CodeIgniter versions that have been removed in 3.2.0: + +- ``$config['allow_get_array']`` (use ``$_GET = array();`` instead) +- ``$config['standardize_newlines']`` +- ``$config['rewrite_short_tags']`` (no impact; irrelevant on PHP 5.4+) + +- 'sqlite' database driver (no longer shipped with PHP 5.4+; 'sqlite3' is still available) + +- ``CI_Input::is_cli_request()`` (use :php:func:`is_cli()` instead) +- ``CI_Router::fetch_directory()`` (use ``CI_Router::$directory`` instead) +- ``CI_Router::fetch_class()`` (use ``CI_Router::$class`` instead) +- ``CI_Router::fetch_method()`` (use ``CI_Router::$method`` instead) +- ``CI_Config::system_url()`` (encourages insecure practices) +- ``CI_Form_validation::prep_for_form()`` (the *prep_for_form* rule) + +- ``standard_date()`` :doc:`Date Helper <../helpers/date_helper>` function (use ``date()`` instead) +- ``do_hash()`` :doc:`Security Helper <../helpers/security_helper>` function (use ``hash()`` instead) +- ``br()`` :doc:`HTML Helper <../helpers/html_helper>` function (use ``str_repeat()`` with ``'<br />'`` instead) +- ``nbs()`` :doc:`HTML Helper <../helpers/html_helper>` function (use ``str_repeat()`` with ``' '`` instead) +- ``trim_slashes()`` :doc:`String Helper <../helpers/string_helper>` function (use ``trim()`` with ``'/'`` instead) +- ``repeater()`` :doc:`String Helper <../helpers/string_helper>` function (use ``str_repeat()`` instead) +- ``read_file()`` :doc:`File Helper <../helpers/file_helper>` function (use ``file_get_contents()`` instead) +- ``form_prep()`` :doc:`Form Helper <../helpers/form_helper>` function (use :php:func:`html_escape()` instead) + +- The entire *Cart Library* (an archived version is available on GitHub: `bcit-ci/ci3-cart-library <https://github.com/bcit-ci/ci3-cart-library>`_) +- The entire *Javascript Library* (it was always experimental in the first place) + +- The entire *Email Helper*, which only had two functions: + + - ``valid_email()`` (use ``filter_var($email, FILTER_VALIDATE_EMAIL)`` instead) + - ``send_email()`` (use ``mail()`` instead) + +- The entire *Smiley Helper* (an archived version is available on GitHub: `bcit-ci/ci3-smiley-helper <https://github.com/bcit-ci/ci3-smiley-helper>`_) + +Step 11: Make sure you're validating all user inputs +==================================================== + +The :doc:`Input Library <../libraries/input>` used to (often +unconditionally) filter and/or sanitize user input in the ``$_GET``, +``$_POST`` and ``$_COOKIE`` superglobals. + +This was a legacy feature from older times, when things like +`register_globals <https://secure.php.net/register_globals>`_ and +`magic_quotes_gpc <https://secure.php.net/magic_quotes_gpc>`_ existed in +PHP. +It was a necessity back then, but this is no longer the case and reliance +on global filters is a bad practice, giving you a false sense of security. + +This functionality is now removed, and so if you've relied on it for +whatever reasons, you should double-check that you are properly validating +all user inputs in your application (as you always should do). + +Step 12: Clear your output cache (optional) +=========================================== + +Internal changes to the :doc:`Output Class <../libraries/output>` make it +so that if you're using the :doc:`Web Page Caching <../general/caching>` +feature, you'll be left with some old, garbage cache files. + +That shouldn't be a problem, but you may want to clear them. + +Step 13: Check for calls to is_countable() +========================================== + + +PHP 7.3 introduces a native `is_countable() <https://secure.php.net/is_countable>`_ +function, which creates a name collision with the ``is_countable()`` function +we've had in our :doc:`Inflector Helpers <../helpers/inflector_helper>`. + +If you've been using the helper function in question, you should now rename +the calls to it to :php:func:`word_is_countable()`. diff --git a/user_guide_src/source/installation/upgrading.rst b/user_guide_src/source/installation/upgrading.rst index c35cc05ff..1b9ac3c77 100644 --- a/user_guide_src/source/installation/upgrading.rst +++ b/user_guide_src/source/installation/upgrading.rst @@ -8,6 +8,7 @@ upgrading from. .. toctree:: :titlesonly: + Upgrading from 3.1.3+ to 3.2.x <upgrade_320> Upgrading from 3.1.9 to 3.1.10 <upgrade_3110> Upgrading from 3.1.8 to 3.1.9 <upgrade_319> Upgrading from 3.1.7 to 3.1.8 <upgrade_318> diff --git a/user_guide_src/source/libraries/caching.rst b/user_guide_src/source/libraries/caching.rst index a7081ec6b..be3f894ec 100644 --- a/user_guide_src/source/libraries/caching.rst +++ b/user_guide_src/source/libraries/caching.rst @@ -42,7 +42,8 @@ to avoid collisions when you're running multiple applications on the same enviro :: - $this->load->driver('cache', + $this->load->driver( + 'cache', array('adapter' => 'apc', 'backup' => 'file', 'key_prefix' => 'my_') ); @@ -101,7 +102,7 @@ Class Reference $this->cache->save('cache_item_id', 'data_to_cache'); - .. note:: The ``$raw`` parameter is only utilized by APC and Memcache, + .. note:: The ``$raw`` parameter is only utilized by APC, APCu and Memcache, in order to allow usage of ``increment()`` and ``decrement()``. .. php:method:: delete($id) @@ -187,6 +188,16 @@ Class Reference .. note:: The information returned and the structure of the data is dependent on which adapter is being used. + .. php:method:: get_loaded_driver() + + :returns: Loaded driver name after initialization ('apc', 'apcu', 'dummy', 'file', 'memcached', 'redis' or 'wincache') + :rtype: string + + This method will return the caching driver currently used after initialization. + :: + + echo $this->cache->get_loaded_driver(); // Will return something like "file" + ******* Drivers ******* @@ -201,7 +212,19 @@ specific adapter to the driver loader as follows:: $this->cache->apc->save('foo', 'bar', 10); For more information on APC, please see -`http://php.net/apc <http://php.net/apc>`_. +`https://php.net/apc <https://php.net/apc>`_. + +APC User Cache (APCu) Caching +============================= + +All of the methods listed above can be accessed without passing a +specific adapter to the driver loader as follows:: + + $this->load->driver('cache'); + $this->cache->apcu->save('foo', 'bar', 10); + +For more information on APCu, please see +`https://php.net/apcu <https://php.net/apcu>`_. File-based Caching ================== @@ -230,7 +253,7 @@ specific adapter to the driver loader as follows:: $this->cache->memcached->save('foo', 'bar', 10); For more information on Memcached, please see -`http://php.net/memcached <http://php.net/memcached>`_. +`https://php.net/memcached <https://php.net/memcached>`_. WinCache Caching ================ @@ -244,7 +267,7 @@ specific adapter to the driver loader as follows:: $this->cache->wincache->save('foo', 'bar', 10); For more information on WinCache, please see -`http://php.net/wincache <http://php.net/wincache>`_. +`https://php.net/wincache <https://php.net/wincache>`_. Redis Caching ============= @@ -255,8 +278,6 @@ To use it, you need `Redis server and phpredis PHP extension <https://github.com Config options to connect to redis server must be stored in the application/config/redis.php file. Available options are:: - $config['socket_type'] = 'tcp'; //`tcp` or `unix` - $config['socket'] = '/var/run/redis.sock'; // in case of `unix` socket type $config['host'] = '127.0.0.1'; $config['password'] = NULL; $config['port'] = 6379; @@ -269,11 +290,11 @@ specific adapter to the driver loader as follows:: $this->cache->redis->save('foo', 'bar', 10); For more information on Redis, please see -`http://redis.io <http://redis.io>`_. +`https://redis.io <https://redis.io>`_. Dummy Cache =========== This is a caching backend that will always 'miss.' It stores no data, but lets you keep your caching code in place in environments that don't -support your chosen cache.
\ No newline at end of file +support your chosen cache. diff --git a/user_guide_src/source/libraries/cart.rst b/user_guide_src/source/libraries/cart.rst deleted file mode 100644 index be343320d..000000000 --- a/user_guide_src/source/libraries/cart.rst +++ /dev/null @@ -1,398 +0,0 @@ -################### -Shopping Cart Class -################### - -The Cart Class permits items to be added to a session that stays active -while a user is browsing your site. These items can be retrieved and -displayed in a standard "shopping cart" format, allowing the user to -update the quantity or remove items from the cart. - -.. important:: The Cart library is DEPRECATED and should not be used. - It is currently only kept for backwards compatibility. - -Please note that the Cart Class ONLY provides the core "cart" -functionality. It does not provide shipping, credit card authorization, -or other processing components. - -.. contents:: - :local: - -.. raw:: html - - <div class="custom-index container"></div> - -******************** -Using the Cart Class -******************** - -Initializing the Shopping Cart Class -==================================== - -.. important:: The Cart class utilizes CodeIgniter's :doc:`Session - Class <sessions>` to save the cart information to a database, so - before using the Cart class you must set up a database table as - indicated in the :doc:`Session Documentation <sessions>`, and set the - session preferences in your application/config/config.php file to - utilize a database. - -To initialize the Shopping Cart Class in your controller constructor, -use the ``$this->load->library()`` method:: - - $this->load->library('cart'); - -Once loaded, the Cart object will be available using:: - - $this->cart - -.. note:: The Cart Class will load and initialize the Session Class - automatically, so unless you are using sessions elsewhere in your - application, you do not need to load the Session class. - -Adding an Item to The Cart -========================== - -To add an item to the shopping cart, simply pass an array with the -product information to the ``$this->cart->insert()`` method, as shown -below:: - - $data = array( - 'id' => 'sku_123ABC', - 'qty' => 1, - 'price' => 39.95, - 'name' => 'T-Shirt', - 'options' => array('Size' => 'L', 'Color' => 'Red') - ); - - $this->cart->insert($data); - -.. important:: The first four array indexes above (id, qty, price, and - name) are **required**. If you omit any of them the data will not be - saved to the cart. The fifth index (options) is optional. It is intended - to be used in cases where your product has options associated with it. - Use an array for options, as shown above. - -The five reserved indexes are: - -- **id** - Each product in your store must have a unique identifier. - Typically this will be an "sku" or other such identifier. -- **qty** - The quantity being purchased. -- **price** - The price of the item. -- **name** - The name of the item. -- **options** - Any additional attributes that are needed to identify - the product. These must be passed via an array. - -In addition to the five indexes above, there are two reserved words: -rowid and subtotal. These are used internally by the Cart class, so -please do NOT use those words as index names when inserting data into -the cart. - -Your array may contain additional data. Anything you include in your -array will be stored in the session. However, it is best to standardize -your data among all your products in order to make displaying the -information in a table easier. - -:: - - $data = array( - 'id' => 'sku_123ABC', - 'qty' => 1, - 'price' => 39.95, - 'name' => 'T-Shirt', - 'coupon' => 'XMAS-50OFF' - ); - - $this->cart->insert($data); - -The ``insert()`` method will return the $rowid if you successfully insert a -single item. - -Adding Multiple Items to The Cart -================================= - -By using a multi-dimensional array, as shown below, it is possible to -add multiple products to the cart in one action. This is useful in cases -where you wish to allow people to select from among several items on the -same page. - -:: - - $data = array( - array( - 'id' => 'sku_123ABC', - 'qty' => 1, - 'price' => 39.95, - 'name' => 'T-Shirt', - 'options' => array('Size' => 'L', 'Color' => 'Red') - ), - array( - 'id' => 'sku_567ZYX', - 'qty' => 1, - 'price' => 9.95, - 'name' => 'Coffee Mug' - ), - array( - 'id' => 'sku_965QRS', - 'qty' => 1, - 'price' => 29.95, - 'name' => 'Shot Glass' - ) - ); - - $this->cart->insert($data); - -Displaying the Cart -=================== - -To display the cart you will create a :doc:`view -file </general/views>` with code similar to the one shown below. - -Please note that this example uses the :doc:`form -helper </helpers/form_helper>`. - -:: - - <?php echo form_open('path/to/controller/update/method'); ?> - - <table cellpadding="6" cellspacing="1" style="width:100%" border="0"> - - <tr> - <th>QTY</th> - <th>Item Description</th> - <th style="text-align:right">Item Price</th> - <th style="text-align:right">Sub-Total</th> - </tr> - - <?php $i = 1; ?> - - <?php foreach ($this->cart->contents() as $items): ?> - - <?php echo form_hidden($i.'[rowid]', $items['rowid']); ?> - - <tr> - <td><?php echo form_input(array('name' => $i.'[qty]', 'value' => $items['qty'], 'maxlength' => '3', 'size' => '5')); ?></td> - <td> - <?php echo $items['name']; ?> - - <?php if ($this->cart->has_options($items['rowid']) == TRUE): ?> - - <p> - <?php foreach ($this->cart->product_options($items['rowid']) as $option_name => $option_value): ?> - - <strong><?php echo $option_name; ?>:</strong> <?php echo $option_value; ?><br /> - - <?php endforeach; ?> - </p> - - <?php endif; ?> - - </td> - <td style="text-align:right"><?php echo $this->cart->format_number($items['price']); ?></td> - <td style="text-align:right">$<?php echo $this->cart->format_number($items['subtotal']); ?></td> - </tr> - - <?php $i++; ?> - - <?php endforeach; ?> - - <tr> - <td colspan="2">Â </td> - <td class="right"><strong>Total</strong></td> - <td class="right">$<?php echo $this->cart->format_number($this->cart->total()); ?></td> - </tr> - - </table> - - <p><?php echo form_submit('', 'Update your Cart'); ?></p> - -Updating The Cart -================= - -To update the information in your cart, you must pass an array -containing the Row ID and one or more pre-defined properties to the -``$this->cart->update()`` method. - -.. note:: If the quantity is set to zero, the item will be removed from - the cart. - -:: - - $data = array( - 'rowid' => 'b99ccdf16028f015540f341130b6d8ec', - 'qty' => 3 - ); - - $this->cart->update($data); - - // Or a multi-dimensional array - - $data = array( - array( - 'rowid' => 'b99ccdf16028f015540f341130b6d8ec', - 'qty' => 3 - ), - array( - 'rowid' => 'xw82g9q3r495893iajdh473990rikw23', - 'qty' => 4 - ), - array( - 'rowid' => 'fh4kdkkkaoe30njgoe92rkdkkobec333', - 'qty' => 2 - ) - ); - - $this->cart->update($data); - -You may also update any property you have previously defined when -inserting the item such as options, price or other custom fields. - -:: - - $data = array( - 'rowid' => 'b99ccdf16028f015540f341130b6d8ec', - 'qty' => 1, - 'price' => 49.95, - 'coupon' => NULL - ); - - $this->cart->update($data); - -What is a Row ID? -***************** - -The row ID is a unique identifier that is generated by the cart code -when an item is added to the cart. The reason a unique ID is created -is so that identical products with different options can be managed -by the cart. - -For example, let's say someone buys two identical t-shirts (same product -ID), but in different sizes. The product ID (and other attributes) will -be identical for both sizes because it's the same shirt. The only -difference will be the size. The cart must therefore have a means of -identifying this difference so that the two sizes of shirts can be -managed independently. It does so by creating a unique "row ID" based on -the product ID and any options associated with it. - -In nearly all cases, updating the cart will be something the user does -via the "view cart" page, so as a developer, it is unlikely that you -will ever have to concern yourself with the "row ID", other than making -sure your "view cart" page contains this information in a hidden form -field, and making sure it gets passed to the ``update()`` method when -the update form is submitted. Please examine the construction of the -"view cart" page above for more information. - - -*************** -Class Reference -*************** - -.. php:class:: CI_Cart - - .. attribute:: $product_id_rules = '\.a-z0-9_-' - - These are the regular expression rules that we use to validate the product - ID - alpha-numeric, dashes, underscores, or periods by default - - .. attribute:: $product_name_rules = '\w \-\.\:' - - These are the regular expression rules that we use to validate the product ID and product name - alpha-numeric, dashes, underscores, colons or periods by - default - - .. attribute:: $product_name_safe = TRUE - - Whether or not to only allow safe product names. Default TRUE. - - - .. php:method:: insert([$items = array()]) - - :param array $items: Items to insert into the cart - :returns: TRUE on success, FALSE on failure - :rtype: bool - - Insert items into the cart and save it to the session table. Returns TRUE - on success and FALSE on failure. - - - .. php:method:: update([$items = array()]) - - :param array $items: Items to update in the cart - :returns: TRUE on success, FALSE on failure - :rtype: bool - - This method permits changing the properties of a given item. - Typically it is called from the "view cart" page if a user makes changes - to the quantity before checkout. That array must contain the rowid - for each item. - - .. php:method:: remove($rowid) - - :param int $rowid: ID of the item to remove from the cart - :returns: TRUE on success, FALSE on failure - :rtype: bool - - Allows you to remove an item from the shopping cart by passing it the - ``$rowid``. - - .. php:method:: total() - - :returns: Total amount - :rtype: int - - Displays the total amount in the cart. - - - .. php:method:: total_items() - - :returns: Total amount of items in the cart - :rtype: int - - Displays the total number of items in the cart. - - - .. php:method:: contents([$newest_first = FALSE]) - - :param bool $newest_first: Whether to order the array with newest items first - :returns: An array of cart contents - :rtype: array - - Returns an array containing everything in the cart. You can sort the - order by which the array is returned by passing it TRUE where the contents - will be sorted from newest to oldest, otherwise it is sorted from oldest - to newest. - - .. php:method:: get_item($row_id) - - :param int $row_id: Row ID to retrieve - :returns: Array of item data - :rtype: array - - Returns an array containing data for the item matching the specified row - ID, or FALSE if no such item exists. - - .. php:method:: has_options($row_id = '') - - :param int $row_id: Row ID to inspect - :returns: TRUE if options exist, FALSE otherwise - :rtype: bool - - Returns TRUE (boolean) if a particular row in the cart contains options. - This method is designed to be used in a loop with ``contents()``, since - you must pass the rowid to this method, as shown in the Displaying - the Cart example above. - - .. php:method:: product_options([$row_id = '']) - - :param int $row_id: Row ID - :returns: Array of product options - :rtype: array - - Returns an array of options for a particular product. This method is - designed to be used in a loop with ``contents()``, since you - must pass the rowid to this method, as shown in the Displaying the - Cart example above. - - .. php:method:: destroy() - - :rtype: void - - Permits you to destroy the cart. This method will likely be called - when you are finished processing the customer's order.
\ No newline at end of file diff --git a/user_guide_src/source/libraries/config.rst b/user_guide_src/source/libraries/config.rst index fe2e0a99d..2431abf93 100644 --- a/user_guide_src/source/libraries/config.rst +++ b/user_guide_src/source/libraries/config.rst @@ -239,14 +239,3 @@ Class Reference This method is normally accessed via the corresponding functions in the :doc:`URL Helper </helpers/url_helper>`. - - .. php:method:: system_url() - - :returns: URL pointing at your CI system/ directory - :rtype: string - - This method retrieves the URL to your CodeIgniter system/ directory. - - .. note:: This method is DEPRECATED because it encourages usage of - insecure coding practices. Your *system/* directory shouldn't - be publicly accessible.
\ No newline at end of file diff --git a/user_guide_src/source/libraries/email.rst b/user_guide_src/source/libraries/email.rst index 1be6e2adb..81ca00e50 100644 --- a/user_guide_src/source/libraries/email.rst +++ b/user_guide_src/source/libraries/email.rst @@ -108,7 +108,7 @@ Preference Default Value Options Descript page. Make sure you don't have any relative links or relative image paths otherwise they will not work. **charset** ``$config['charset']`` Character set (utf-8, iso-8859-1, etc.). -**validate** FALSE TRUE or FALSE (boolean) Whether to validate the email address. +**validate** TRUE TRUE or FALSE (boolean) Whether to validate the email address. **priority** 3 1, 2, 3, 4, 5 Email Priority. 1 = highest. 5 = lowest. 3 = normal. **crlf** \\n "\\r\\n" or "\\n" or "\\r" Newline character. (Use "\\r\\n" to comply with RFC 822). **newline** \\n "\\r\\n" or "\\n" or "\\r" Newline character. (Use "\\r\\n" to comply with RFC 822). @@ -312,14 +312,18 @@ Class Reference This method will automatically clear all parameters if the request was successful. To stop this behaviour pass FALSE:: - if ($this->email->send(FALSE)) - { - // Parameters won't be cleared - } + if ($this->email->send(FALSE)) + { + // Parameters won't be cleared + } .. note:: In order to use the ``print_debugger()`` method, you need to avoid clearing the email parameters. + .. note:: If ``batch_bcc_mode`` is enabled, and there are more than + ``batch_bcc_size`` recipients, this method will always return + boolean ``TRUE``. + .. php:method:: attach($filename[, $disposition = ''[, $newname = NULL[, $mime = '']]]) :param string $filename: File name @@ -402,4 +406,4 @@ Class Reference // Will only print the email headers, excluding the message subject and body $this->email->print_debugger(array('headers')); - .. note:: By default, all of the raw data will be printed.
\ No newline at end of file + .. note:: By default, all of the raw data will be printed. diff --git a/user_guide_src/source/libraries/encrypt.rst b/user_guide_src/source/libraries/encrypt.rst index 67e2a0190..10893b901 100644 --- a/user_guide_src/source/libraries/encrypt.rst +++ b/user_guide_src/source/libraries/encrypt.rst @@ -135,7 +135,7 @@ Class Reference $this->encrypt->set_cipher(MCRYPT_BLOWFISH); - Please visit php.net for a list of `available ciphers <http://php.net/mcrypt>`_. + Please visit php.net for a list of `available ciphers <https://secure.php.net/mcrypt>`_. If you'd like to manually test whether your server supports MCrypt you can use:: @@ -153,7 +153,7 @@ Class Reference $this->encrypt->set_mode(MCRYPT_MODE_CFB); - Please visit php.net for a list of `available modes <http://php.net/mcrypt>`_. + Please visit php.net for a list of `available modes <https://secure.php.net/mcrypt>`_. .. php:method:: encode_from_legacy($string[, $legacy_mode = MCRYPT_MODE_ECB[, $key = '']]) diff --git a/user_guide_src/source/libraries/encryption.rst b/user_guide_src/source/libraries/encryption.rst index b16511d4d..8b4fd7121 100644 --- a/user_guide_src/source/libraries/encryption.rst +++ b/user_guide_src/source/libraries/encryption.rst @@ -5,7 +5,7 @@ Encryption Library .. important:: DO NOT use this or any other *encryption* library for user password storage! Passwords must be *hashed* instead, and you should do that via PHP's own `Password Hashing extension - <http://php.net/password>`_. + <https://secure.php.net/password>`_. The Encryption Library provides two-way data encryption. To do so in a cryptographically secure way, it utilizes PHP extensions that are @@ -13,8 +13,8 @@ unfortunately not always available on all systems. You must meet one of the following dependencies in order to use this library: -- `OpenSSL <http://php.net/openssl>`_ -- `MCrypt <http://php.net/mcrypt>`_ (and `MCRYPT_DEV_URANDOM` availability) +- `OpenSSL <https://secure.php.net/openssl>`_ +- `MCrypt <https://secure.php.net/mcrypt>`_ (and `MCRYPT_DEV_URANDOM` availability) If neither of the above dependencies is met, we simply cannot offer you a good enough implementation to meet the high standards required @@ -63,7 +63,7 @@ encryption and authentication is a bad practice. Because of that, two separate keys are derived from your already configured *encryption_key*: one for encryption and one for authentication. This is done via a technique called `HMAC-based Key Derivation Function -<http://en.wikipedia.org/wiki/HKDF>`_ (HKDF). +<https://en.wikipedia.org/wiki/HKDF>`_ (HKDF). Setting your encryption_key =========================== @@ -171,7 +171,7 @@ RC4 / ARCFour rc4 40-2048 / 5-256 Stream .. note:: Even though CAST5 supports key lengths lower than 128 bits (16 bytes), in fact they will just be zero-padded to the maximum length, as specified in `RFC 2144 - <http://tools.ietf.org/rfc/rfc2144.txt>`_. + <https://tools.ietf.org/rfc/rfc2144.txt>`_. .. note:: Blowfish supports key lengths as small as 32 bits (4 bytes), but our tests have shown that only lengths of 128 bits (16 bytes) or @@ -482,7 +482,7 @@ The reason for not including other popular algorithms, such as MD5 or SHA1 is that they are no longer considered secure enough and as such, we don't want to encourage their usage. If you absolutely need to use them, it is easy to do so via PHP's -native `hash_hmac() <http://php.net/manual/en/function.hash-hmac.php>`_ function. +native `hash_hmac() <https://secure.php.net/manual/en/function.hash-hmac.php>`_ function. Stronger algorithms of course will be added in the future as they appear and become widely available. diff --git a/user_guide_src/source/libraries/file_uploading.rst b/user_guide_src/source/libraries/file_uploading.rst index babdc04f9..1b7581670 100644 --- a/user_guide_src/source/libraries/file_uploading.rst +++ b/user_guide_src/source/libraries/file_uploading.rst @@ -233,7 +233,7 @@ Preference Default Value Options Descripti unless you have no other option as that would cause a security risk. **mod_mime_fix** TRUE TRUE/FALSE (boolean) If set to TRUE, multiple filename extensions will be suffixed with an underscore in order to avoid triggering `Apache mod_mime - <http://httpd.apache.org/docs/2.0/mod/mod_mime.html#multipleext>`_. + <https://httpd.apache.org/docs/2.0/mod/mod_mime.html#multipleext>`_. DO NOT turn off this option if your upload directory is public, as this is a security risk. ============================ ================= ======================= ====================================================================== diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index 88cda1686..fd2f3af94 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -881,6 +881,24 @@ When a rule group is named identically to a controller class/method it will be used automatically when the ``run()`` method is invoked from that class/method. +Accessing validated/processed data +================================== + +By default, validation will be performed directly on the ``$_POST`` array, +and any possible modifications (like trimming whitespace, for example) +would be written back onto it. +However, if you want to keep the original input data intact, or have used +``set_data()`` to pass a custom set of inputs, you would likely want to +fetch the now-modified data. In order to do that, you can pass a variable +as the second parameter to ``run()``:: + + $input = array('name' => ' White Space '); + $output = NULL; + + $this->form_validation->set_rules('name', 'Name', 'required|trim'); + $this->form_validation->run(NULL, $output); + // $output will now contain: array('name' => 'White Space'); + .. _using-arrays-as-field-names: *************************** @@ -987,6 +1005,7 @@ Rule Parameter Description **valid_emails** No Returns FALSE if any value provided in a comma separated list is not a valid email. **valid_ip** Yes Returns FALSE if the supplied IP address is not valid. Accepts an optional parameter of 'ipv4' or 'ipv6' to specify an IP format. +**valid_mac** No Returns FALSE if the supplied MAC address is not valid. **valid_base64** No Returns FALSE if the supplied string contains anything other than valid Base64 characters. ========================= ========== ============================================================================================= ======================= @@ -1009,7 +1028,6 @@ to use: ==================== ========= ============================================================================================================== Name Parameter Description ==================== ========= ============================================================================================================== -**prep_for_form** No DEPRECATED: Converts special characters so that HTML data can be shown in a form field without breaking it. **prep_url** No Adds "\http://" to URLs if missing. **strip_image_tags** No Strips the HTML from image tags leaving the raw URL. **encode_php_tags** No Converts PHP tags to entities. @@ -1027,13 +1045,14 @@ Class Reference .. php:class:: CI_Form_validation - .. php:method:: set_rules($field[, $label = ''[, $rules = ''[, $errors = array()]]]) + .. php:method:: set_rules($field[, $label = null[, $rules = null[, $errors = array()]]]) :param string $field: Field name :param string $label: Field label :param mixed $rules: Validation rules, as a string list separated by a pipe "|", or as an array or rules :param array $errors: A list of custom error messages :returns: CI_Form_validation instance (method chaining) + :throws: BadMethodCallException If $field is not an array and $rules was not used :rtype: CI_Form_validation Permits you to set validation rules, as described in the tutorial @@ -1042,9 +1061,10 @@ Class Reference - :ref:`setting-validation-rules` - :ref:`saving-groups` - .. php:method:: run([$group = '']) + .. php:method:: run([$config = NULL[, $data = NULL]]) :param string $group: The name of the validation group to run + :param mixed $data: Optional variable to assign validated data to :returns: TRUE on success, FALSE if validation failed :rtype: bool diff --git a/user_guide_src/source/libraries/image_lib.rst b/user_guide_src/source/libraries/image_lib.rst index 22407962f..442541bf6 100644 --- a/user_guide_src/source/libraries/image_lib.rst +++ b/user_guide_src/source/libraries/image_lib.rst @@ -283,7 +283,7 @@ Preference Default Value Options Description **wm_shadow_color** None None The color of the drop shadow, specified in hex. If you leave this blank a drop shadow will not be used. Both the full 6-length (ie, 993300) and the short three character abbreviated version (ie, fff) are supported. -**wm_shadow_distance** 3 None The distance (in pixels) from the font that the drop shadow should +**wm_shadow_distance** 2 None The distance (in pixels) from the font that the drop shadow should appear. ======================= =================== =================== ========================================================================== @@ -408,7 +408,7 @@ Class Reference method is not very useful unless you intend to build such an interface. That's exactly what we did using for the photo gallery module in ExpressionEngine, the CMS we develop. We added a JavaScript UI that - lets the cropping area be selected. + lets the cropping area be selected. (from EllisLab) .. php:method:: rotate() diff --git a/user_guide_src/source/libraries/input.rst b/user_guide_src/source/libraries/input.rst index 300f47112..730b3a9b0 100644 --- a/user_guide_src/source/libraries/input.rst +++ b/user_guide_src/source/libraries/input.rst @@ -2,10 +2,8 @@ Input Class ########### -The Input Class serves two purposes: - -#. It pre-processes global input data for security. -#. It provides some helper methods for fetching input data and pre-processing it. +The Input Class provides some helper methods for accessing input data +and pre-processing it. .. note:: This class is initialized automatically by the system so there is no need to do it manually. @@ -17,49 +15,9 @@ The Input Class serves two purposes: <div class="custom-index container"></div> -*************** -Input Filtering -*************** - -Security Filtering -================== - -The security filtering method is called automatically when a new -:doc:`controller <../general/controllers>` is invoked. It does the -following: - -- If ``$config['allow_get_array']`` is FALSE (default is TRUE), destroys - the global GET array. -- Destroys all global variables in the event register_globals is - turned on. -- Filters the GET/POST/COOKIE array keys, permitting only alpha-numeric - (and a few other) characters. -- Provides XSS (Cross-site Scripting Hacks) filtering. This can be - enabled globally, or upon request. -- Standardizes newline characters to ``PHP_EOL`` (\\n in UNIX-based OSes, - \\r\\n under Windows). This is configurable. - -XSS Filtering -============= - -The Input class has the ability to filter input automatically to prevent -cross-site scripting attacks. If you want the filter to run -automatically every time it encounters POST or COOKIE data you can -enable it by opening your *application/config/config.php* file and setting -this:: - - $config['global_xss_filtering'] = TRUE; - -Please refer to the :doc:`Security class <security>` documentation for -information on using XSS Filtering in your application. - -.. important:: The 'global_xss_filtering' setting is DEPRECATED and kept - solely for backwards-compatibility purposes. XSS escaping should - be performed on *output*, not *input*! - -******************* -Accessing form data -******************* +******************** +Accessing input data +******************** Using POST, GET, COOKIE, or SERVER Data ======================================= @@ -130,7 +88,7 @@ Class Reference The property can be read multiple times. - .. php:method:: post([$index = NULL[, $xss_clean = NULL]]) + .. php:method:: post([$index = NULL[, $xss_clean = FALSE]]) :param mixed $index: POST parameter name :param bool $xss_clean: Whether to apply XSS filtering @@ -147,7 +105,6 @@ Class Reference The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE - or by setting your ``$config['global_xss_filtering']`` to TRUE. :: $this->input->post('some_data', TRUE); @@ -173,7 +130,7 @@ Class Reference $this->input->post(array('field1', 'field2'), TRUE); - .. php:method:: get([$index = NULL[, $xss_clean = NULL]]) + .. php:method:: get([$index = NULL[, $xss_clean = FALSE]]) :param mixed $index: GET parameter name :param bool $xss_clean: Whether to apply XSS filtering @@ -206,7 +163,7 @@ Class Reference $this->input->get(array('field1', 'field2'), TRUE); - .. php:method:: post_get($index[, $xss_clean = NULL]) + .. php:method:: post_get($index[, $xss_clean = FALSE]) :param string $index: POST/GET parameter name :param bool $xss_clean: Whether to apply XSS filtering @@ -219,7 +176,7 @@ Class Reference $this->input->post_get('some_data', TRUE); - .. php:method:: get_post($index[, $xss_clean = NULL]) + .. php:method:: get_post($index[, $xss_clean = FALSE]) :param string $index: GET/POST parameter name :param bool $xss_clean: Whether to apply XSS filtering @@ -234,7 +191,7 @@ Class Reference .. note:: This method used to act EXACTLY like ``post_get()``, but it's behavior has changed in CodeIgniter 3.0. - .. php:method:: cookie([$index = NULL[, $xss_clean = NULL]]) + .. php:method:: cookie([$index = NULL[, $xss_clean = FALSE]]) :param mixed $index: COOKIE name :param bool $xss_clean: Whether to apply XSS filtering @@ -257,7 +214,7 @@ Class Reference function :php:func:`get_cookie()`, this method does NOT prepend your configured ``$config['cookie_prefix']`` value. - .. php:method:: server($index[, $xss_clean = NULL]) + .. php:method:: server($index[, $xss_clean = FALSE]) :param mixed $index: Value name :param bool $xss_clean: Whether to apply XSS filtering @@ -275,7 +232,7 @@ Class Reference $this->input->server(array('SERVER_PROTOCOL', 'REQUEST_URI')); - .. php:method:: input_stream([$index = NULL[, $xss_clean = NULL]]) + .. php:method:: input_stream([$index = NULL[, $xss_clean = FALSE]]) :param mixed $index: Key name :param bool $xss_clean: Whether to apply XSS filtering @@ -285,7 +242,7 @@ Class Reference This method is identical to ``get()``, ``post()`` and ``cookie()``, only it fetches the *php://input* stream data. - .. php:method:: set_cookie($name = ''[, $value = ''[, $expire = ''[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = NULL[, $httponly = NULL]]]]]]]) + .. php:method:: set_cookie($name = ''[, $value = ''[, $expire = 0[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = NULL[, $httponly = NULL]]]]]]]) :param mixed $name: Cookie name or an array of parameters :param string $value: Cookie value @@ -310,7 +267,7 @@ Class Reference $cookie = array( 'name' => 'The Cookie Name', 'value' => 'The Value', - 'expire' => '86500', + 'expire' => 86500, 'domain' => '.some-domain.com', 'path' => '/', 'prefix' => 'myprefix_', @@ -321,8 +278,8 @@ Class Reference **Notes** - Only the name and value are required. To delete a cookie set it with the - expiration blank. + Only the name and value are required. To delete a cookie set the expiry + time to a negative, or non-numeric value. The expiration is set in **seconds**, which will be added to the current time. Do not include the time, but rather only the number of seconds @@ -390,7 +347,7 @@ Class Reference Accepts an optional second string parameter of 'ipv4' or 'ipv6' to specify an IP format. The default checks for both formats. - .. php:method:: user_agent([$xss_clean = NULL]) + .. php:method:: user_agent([$xss_clean = FALSE]) :returns: User agent string or NULL if not set :param bool $xss_clean: Whether to apply XSS filtering @@ -413,7 +370,7 @@ Class Reference Returns an array of HTTP request headers. Useful if running in a non-Apache environment where - `apache_request_headers() <http://php.net/apache_request_headers>`_ + `apache_request_headers() <https://secure.php.net/apache_request_headers>`_ will not be supported. :: @@ -440,25 +397,6 @@ Class Reference Checks to see if the HTTP_X_REQUESTED_WITH server header has been set, and returns boolean TRUE if it is or FALSE if not. - .. php:method:: is_cli_request() - - :returns: TRUE if it is a CLI request, FALSE if not - :rtype: bool - - Checks to see if the application was run from the command-line - interface. - - .. note:: This method checks both the PHP SAPI name currently in use - and if the ``STDIN`` constant is defined, which is usually a - failsafe way to see if PHP is being run via the command line. - - :: - - $this->input->is_cli_request() - - .. note:: This method is DEPRECATED and is now just an alias for the - :func:`is_cli()` function. - .. php:method:: method([$upper = FALSE]) :param bool $upper: Whether to return the request method name in upper or lower case diff --git a/user_guide_src/source/libraries/javascript.rst b/user_guide_src/source/libraries/javascript.rst deleted file mode 100644 index e91b9ad78..000000000 --- a/user_guide_src/source/libraries/javascript.rst +++ /dev/null @@ -1,322 +0,0 @@ -################ -Javascript Class -################ - -CodeIgniter provides a library to help you with certain common functions -that you may want to use with Javascript. Please note that CodeIgniter -does not require the jQuery library to run, and that any scripting -library will work equally well. The jQuery library is simply presented -as a convenience if you choose to use it. - -.. important:: This library is DEPRECATED and should not be used. It has always - been with an 'experimental' status and is now no longer supported. - Currently only kept for backwards compatibility. - -.. contents:: - :local: - -.. raw:: html - - <div class="custom-index container"></div> - -************************** -Using the Javascript Class -************************** - -Initializing the Class -====================== - -To initialize the Javascript class manually in your controller -constructor, use the ``$this->load->library()`` method. Currently, -the only available library is jQuery, which will automatically be -loaded like this:: - - $this->load->library('javascript'); - -The Javascript class also accepts parameters: - -- js_library_driver (string) *default: 'jquery'* -- autoload (bool) *default: TRUE* - -You may override the defaults by sending an associative array:: - - $this->load->library( - 'javascript', - array( - 'js_library_driver' => 'scripto', - 'autoload' => FALSE - ) - ); - -Again, presently only 'jquery' is available. You may wish to set -autoload to FALSE, though, if you do not want the jQuery library to -automatically include a script tag for the main jQuery script file. This -is useful if you are loading it from a location outside of CodeIgniter, -or already have the script tag in your markup. - -Once loaded, the jQuery library object will be available using: - - $this->javascript - -Setup and Configuration -======================= - -Set these variables in your view --------------------------------- - -As a Javascript library, your files must be available to your -application. - -As Javascript is a client side language, the library must be able to -write content into your final output. This generally means a view. -You'll need to include the following variables in the ``<head>`` -sections of your output. - -:: - - <?php echo $library_src;?> - <?php echo $script_head;?> - - -``$library_src``, is where the actual library file will be loaded, as -well as any subsequent plugin script calls; $script_head is where -specific events, functions and other commands will be rendered. - -Set the path to the librarys with config items ----------------------------------------------- - -There are some configuration items in Javascript library. These can -either be set in *application/config.php*, within its own -*config/javascript.php* file, or within any controller usings the -``set_item()`` function. - -An image to be used as an "ajax loader", or progress indicator. Without -one, the simple text message of "loading" will appear when Ajax calls -need to be made. - -:: - - $config['javascript_location'] = 'http://localhost/codeigniter/themes/js/jquery/'; - $config['javascript_ajax_img'] = 'images/ajax-loader.gif'; - -If you keep your files in the same directories they were downloaded -from, then you need not set this configuration items. - -The jQuery Class -================ - -To initialize the jQuery class manually in your controller constructor, -use the ``$this->load->library()`` method:: - - $this->load->library('javascript/jquery'); - -You may send an optional parameter to determine whether or not a script -tag for the main jQuery file will be automatically included when loading -the library. It will be created by default. To prevent this, load the -library as follows:: - - $this->load->library('javascript/jquery', FALSE); - -Once loaded, the jQuery library object will be available using: - - $this->jquery - -jQuery Events -============= - -Events are set using the following syntax. -:: - - $this->jquery->event('element_path', code_to_run()); - -In the above example: - -- "event" is any of blur, change, click, dblclick, error, focus, hover, - keydown, keyup, load, mousedown, mouseup, mouseover, mouseup, resize, - scroll, or unload. -- "element_path" is any valid `jQuery selector - <http://api.jquery.com/category/selectors/>`_. Due to jQuery's unique - selector syntax, this is usually an element id, or CSS selector. For - example "#notice_area" would effect ``<div id="notice_area">``, and - "#content a.notice" would effect all anchors with a class of "notice" - in the div with id "content". -- "``code_to_run()``" is script your write yourself, or an action such as - an effect from the jQuery library below. - -Effects -======= - -The query library supports a powerful -`Effects <http://api.jquery.com/category/effects/>`_ repertoire. Before an effect -can be used, it must be loaded:: - - $this->jquery->effect([optional path] plugin name); // for example $this->jquery->effect('bounce'); - - -hide() / show() ---------------- - -Each of this functions will affect the visibility of an item on your -page. hide() will set an item invisible, show() will reveal it. - -:: - - $this->jquery->hide(target, optional speed, optional extra information); - $this->jquery->show(target, optional speed, optional extra information); - - -- "target" will be any valid jQuery selector or selectors. -- "speed" is optional, and is set to either slow, normal, fast, or - alternatively a number of milliseconds. -- "extra information" is optional, and could include a callback, or - other additional information. - -toggle() --------- - -toggle() will change the visibility of an item to the opposite of its -current state, hiding visible elements, and revealing hidden ones. - -:: - - $this->jquery->toggle(target); - - -- "target" will be any valid jQuery selector or selectors. - -animate() ---------- - -:: - - $this->jquery->animate(target, parameters, optional speed, optional extra information); - - -- "target" will be any valid jQuery selector or selectors. -- "parameters" in jQuery would generally include a series of CSS - properties that you wish to change. -- "speed" is optional, and is set to either slow, normal, fast, or - alternatively a number of milliseconds. -- "extra information" is optional, and could include a callback, or - other additional information. - -For a full summary, see -`http://api.jquery.com/animate/ <http://api.jquery.com/animate/>`_ - -Here is an example of an animate() called on a div with an id of "note", -and triggered by a click using the jQuery library's click() event. - -:: - - $params = array( - 'height' => 80, - 'width' => '50%', - 'marginLeft' => 125 - ); - $this->jquery->click('#trigger', $this->jquery->animate('#note', $params, 'normal')); - -fadeIn() / fadeOut() --------------------- - -:: - - $this->jquery->fadeIn(target, optional speed, optional extra information); - $this->jquery->fadeOut(target, optional speed, optional extra information); - - -- "target" will be any valid jQuery selector or selectors. -- "speed" is optional, and is set to either slow, normal, fast, or - alternatively a number of milliseconds. -- "extra information" is optional, and could include a callback, or - other additional information. - -toggleClass() -------------- - -This function will add or remove a CSS class to its target. - -:: - - $this->jquery->toggleClass(target, class) - - -- "target" will be any valid jQuery selector or selectors. -- "class" is any CSS classname. Note that this class must be defined - and available in a CSS that is already loaded. - -fadeIn() / fadeOut() --------------------- - -These effects cause an element(s) to disappear or reappear over time. - -:: - - $this->jquery->fadeIn(target, optional speed, optional extra information); - $this->jquery->fadeOut(target, optional speed, optional extra information); - - -- "target" will be any valid jQuery selector or selectors. -- "speed" is optional, and is set to either slow, normal, fast, or - alternatively a number of milliseconds. -- "extra information" is optional, and could include a callback, or - other additional information. - -slideUp() / slideDown() / slideToggle() ---------------------------------------- - -These effects cause an element(s) to slide. - -:: - - $this->jquery->slideUp(target, optional speed, optional extra information); - $this->jquery->slideDown(target, optional speed, optional extra information); - $this->jquery->slideToggle(target, optional speed, optional extra information); - - -- "target" will be any valid jQuery selector or selectors. -- "speed" is optional, and is set to either slow, normal, fast, or - alternatively a number of milliseconds. -- "extra information" is optional, and could include a callback, or - other additional information. - -Plugins -======= - -Some select jQuery plugins are made available using this library. - -corner() --------- - -Used to add distinct corners to page elements. For full details see -`http://malsup.com/jquery/corner/ <http://malsup.com/jquery/corner/>`_ - -:: - - $this->jquery->corner(target, corner_style); - - -- "target" will be any valid jQuery selector or selectors. -- "corner_style" is optional, and can be set to any valid style such - as round, sharp, bevel, bite, dog, etc. Individual corners can be set - by following the style with a space and using "tl" (top left), "tr" - (top right), "bl" (bottom left), or "br" (bottom right). - -:: - - $this->jquery->corner("#note", "cool tl br"); - - -tablesorter() -------------- - -description to come - -modal() -------- - -description to come - -calendar() ----------- - -description to come
\ No newline at end of file diff --git a/user_guide_src/source/libraries/language.rst b/user_guide_src/source/libraries/language.rst index de17c8288..262d9733a 100644 --- a/user_guide_src/source/libraries/language.rst +++ b/user_guide_src/source/libraries/language.rst @@ -92,7 +92,7 @@ Internationalization The Language class in CodeIgniter is meant to provide an easy and lightweight way to support multiplelanguages in your application. It is not meant to be a full implementation of what is commonly called `internationalization and localization -<http://en.wikipedia.org/wiki/Internationalization_and_localization>`_. +<https://en.wikipedia.org/wiki/Internationalization_and_localization>`_. We use the term "idiom" to refer to a language using its common name, rather than using any of the international standards, such as "en", "en-US", diff --git a/user_guide_src/source/libraries/loader.rst b/user_guide_src/source/libraries/loader.rst index 22abb4586..4d3d51236 100644 --- a/user_guide_src/source/libraries/loader.rst +++ b/user_guide_src/source/libraries/loader.rst @@ -238,7 +238,7 @@ Class Reference The second **optional** parameter can take an associative array or an object as input, which it runs through the PHP - `extract() <http://php.net/extract>`_ function to convert to variables + `extract() <https://secure.php.net/extract>`_ function to convert to variables that can be used in your view files. Again, read the :doc:`Views <../general/views>` page to learn how this might be useful. @@ -259,7 +259,7 @@ Class Reference :rtype: CI_Loader This method takes an associative array as input and generates - variables using the PHP `extract() <http://php.net/extract>`_ + variables using the PHP `extract() <https://secure.php.net/extract>`_ function. This method produces the same result as using the second parameter of the ``$this->load->view()`` method above. The reason you might want to use this method independently is if you would like to diff --git a/user_guide_src/source/libraries/output.rst b/user_guide_src/source/libraries/output.rst index 92060f66a..a24f3cb52 100644 --- a/user_guide_src/source/libraries/output.rst +++ b/user_guide_src/source/libraries/output.rst @@ -163,7 +163,7 @@ Class Reference $this->output->set_status_header(401); // Sets the header as: Unauthorized - `See here <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>`_ for a full list of headers. + `See here <https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>`_ for a full list of headers. .. note:: This method is an alias for :doc:`Common function <../general/common_functions>` :func:`set_status_header()`. @@ -207,7 +207,7 @@ Class Reference For more information, please see the :doc:`caching documentation <../general/caching>`. - .. php:method:: _display([$output = '']) + .. php:method:: _display([$output = NULL]) :param string $output: Output data override :returns: void diff --git a/user_guide_src/source/libraries/sessions.rst b/user_guide_src/source/libraries/sessions.rst index 994dc2e08..f2236c633 100644 --- a/user_guide_src/source/libraries/sessions.rst +++ b/user_guide_src/source/libraries/sessions.rst @@ -112,7 +112,7 @@ Session data is simply an array associated with a particular session ID (cookie). If you've used sessions in PHP before, you should be familiar with PHP's -`$_SESSION superglobal <http://php.net/manual/en/reserved.variables.session.php>`_ +`$_SESSION superglobal <https://secure.php.net/manual/en/reserved.variables.session.php>`_ (if not, please read the content on that link). CodeIgniter gives access to its session data through the same means, as it @@ -391,7 +391,7 @@ Destroying a Session ==================== To clear the current session (for example, during a logout), you may -simply use either PHP's `session_destroy() <http://php.net/session_destroy>`_ +simply use either PHP's `session_destroy() <https://secure.php.net/session_destroy>`_ function, or the ``sess_destroy()`` method. Both will work in exactly the same way:: @@ -516,7 +516,7 @@ mind that it is in fact not the same code and it has some limitations To be more specific, it doesn't support PHP's `directory level and mode formats used in session.save_path -<http://php.net/manual/en/session.configuration.php#ini.session.save-path>`_, +<https://secure.php.net/manual/en/session.configuration.php#ini.session.save-path>`_, and it has most of the options hard-coded for safety. Instead, only absolute paths are supported for ``$config['sess_save_path']``. @@ -554,7 +554,7 @@ increase - which is the time when it matters - the file system will consistently outperform almost all relational database setups. In addition, if performance is your only concern, you may want to look -into using `tmpfs <http://eddmann.com/posts/storing-php-sessions-file-caches-in-memory-using-tmpfs/>`_, +into using `tmpfs <https://eddmann.com/posts/storing-php-sessions-file-caches-in-memory-using-tmpfs/>`_, (warning: external resource), which can make your sessions blazing fast. Database Driver @@ -679,7 +679,7 @@ Memcached Driver The 'memcached' driver is very similar to the 'redis' one in all of its properties, except perhaps for availability, because PHP's `Memcached -<http://php.net/memcached>`_ extension is distributed via PECL and some +<https://secure.php.net/memcached>`_ extension is distributed via PECL and some Linux distrubutions make it available as an easy to install package. Other than that, and without any intentional bias towards Redis, there's @@ -754,7 +754,7 @@ when creating a session driver for CodeIgniter: - Implement the `SessionHandlerInterface - <http://php.net/sessionhandlerinterface>`_ interface. + <https://secure.php.net/sessionhandlerinterface>`_ interface. .. note:: You may notice that ``SessionHandlerInterface`` is provided by PHP since version 5.4.0. CodeIgniter will automatically declare @@ -1016,7 +1016,7 @@ Class Reference .. note:: This method is just an alias for PHP's native `session_regenerate_id() - <http://php.net/session_regenerate_id>`_ function. + <https://secure.php.net/session_regenerate_id>`_ function. .. php:method:: sess_destroy() @@ -1030,7 +1030,7 @@ Class Reference .. note:: This method is just an alias for PHP's native `session_destroy() - <http://php.net/session_destroy>`_ function. + <https://secure.php.net/session_destroy>`_ function. .. php:method:: __get($key) diff --git a/user_guide_src/source/libraries/table.rst b/user_guide_src/source/libraries/table.rst index 91ae1ae8d..06dfe59de 100644 --- a/user_guide_src/source/libraries/table.rst +++ b/user_guide_src/source/libraries/table.rst @@ -275,11 +275,16 @@ Class Reference :returns: CI_Table instance (method chaining) :rtype: CI_Table - Lets you clear the table heading and row data. If you need to show multiple tables with different data you should to call this method - after each table has been generated to clear the previous table information. Example:: + Lets you clear the table heading, row data and caption. If + you need to show multiple tables with different data you + should to call this method after each table has been + generated to clear the previous table information. + + Example :: $this->load->library('table'); + $this->table->set_caption('Preferences'); $this->table->set_heading('Name', 'Color', 'Size'); $this->table->add_row('Fred', 'Blue', 'Small'); $this->table->add_row('Mary', 'Red', 'Large'); @@ -289,6 +294,7 @@ Class Reference $this->table->clear(); + $this->table->set_caption('Shipping'); $this->table->set_heading('Name', 'Day', 'Delivery'); $this->table->add_row('Fred', 'Wednesday', 'Express'); $this->table->add_row('Mary', 'Monday', 'Air'); diff --git a/user_guide_src/source/libraries/trackback.rst b/user_guide_src/source/libraries/trackback.rst index dc4477e9f..abc608b7d 100644 --- a/user_guide_src/source/libraries/trackback.rst +++ b/user_guide_src/source/libraries/trackback.rst @@ -6,7 +6,7 @@ The Trackback Class provides functions that enable you to send and receive Trackback data. If you are not familiar with Trackbacks you'll find more information -`here <http://en.wikipedia.org/wiki/Trackback>`_. +`here <https://en.wikipedia.org/wiki/Trackback>`_. .. contents:: :local: diff --git a/user_guide_src/source/libraries/xmlrpc.rst b/user_guide_src/source/libraries/xmlrpc.rst index 2fe07c49d..a9a899d7b 100644 --- a/user_guide_src/source/libraries/xmlrpc.rst +++ b/user_guide_src/source/libraries/xmlrpc.rst @@ -73,7 +73,7 @@ information: - The *request* data (explained below). Here is a basic example that sends a simple Weblogs.com ping to the -`Ping-o-Matic <http://pingomatic.com/>`_ +`Ping-o-Matic <https://pingomatic.com/>`_ :: diff --git a/user_guide_src/source/overview/at_a_glance.rst b/user_guide_src/source/overview/at_a_glance.rst index 742d7bd0e..d5e5bf929 100644 --- a/user_guide_src/source/overview/at_a_glance.rst +++ b/user_guide_src/source/overview/at_a_glance.rst @@ -111,4 +111,4 @@ CodeIgniter has a Friendly Community of Users ============================================= Our growing community of users can be seen actively participating in our -`Community Forums <http://forum.codeigniter.com/>`_. +`Community Forums <https://forum.codeigniter.com/>`_. diff --git a/user_guide_src/source/overview/getting_started.rst b/user_guide_src/source/overview/getting_started.rst index 04ee50df7..a5181d96d 100644 --- a/user_guide_src/source/overview/getting_started.rst +++ b/user_guide_src/source/overview/getting_started.rst @@ -19,6 +19,6 @@ Reference** and **Helper Reference** pages to learn to utilize the native libraries and helper files. Feel free to take advantage of our `Community -Forums <http://forum.codeigniter.com/>`_ if you have questions or +Forums <https://forum.codeigniter.com/>`_ if you have questions or problems, and our `Wiki <https://github.com/bcit-ci/CodeIgniter/wiki>`_ to see code examples posted by other users. diff --git a/user_guide_src/source/tutorial/conclusion.rst b/user_guide_src/source/tutorial/conclusion.rst index 0d90cde6f..fa41c4492 100644 --- a/user_guide_src/source/tutorial/conclusion.rst +++ b/user_guide_src/source/tutorial/conclusion.rst @@ -20,7 +20,7 @@ CodeIgniter within a few days. If you still have questions about the framework or your own CodeIgniter code, you can: -- Check out our `forums <http://forum.codeigniter.com/>`_ +- Check out our `forums <https://forum.codeigniter.com/>`_ - Visit our `IRC chatroom <https://github.com/bcit-ci/CodeIgniter/wiki/IRC>`_ - Explore the `Wiki <https://github.com/bcit-ci/CodeIgniter/wiki/>`_ |