diff options
author | Andrey Andreev <narf@devilix.net> | 2014-01-20 14:03:43 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-01-20 14:03:43 +0100 |
commit | ea801ab4ab80042638ffddc6056483a1ec43fa80 (patch) | |
tree | f75f30c0df6a8f861ca7df22af09fa3240b0bbd6 /user_guide_src | |
parent | 1c08d557a21ecb0f79cd1a1de4e06817a26e0537 (diff) | |
parent | 4d0571666d03511ac5b4a1f2a6882ccb1509a209 (diff) |
Merge branch 'develop' into feature/user-guide-cleanup
Diffstat (limited to 'user_guide_src')
33 files changed, 645 insertions, 205 deletions
diff --git a/user_guide_src/source/_themes/eldocs/static/asset/css/common.css b/user_guide_src/source/_themes/eldocs/static/asset/css/common.css index d5b0e21bc..962380b50 100644 --- a/user_guide_src/source/_themes/eldocs/static/asset/css/common.css +++ b/user_guide_src/source/_themes/eldocs/static/asset/css/common.css @@ -143,7 +143,7 @@ a:visited{ color: #1A5B8D; } a:hover, a:active{ color: #742CAC; } -a.headerlink{ visibility: hidden; } +a.headerlink{ visibility: hidden; margin-left: 0.4em; } :hover > a.headerlink { visibility: visible; } @@ -277,7 +277,7 @@ fieldset{ border: 0; } background-color: #FFFFFF; border: 1px solid; border-color: #033861 #13598F #13598F #033861; - font-size: inherit; + font: inherit; margin-right: 5px; padding: 5px; width: 175px; @@ -290,8 +290,9 @@ fieldset{ border: 0; } border: 1px solid #033861; color: #094776; cursor: pointer; + font: inherit; font-weight: bold; - padding: 5px 10px 4px; + padding: 5px 10px; text-transform: uppercase; } @@ -360,6 +361,4 @@ fieldset{ border: 0; } h3,h4,h5,h6{ font-size: 14px; } } -@media screen and (-webkit-min-device-pixel-ratio:0){ - #header input[type="submit"]{ padding-bottom: 7px; } -} +#header input[type="submit"], x:-moz-any-link{ padding: 4px 10px; } diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index ba980d845..cd1998b9a 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -19,10 +19,12 @@ Release Date: Not Released - General Changes - PHP 5.1.6 is no longer supported. CodeIgniter now requires PHP 5.2.4. + - Changed filenaming convention (class file names now must be Ucfirst and everything else in lowercase). + - Changed the default database driver to 'mysqli' (the old 'mysql' driver is DEPRECATED). - ``$_SERVER['CI_ENV']`` can now be set to control the ``ENVIRONMENT`` constant. - Added an optional backtrace to php-error template. - Added Android to the list of user agents. - - Added Windows 7, Windows 8, Android, Blackberry, iOS and PlayStation 3 to the list of user platforms. + - Added Windows 7, Windows 8, Windows 8.1, Android, Blackberry, iOS and PlayStation 3 to the list of user platforms. - Added Fennec (Firefox for mobile) to the list of mobile user agents. - Ability to log certain error types, not all under a threshold. - Added support for pem, p10, p12, p7a, p7c, p7m, p7r, p7s, crt, crl, der, kdb, rsa, cer, sst, csr Certs to mimes.php. @@ -54,8 +56,10 @@ Release Date: Not Released - Changed environment defaults to report all errors in *development* and only fatal ones in *testing*, *production* but only display them in *development*. - Updated *ip_address* database field lengths from 16 to 45 for supporting IPv6 address on :doc:`Trackback Library <libraries/trackback>` and :doc:`Captcha Helper <helpers/captcha_helper>`. - Removed *cheatsheets* and *quick_reference* PDFs from the documentation. + - Added support non-HTML error templates for CLI applications. - Added availability checks where usage of dangerous functions like ``eval()`` and ``exec()`` is required. - Added support for changing the file extension of log files using ``$config['log_file_extension']``. + - Added support for turning newline standardization on/off via ``$config['standardize_newlines']``. - Helpers @@ -73,10 +77,9 @@ Release Date: Not Released - :func:`url_title()` will now trim extra dashes from beginning and end. - :func:`anchor_popup()` will now fill the *href* attribute with the URL and its JS code will return FALSE instead. - Added JS window name support to the :func:`anchor_popup()` function. - - Added support (auto-detection) for HTTP/1.1 response code 303 in :func:`redirect()`. + - Added support (auto-detection) for HTTP/1.1 response codes 303, 307 in :func:`redirect()`. - Changed :func:`redirect()` to choose the **refresh** method only on IIS servers, instead of all servers on Windows (when **auto** is used). - Changed :func:`anchor()`, :func:`anchor_popup()`, and :func:`redirect()` to support protocol-relative URLs (e.g. *//ellislab.com/codeigniter*). - - Added an optional second parameter to both :func:`base_url()` and :func:`site_url()` that allows enforcing of a protocol different than the one in the *base_url* configuration setting. - :doc:`HTML Helper <helpers/html_helper>` changes include: @@ -127,13 +130,17 @@ Release Date: Not Released - Added *word_length* and *pool* options to allow customization of the generated word. - Added *colors* configuration to allow customization for the *background*, *border*, *text* and *grid* colors. + - Added *filename* to the returned array elements. - :doc:`Directory Helper <helpers/directory_helper>` :func:`directory_map()` will now append ``DIRECTORY_SEPARATOR`` to directory names in the returned array. + - :doc:`Array Helper <helpers/array_helper>` :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>` :func:`lang()` now accepts an optional list of additional HTML attributes. + - Changed the default tag for use in :doc:`Text Helper <helpers/text_helper>` :func:`highlight_phrase()` to ``<mark>`` (formerly ``<strong>``). - 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. - Database + - DEPRECATED the 'mysql', 'sqlite', 'mssql' and 'pdo/dblib' (also known as 'pdo/mssql' or 'pdo/sybase') drivers. - Added **dsn** configuration setting for drivers that support DSN strings (PDO, PostgreSQL, Oracle, ODBC, CUBRID). - Added **schema** configuration setting (defaults to *public*) for drivers that might need it (currently used by PostgreSQL and ODBC). - Added subdrivers support (currently only used by PDO). @@ -153,6 +160,7 @@ Release Date: Not Released - Added support for SQLite3 database driver. - Added Interbase/Firebird database support via the *ibase* driver. - Added ODBC support for ``create_database()``, ``drop_database()`` and ``drop_table()`` in :doc:`Database Forge <database/forge>`. + - Added **save_queries** configuration setting to *application/config/database.php* (defaults to ``TRUE``). - :doc:`Query Builder <database/query_builder>` changes include: @@ -162,6 +170,7 @@ Release Date: Not Released - Added an optional parameter that allows to disable escaping (useful for custom fields) for methods ``join()``, ``order_by()``, ``where_in()``, ``or_where_in()``, ``where_not_in()``, ``or_where_not_in()``, ``insert()``, ``insert_batch()``. - Added support for ``join()`` with multiple conditions. - Added support for *USING* in ``join()``. + - Added support for *EXISTS* in ``where()``. - Added seed values support for random ordering with ``order_by(seed, 'RANDOM')``. - Changed ``limit()`` to ignore NULL values instead of always casting to integer. - Changed ``offset()`` to ignore empty values instead of always casting to integer. @@ -179,6 +188,7 @@ Release Date: Not Released - Server version checking is now done via ``mysqli::$server_info`` instead of running an SQL query. - Added persistent connections support for PHP >= 5.3. - Added support for ``backup()`` in :doc:`Database Utilities <database/utilities>`. + - Changed methods ``trans_begin()``, ``trans_commit()`` and ``trans_rollback()`` to use the PHP API instead of sending queries. - Improved support of the PDO driver, including: @@ -196,6 +206,7 @@ Release Date: Not Released - Removed ``limit()`` and ``order_by()`` support for *UPDATE* and *DELETE* queries as PostgreSQL does not support those features. - Added a work-around for dead persistent connections to be re-created after a database restart. - Changed ``db_connect()`` to include the (new) **schema** value into Postgre's **search_path** session variable. + - ``pg_escape_literal()`` is now used for escaping strings, if available. - Improved support of the CUBRID driver, including: @@ -269,8 +280,14 @@ Release Date: Not Released - Added the **min_width** and **min_height** options for images. - Removed method ``clean_file_name()`` and its usage in favor of :doc:`Security Library <libraries/security>`'s ``sanitize_filename()``. - Added **file_ext_tolower** config setting. + - Added **mod_mime_fix** option to disable suffixing multiple file extensions with an underscore. - - :doc:`Cart library <libraries/cart>` changes include: + - :doc:`Calendar Library <libraries/calendar>` changes include: + + - Added configuration to generate days of other months instead of blank cells. + - Auto set *next_prev_url* if it is empty and *show_prev_next* is set to TRUE. + + - :doc:`Cart Library <libraries/cart>` changes include: - ``insert()`` now auto-increments quantity for an item when inserted twice instead of resetting it, this is the default behaviour of large e-commerce sites. - *Product Name* strictness can be disabled by switching the ``$product_name_safe`` property to FALSE. @@ -278,7 +295,7 @@ Release Date: Not Released - Added method ``get_item()`` to enable retrieving data for a single cart item. - Added unicode support for product names. - - :doc:`Image Manipulation library <libraries/image_lib>` changes include: + - :doc:`Image Manipulation Library <libraries/image_lib>` changes include: - The ``initialize()`` method now only sets existing class properties. - Added support for 3-length hex color values for *wm_font_color* and *wm_shadow_color* properties, as well as validation for them. @@ -287,7 +304,7 @@ Release Date: Not Released - Property *maintain_ratio* is now taken into account when resizing images using ImageMagick library. - Added support for maintaining transparency for PNG images in method ``text_watermark()``. - - :doc:`Form Validation library <libraries/form_validation>` changes include: + - :doc:`Form Validation Library <libraries/form_validation>` changes include: - Added method ``error_array()`` to return all error messages as an array. - Added method ``set_data()`` to set an alternative data array to be validated instead of the default ``$_POST``. @@ -303,19 +320,25 @@ Release Date: Not Released - Added support for named parameters in error messages. - :doc:`Language <libraries/language>` line keys must now be prefixed with **form_validation_**. - Added rule **alpha_numeric_spaces**. + - Added support for custom error messages per field rule. - :doc:`Caching Library <libraries/caching>` changes include: - Added Wincache driver. - Added Redis driver. - Added a *key_prefix* option for cache IDs. + - Updated driver ``is_supported()`` methods to log at the "debug" level. + - Added option to store raw values instead of CI-formatted ones (APC, Memcache). + - Added atomic increment/decrement feature via ``increment()``, ``decrement()``. - - :doc:`Email library <libraries/email>` changes include: + - :doc:`Email Library <libraries/email>` changes include: - - Added custom filename to ``Email::attach()`` as ``$this->email->attach($filename, $disposition, $newname)``. - - Added possibility to send attachment as buffer string in ``Email::attach()`` as ``$this->email->attach($buffer, $disposition, $newname, $mime)``. + - Added a custom filename parameter to ``attach()`` as ``$this->email->attach($filename, $disposition, $newname)``. + - Added possibility to send attachment as buffer string in ``attach()`` as ``$this->email->attach($buffer, $disposition, $newname, $mime)``. + - Added possibility to attach remote files by passing a URL. + - Added method ``attachment_cid()`` to enable embedding inline attachments into HTML. - Added dsn (delivery status notification) option. - - Renamed method _set_header() to set_header() and made it public to enable adding custom headers in the :doc:`Email Library <libraries/email>`. + - Renamed method ``_set_header()`` to ``set_header()`` and made it public to enable adding custom headers. - Successfully sent emails will automatically clear the parameters. - Added a *return_path* parameter to the ``from()`` method. - Removed the second parameter (character limit) from internal method ``_prep_quoted_printable()`` as it is never used. @@ -324,7 +347,7 @@ Release Date: Not Released - Removed unused protected method ``_get_ip()`` (:doc:`Input Library <libraries/input>`'s ``ip_address()`` should be used anyway). - Internal method ``_prep_q_encoding()`` now utilizes PHP's *mbstring* and *iconv* extensions (when available) and no longer has a second (``$from``) argument. - Added an optional parameter to ``print_debugger()`` to allow specifying which parts of the message should be printed ('headers', 'subject', 'body'). - - Added SMTP keepalive option to avoid opening the connection for each ``Email::send()``. Accessible as ``$smtp_keepalive``. + - Added SMTP keepalive option to avoid opening the connection for each ``send()`` call. Accessible as ``$smtp_keepalive``. - Public method ``set_header()`` now filters the input by removing all "\\r" and "\\n" characters. - :doc:`Pagination Library <libraries/pagination>` changes include: @@ -334,7 +357,6 @@ Release Date: Not Released - Deprecated usage of the "anchor_class" setting (use the new "attributes" setting instead). - Added $config['reuse_query_string'] to allow automatic repopulation of query string arguments, combined with normal URI segments. - Removed the default `` `` from a number of the configuration variables. - - Added the ability to use a proxy with the :doc:`XML-RPC Library <libraries/xmlrpc>`. - :doc:`Encryption Library <libraries/encryption>` changes include: @@ -346,34 +368,64 @@ Release Date: Not Released - Database object names are now being displayed. - The sum of all queries running times in seconds is now being displayed. - Added support for displaying the HTTP DNT ("Do Not Track") header. + - Added support for displaying ``$_FILES``. - :doc:`Migration Library <libraries/migration>` changes include: - Added support for timestamp-based migrations (enabled by default). - Added ``$config['migration_type']`` to allow switching between *sequential* and *timestamp* migrations. - - :doc:`User Agent Library <libraries/user_agent>` will now check if robots are pretending to be mobile clients (helps with e.g. Google indexing mobile website versions). + - :doc:`XML-RPC Library <libraries/xmlrpc>` changes include: + + - Added the ability to use a proxy. + - Added Basic HTTP authentication support. + + - :doc:`User Agent Library <libraries/user_agent>` changes include: + + - Added check to detect if robots are pretending to be mobile clients (helps with e.g. Google indexing mobile website versions). + - Added method ``parse()`` to allow parsing a custom user-agent string, different from the current visitor's. + - Added support for setting :doc:`Table <libraries/table>` class defaults in a config file. + - :doc:`Zip Library <libraries/zip>` method ``read_file()`` can now also alter the original file path/name while adding files to an archive. - Core + - :doc:`Routing <general/routing>` changes include: + + - Added support for multiple levels of controller directories. + - Added support for per-directory *default_controller* and *404_override* classes. + - Added possibility to route requests using HTTP verbs. + - Added possibility to route requests using callbacks. + - Added a new reserved route (*translate_uri_dashes*) to allow usage of dashes in the controller and method URI segments. + - Deprecated methods ``fetch_directory()``, ``fetch_class()`` and ``fetch_method()`` in favor of their respective public properties. + - Removed method ``_set_overrides()`` and moved its logic to the class constructor. + - :doc:`URI Library <libraries/uri>` changes include: + - Added conditional PCRE UTF-8 support to the "invalid URI characters" check and removed the ``preg_quote()`` call from it to allow more flexibility. + - Renamed method ``_filter_uri()`` to ``filter_uri()``. - Changed private methods to protected so that MY_URI can override them. - Renamed internal method ``_parse_cli_args()`` to ``_parse_argv()``. - Renamed internal method ``_detect_uri()`` to ``_parse_request_uri()``. - Changed ``_parse_request_uri()`` to accept absolute URIs for compatibility with HTTP/1.1 as per `RFC2616 <http://www.ietf.org/rfc/rfc2616.txt>`. - Added protected method ``_parse_query_string()`` to URI paths in the the **QUERY_STRING** value, like ``_parse_request_uri()`` does. - Changed ``_fetch_uri_string()`` to try the **PATH_INFO** variable first when auto-detecting. + - Removed methods ``_remove_url_suffix()``, ``_explode_segments()`` and moved their logic into ``_set_uri_string()``. + - Removed method ``_fetch_uri_string()`` and moved its logic into the class constructor. + - Removed method ``_reindex_segments()``. - :doc:`Loader Library <libraries/loader>` changes include: + - Added method chaining support. - Added method ``get_vars()`` to the Loader to retrieve all variables loaded with ``$this->load->vars()``. - ``_ci_autoloader()`` is now a protected method. - Added autoloading of drivers with ``$autoload['drivers']``. - ``$config['rewrite_short_tags']`` now has no effect when using PHP 5.4 as ``<?=`` will always be available. - Changed method ``config()`` to return whatever ``CI_Config::load()`` returns instead of always being void. - - Added support for model aliasing on autoload. + - Added support for library and model aliasing on autoload. + - Changed method ``is_loaded()`` to ask for the (case sensitive) library name instead of its instance name. + - Removed ``$_base_classes`` property and unified all class data in ``$_ci_classes`` instead. + - Added method ``clear_vars()`` to allow clearing the cached variables for views. - :doc:`Input Library <libraries/input>` changes include: @@ -383,7 +435,11 @@ Release Date: Not Released - Changed method ``valid_ip()`` to use PHP's native ``filter_var()`` function. - Changed internal method ``_sanitize_globals()`` to skip enforcing reversal of *register_globals* in PHP 5.4+, where this functionality no longer exists. - Changed methods ``get()``, ``post()``, ``get_post()``, ``cookie()``, ``server()``, ``user_agent()`` to return NULL instead of FALSE when no value is found. + - Changed default value of the ``$xss_clean`` parameter to NULL for all methods that utilize it, the default value is now determined by the ``$config['global_xss_filtering']`` setting. + - Added method ``post_get()`` and changed ``get_post()`` to search in GET data first. Both methods' names now properly match their GET/POST data search priorities. - Changed method ``_fetch_from_array()`` to parse array notation in field name. + - Added an option for ``_clean_input_keys()`` to return FALSE instead of terminating the whole script. + - Deprecated the ``is_cli_request()`` method, it is now an alias for the new :php:func:`is_cli()` common function. - :doc:`Common functions <general/common_functions>` changes include: @@ -392,42 +448,46 @@ Release Date: Not Released - Removed redundant conditional to determine HTTP server protocol in :func:`set_status_header()`. - Changed ``_exception_handler()`` to respect php.ini *display_errors* setting. - Added function :func:`is_https()` to check if a secure connection is used. + - Added function :func:`is_cli()` to replace the ``CI_Input::is_cli_request()`` method. - Added function :func:`function_usable()` to check if a function exists and is not disabled by `Suhosin <http://www.hardened-php.net/suhosin/>`. + - Removed the third (`$php_error`) from function :func:`log_message()`. - :doc:`Output Library <libraries/output>` changes include: - Added a second argument to method ``set_content_type()`` that allows setting the document charset as well. - Added methods ``get_content_type()`` and ``get_header()``. - Added method ``delete_cache()``. + - Changed caching behavior to compress the output before storing it, if ``$config['compress_output']`` is enabled. - :doc:`Config Library <libraries/config>` changes include: - Changed ``site_url()`` method to accept an array as well. - Removed internal method ``_assign_to_config()`` and moved its implementation to *CodeIgniter.php* instead. + - ``item()`` now returns NULL instead of FALSE when the required config item doesn't exist. + - Added an optional second parameter to both ``base_url()`` and ``site_url()`` that allows enforcing of a protocol different than the one in the *base_url* configuration setting. - :doc:`Security Library <libraries/security>` changes include: - Added method ``strip_image_tags()``. - Added ``$config['csrf_regeneration']``, which makes token regeneration optional. - Added ``$config['csrf_exclude_uris']``, which allows you list URIs which will not have the CSRF validation methods run. - - - :doc:`URI Routing <general/routing>` changes include: - - - Added possibility to route requests using callbacks. - - Added a new reserved route (*translate_uri_dashes*) to allow usage of dashes in the controller and method URI segments. - - Deprecated methods ``fetch_directory()``, ``fetch_class()`` and ``fetch_method()`` in favor of their respective public properties. + - Modified method ``sanitize_filename()`` to read a public ``$filename_bad_chars`` property for getting the invalid characters list. - :doc:`Language Library <libraries/language>` changes include: - - Changed method ``load()`` to filter the language name with ``ctype_digit()``. + - Changed method ``load()`` to filter the language name with ``ctype_alpha()``. - Added an optional second parameter to method ``line()`` to disable error login for line keys that were not found. - Language files are now loaded in a cascading style with the one in **system/** always loaded and overriden afterwards, if another one is found. + - :doc:`Hooks Library <general/hooks>` changes include: + - Renamed method ``_call_hook()`` to ``call_hook()``. + - Class instances are now stored in order to maintain their state. + - Removed ``CI_CORE`` boolean constant from *CodeIgniter.php* (no longer Reactor and Core versions). - Log Library will now try to create the **log_path** directory if it doesn't exist. - Added support for HTTP-Only cookies with new config option *cookie_httponly* (default FALSE). - - Renamed method ``_call_hook()`` to ``call_hook()`` in the :doc:`Hooks Library <general/hooks>`. - ``$config['time_reference']`` now supports all timezone strings supported by PHP. + - Fatal PHP errors are now also passed to ``_exception_handler()``, so they can be logged. Bug fixes for 3.0 @@ -456,7 +516,7 @@ Bug fixes for 3.0 - Fixed a possible bug in ``CI_Input::is_ajax_request()`` where some clients might not send the X-Requested-With HTTP header value exactly as 'XmlHttpRequest'. - Fixed a bug (#1039) - MySQL's _backup() method failed due to a table name not being escaped. - Fixed a bug (#1070) - CI_DB_driver::initialize() didn't set a character set if a database is not selected. -- Fixed a bug (#177) - CI_Form_validation::set_value() didn't set the default value if POST data is NULL. +- Fixed a bug (#177) - ``CI_Form_validation::set_value()`` didn't set the default value if POST data is NULL. - Fixed a bug (#68, #414) - Oracle's escape_str() didn't properly escape LIKE wild characters. - Fixed a bug (#81) - ODBC's list_fields() and field_data() methods skipped the first column due to odbc_field_*() functions' index starting at 1 instead of 0. - Fixed a bug (#129) - ODBC's num_rows() returned -1 in some cases, due to not all subdrivers supporting the odbc_num_rows() function. @@ -584,7 +644,7 @@ Bug fixes for 3.0 - Fixed a bug (#2239) - :doc:`Email Library <libraries/email>` improperly handled the Subject when used with ``bcc_batch_mode`` resulting in E_WARNING messages and an empty Subject. - Fixed a bug (#2234) - :doc:`Query Builder <database/query_builder>` didn't reset JOIN cache for write-type queries. - Fixed a bug (#2298) - :doc:`Database Results <database/results>` method ``next_row()`` kept returning the last row, allowing for infinite loops. -- Fixed a bug (#2236) - :doc:`Form Helper <helpers/form_helper>` function ``set_value()`` didn't parse array notation for keys if the rule was not present in the :doc:`Form Validation Library <libraries/form_validation>`. +- Fixed a bug (#2236, #2639) - :doc:`Form Helper <helpers/form_helper>` functions :func:`set_value()`, :func:`set_select()`, :func:`set_radio()`, :func:`set_checkbox()` didn't parse array notation for keys if the rule was not present in the :doc:`Form Validation Library <libraries/form_validation>`. - Fixed a bug (#2353) - :doc:`Query Builder <database/query_builder>` erroneously prefixed literal strings with **dbprefix**. - Fixed a bug (#78) - :doc:`Cart Library <libraries/cart>` didn't allow non-English letters in product names. - Fixed a bug (#77) - :doc:`Database Class <database/index>` didn't properly handle the transaction "test mode" flag. @@ -595,6 +655,33 @@ Bug fixes for 3.0 - Fixed a bug (#2490) - :doc:`Database Class <database/queries>` method ``query()`` returning boolean instead of a result object for PostgreSQL-specific *INSERT INTO ... RETURNING* statements. - Fixed a bug (#249) - :doc:`Cache Library <libraries/caching>` didn't properly handle Memcache(d) configurations with missing options. - Fixed a bug (#180) - :func:`config_item()` didn't take into account run-time configuration changes. +- Fixed a bug (#2551) - :doc:`Loader Library <libraries/loader>` method ``library()`` didn't properly check if a class that is being loaded already exists. +- Fixed a bug (#2560) - :doc:`Form Helper <helpers/form_helper>` function :php:func:`form_open()` set the 'method="post"' attribute only if the passed attributes equaled an empty string. +- Fixed a bug (#2585) - :doc:`Query Builder <database/query_builder>` methods ``min()``, ``max()``, ``avg()``, ``sum()`` didn't escape field names. +- Fixed an edge case (#2583) in the :doc:`Email Library <libraries/email>` where `Suhosin <http://www.hardened-php.net/suhosin/>` blocked messages sent via ``mail()`` due to trailing newspaces in headers. +- Fixed a bug (#2590) - :php:func:`log_message()` didn't actually cache the ``CI_Log`` class instance. +- Fixed a bug (#2609) - :php:func:`get_config()` optional argument was only effective on first function call. Also, it can now add items, in addition to updating existing items. +- Fixed a bug in the 'postgre' :doc:`database <database/index>` driver where the connection ID wasn't passed to ``pg_escape_string()``. +- Fixed a bug (#33) - Script execution was terminated when an invalid cookie key was encountered. +- Fixed a bug (#2681) - ``CI_Security::entity_decode()`` used the `PREG_REPLACE_EVAL` flag, which is deprecated since PHP 5.5. +- Fixed a bug (#2691) - nested transactions could end in a deadlock when an error is encountered with *db_debug* set to TRUE. +- Fixed a bug (#2515) - ``_exception_handler()`` used to send the 200 "OK" HTTP status code and didn't stop script exection even on fatal errors. +- Fixed a bug - Redis :doc:`Caching <libraries/caching>` driver didn't handle connection failures properly. +- Fixed a bug (#2756) - :doc:`Database Class <database/index>` executed the MySQL-specific `SET SESSION sql_mode` query for all drivers when the 'stricton' option is set. +- Fixed a bug (#2579) - :doc:`Query Builder <database/query_builder>` "no escape" functionality didn't work properly with query cache. +- Fixed a bug (#2237) - :doc:`Parser Library <libraries/parser>` failed if the same tag pair is used more than once within a template. +- Fixed a bug (#2268) - :doc:`Security Library <libraries/security>` didn't properly match JavaScript events. +- Fixed a bug (#2143) - :doc:`Form Validation Library <libraries/form_validation>` didn't check for rule groups named in a *controller/method* manner when trying to load from a config file. +- Fixed a bug (#2762) - :doc:`Hooks Class <general/hooks>` didn't properly check if the called class/function exists. +- Fixed a bug (#148) - while sanitizing input data, ``CI_Input::_clean_input_data()`` assumed that it is URL-encoded, stripping certain character sequences from it. +- Fixed a bug (#346) - with ``$config['global_xss_filtering']`` turned on, the ``$_GET``, ``$_POST``, ``$_COOKIE`` and ``$_SERVER`` superglobals were overwritten during initialization time, resulting in XSS filtering being either performed twice or there was no possible way to get the original data, even though options for this do exist. +- Fixed an edge case (#555) - incorrect browser version was reported for Opera 10+ due to a non-standard user-agent string. +- Fixed a bug (#133) - :doc:`Text Helper <helpers/text_helper>` :func:`ascii_to_entities()` stripped the last character if it happens to be in the extended ASCII group. +- Fixed a bug (#2822) - ``fwrite()`` was used incorrectly throughout the whole framework, allowing incomplete writes when writing to a network stream and possibly a few other edge cases. +- Fixed a bug where :doc:`User Agent Library <libraries/user_agent>` methods ``accept_charset()`` and ``accept_lang()`` didn't properly parse HTTP headers that contain spaces. +- Fixed a bug where *default_controller* was called instad of triggering a 404 error if the current route is in a controller directory. +- Fixed a bug (#2737) - :doc:`XML-RPC Library <libraries/xmlrpc>` used objects as array keys, which triggered E_NOTICE messages. +- Fixed a bug (#2729) - ``CI_Securty::_validate_entities()`` used overly-intrusive ``preg_replace()`` patterns that produced false-positives. Version 2.1.4 ============= @@ -751,7 +838,6 @@ Bug fixes for 2.1.0 but the requested method did not. - Fixed a bug (Reactor #89) where MySQL export would fail if the table had hyphens or other non alphanumeric/underscore characters. -- Fixed a bug (#200) where MySQL queries would be malformed after calling $this->db->count_all() then $this->db->get() - Fixed a bug (#105) that stopped query errors from being logged unless database debugging was enabled - Fixed a bug (#160) - Removed unneeded array copy in the file cache driver. @@ -772,7 +858,7 @@ Bug fixes for 2.1.0 - Fixed a bug (#537) - Support for all wav type in browser. - Fixed a bug (#576) - Using ini_get() function to detect if apc is enabled or not. - Fixed invalid date time format in :doc:`Date helper <helpers/date_helper>` and :doc:`XMLRPC library <libraries/xmlrpc>`. -- Fixed a bug (#200) - MySQL queries would be malformed after calling count_all() then db->get(). +- Fixed a bug (#200) - MySQL queries would be malformed after calling db->count_all() then db->get(). Version 2.0.3 ============= diff --git a/user_guide_src/source/database/helpers.rst b/user_guide_src/source/database/helpers.rst index e8a5ac801..77bf1b5d2 100644 --- a/user_guide_src/source/database/helpers.rst +++ b/user_guide_src/source/database/helpers.rst @@ -3,7 +3,7 @@ Query Helper Functions ###################### $this->db->insert_id() -======================= +====================== The insert ID number when performing database inserts. @@ -12,7 +12,7 @@ The insert ID number when performing database inserts. appropriate sequence to check for the insert id. $this->db->affected_rows() -=========================== +========================== Displays the number of affected rows, when doing "write" type queries (insert, update, etc.). @@ -22,8 +22,8 @@ Displays the number of affected rows, when doing "write" type queries affected rows. By default this hack is enabled but it can be turned off in the database driver file. -$this->db->count_all(); -======================== +$this->db->count_all() +====================== Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:: @@ -47,8 +47,8 @@ Outputs the database version you are running:: echo $this->db->version(); -$this->db->last_query(); -========================= +$this->db->last_query() +======================= Returns the last query that was run (the query string, not the result). Example:: @@ -57,11 +57,12 @@ Example:: // Produces: SELECT * FROM sometable.... -The following two functions help simplify the process of writing -database INSERTs and UPDATEs. -$this->db->insert_string(); -============================ +.. note:: Disabling the **save_queries** setting in your database + configuration will render this function useless. + +$this->db->insert_string() +========================== This function simplifies the process of writing database inserts. It returns a correctly formatted SQL insert string. Example:: @@ -77,8 +78,8 @@ array with the data to be inserted. The above example produces:: .. note:: Values are automatically escaped, producing safer queries. -$this->db->update_string(); -============================ +$this->db->update_string() +========================== This function simplifies the process of writing database updates. It returns a correctly formatted SQL update string. Example:: @@ -95,4 +96,4 @@ array with the data to be updated, and the third parameter is the UPDATE table_name SET name = 'Rick', email = 'rick@example.com', url = 'example.com' WHERE author_id = 1 AND status = 'active' -.. note:: Values are automatically escaped, producing safer queries. +.. note:: Values are automatically escaped, producing safer queries.
\ No newline at end of file diff --git a/user_guide_src/source/database/query_builder.rst b/user_guide_src/source/database/query_builder.rst index 65609c1cb..5bfdfdb52 100644 --- a/user_guide_src/source/database/query_builder.rst +++ b/user_guide_src/source/database/query_builder.rst @@ -68,7 +68,7 @@ Example:: // Produces string: SELECT * FROM mytable The second parameter enables you to set whether or not the query builder query -will be reset (by default it will be—just like `$this->db->get()`):: +will be reset (by default it will be reset, just like when using `$this->db->get()`):: echo $this->db->limit(10,20)->get_compiled_select('mytable', FALSE); // Produces string: SELECT * FROM mytable LIMIT 20, 10 @@ -76,7 +76,7 @@ will be reset (by default it will be—just like `$this->db->get()`):: echo $this->db->select('title, content, date')->get_compiled_select(); - // Produces string: SELECT title, content, date FROM mytable + // Produces string: SELECT title, content, date FROM mytable LIMIT 20, 10 The key thing to notice in the above example is that the second query did not utilize `$this->db->from()`_ and did not pass a table name into the first @@ -665,10 +665,12 @@ will be reset (by default it will be--just like `$this->db->insert()`_):: // Produces string: INSERT INTO mytable (title, content) VALUES ('My Title', 'My Content') The key thing to notice in the above example is that the second query did not -utlize `$this->db->from()`_ nor did it pass a table name into the first +utlize `$this->db->from()` nor did it pass a table name into the first parameter. The reason this worked is because the query has not been executed -using `$this->db->insert()`_ which resets values or reset directly using -`$this->db->reset_query()`_. +using `$this->db->insert()` which resets values or reset directly using +`$this->db->reset_query()`. + +.. note:: This method doesn't work for batched inserts. $this->db->insert_batch() ========================= @@ -886,8 +888,9 @@ $this->db->get_compiled_update() This works exactly the same way as ``$this->db->get_compiled_insert()`` except that it produces an UPDATE SQL string instead of an INSERT SQL string. -For more information view documentation for `$this->db->get_compiled_insert()`_. +For more information view documentation for `$this->db->get_compiled_insert()`. +.. note:: This method doesn't work for batched updates. ************* Deleting Data @@ -1055,4 +1058,9 @@ run the query:: $data = $this->db->get()->result_array(); // Would execute and return an array of results of the following query: - // SELECT field1, field1 from mytable where field3 = 5;
\ No newline at end of file + // SELECT field1, field1 from mytable where field3 = 5; + +.. note:: Double calls to ``get_compiled_select()`` while you're using the + Query Builder Caching functionality and NOT resetting your queries + will results in the cache being merged twice. That in turn will + i.e. if you're caching a ``select()`` - select the same field twice.
\ No newline at end of file diff --git a/user_guide_src/source/general/caching.rst b/user_guide_src/source/general/caching.rst index 48385d6c9..f499f6e93 100644 --- a/user_guide_src/source/general/caching.rst +++ b/user_guide_src/source/general/caching.rst @@ -45,6 +45,9 @@ you. Once the tag is in place, your pages will begin being cached. caching will only work if you are generating display for your controller with a :doc:`view <./views>`. +.. important:: If you change configuration options that might affect + your output, you have to manually delete your cache files. + .. note:: Before the cache files can be written you must set the file permissions on your *application/cache/* directory such that it is writable. diff --git a/user_guide_src/source/general/cli.rst b/user_guide_src/source/general/cli.rst index 998d2a907..4f3b07d9e 100644 --- a/user_guide_src/source/general/cli.rst +++ b/user_guide_src/source/general/cli.rst @@ -23,7 +23,7 @@ but they are not always obvious. - Run your cron-jobs without needing to use *wget* or *curl* - Make your cron-jobs inaccessible from being loaded in the URL by - checking for ``$this->input->is_cli_request()`` + checking the return value of :func:`is_cli()`. - Make interactive "tasks" that can do things like set permissions, prune cache folders, run backups, etc. - Integrate with other applications in other languages. For example, a @@ -33,7 +33,7 @@ Let's try it: Hello World! ========================== Let's create a simple controller so you can see it in action. Using your -text editor, create a file called tools.php, and put the following code +text editor, create a file called Tools.php, and put the following code in it:: <?php diff --git a/user_guide_src/source/general/common_functions.rst b/user_guide_src/source/general/common_functions.rst index 8c5166358..65ca026a1 100644 --- a/user_guide_src/source/general/common_functions.rst +++ b/user_guide_src/source/general/common_functions.rst @@ -13,7 +13,7 @@ loading any libraries or helpers. <div class="custom-index container"></div> -.. function:: is_php($version = '5.3.0') +.. function:: is_php([$version = '5.3.0']) :param string $version: Version number :returns: bool @@ -66,7 +66,7 @@ loading any libraries or helpers. to retrieve single keys. See :doc:`Config Library <../libraries/config>` documentation for more information. -.. :noindex: function:: show_error($message, $status_code, $heading = 'An Error Was Encountered') +.. :noindex: function:: show_error($message, $status_code[, $heading = 'An Error Was Encountered']) :param mixed $message: Error message :param int $status_code: HTTP Response status code @@ -76,7 +76,7 @@ loading any libraries or helpers. This function calls ``CI_Exception::show_error()``. For more info, please see the :doc:`Error Handling <errors>` documentation. -.. :noindex: function:: show_404($page = '', $log_error = TRUE) +.. :noindex: function:: show_404([$page = ''[, $log_error = TRUE]]) :param string $page: URI string :param bool $log_error: Whether to log the error @@ -85,17 +85,16 @@ loading any libraries or helpers. This function calls ``CI_Exception::show_404()``. For more info, please see the :doc:`Error Handling <errors>` documentation. -.. :noindex: function:: log_message($level, $message, $php_error = FALSE) +.. :noindex: function:: log_message($level, $message) :param string $level: Log level: 'error', 'debug' or 'info' :param string $message: Message to log - :param bool $php_error: Whether we're logging a native PHP error message :returns: void This function is an alias for ``CI_Log::write_log()``. For more info, please see the :doc:`Error Handling <errors>` documentation. -.. function:: set_status_header($code, $text = '') +.. function:: set_status_header($code[, $text = '']) :param int $code: HTTP Reponse status code :param string $text: A custom message to set with the status code @@ -109,7 +108,7 @@ loading any libraries or helpers. `See here <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>`_ for a full list of headers. -.. function:: remove_invisible_characters($str, $url_encoded = TRUE) +.. function:: remove_invisible_characters($str[, $url_encoded = TRUE]) :param string $str: Input string :param bool $url_encoded: Whether to remove URL-encoded characters as well @@ -147,8 +146,15 @@ loading any libraries or helpers. Returns TRUE if a secure (HTTPS) connection is used and FALSE in any other case (including non-HTTP requests). -function_usable() -================= +.. function:: is_cli() + + :returns: bool + + Returns TRUE if the application is run through the command line + and FALSE if not. + + .. note:: This function checks both if the ``PHP_SAPI`` value is 'cli' + or if the ``STDIN`` constant is defined. .. function:: function_usable($function_name) diff --git a/user_guide_src/source/general/controllers.rst b/user_guide_src/source/general/controllers.rst index 04f23276d..d8ef824fb 100644 --- a/user_guide_src/source/general/controllers.rst +++ b/user_guide_src/source/general/controllers.rst @@ -18,7 +18,7 @@ Consider this URI:: example.com/index.php/blog/ In the above example, CodeIgniter would attempt to find a controller -named blog.php and load it. +named Blog.php and load it. **When a controller's name matches the first segment of a URI, it will be loaded.** @@ -27,7 +27,7 @@ Let's try it: Hello World! ========================== Let's create a simple controller so you can see it in action. Using your -text editor, create a file called blog.php, and put the following code +text editor, create a file called Blog.php, and put the following code in it:: <?php @@ -41,6 +41,8 @@ in it:: Then save the file to your *application/controllers/* directory. +.. important:: The file must be called 'Blog.php', with a capital 'B'. + Now visit the your site using a URL similar to this:: example.com/index.php/blog/ @@ -136,7 +138,7 @@ present, as will be the case when only your site root URL is requested. To specify a default controller, open your **application/config/routes.php** file and set this variable:: - $route['default_controller'] = 'blog'; + $route['default_controller'] = 'Blog'; Where Blog is the name of the controller class you want used. If you now load your main index.php file without specifying any URI segments you'll @@ -272,7 +274,7 @@ and place your controller classes within them. specify the folder. For example, let's say you have a controller located here:: - application/controllers/products/shoes.php + application/controllers/products/Shoes.php To call the above controller your URI will look something like this:: diff --git a/user_guide_src/source/general/creating_libraries.rst b/user_guide_src/source/general/creating_libraries.rst index 4fc8ed72f..4beb600da 100644 --- a/user_guide_src/source/general/creating_libraries.rst +++ b/user_guide_src/source/general/creating_libraries.rst @@ -42,8 +42,7 @@ Naming Conventions The Class File ============== -Classes should have this basic prototype (Note: We are using the name -Someclass purely as an example):: +Classes should have this basic prototype:: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); @@ -56,6 +55,8 @@ Someclass purely as an example):: /* End of file Someclass.php */ +.. note:: We are using the name Someclass purely as an example. + Using Your Class ================ @@ -81,7 +82,7 @@ constructor:: $params = array('type' => 'large', 'color' => 'red'); - $this->load->library('Someclass', $params); + $this->load->library('someclass', $params); If you use this feature you must set up your class constructor to expect data:: diff --git a/user_guide_src/source/general/libraries.rst b/user_guide_src/source/general/libraries.rst index 6e1c8b6dd..9bbda51bb 100644 --- a/user_guide_src/source/general/libraries.rst +++ b/user_guide_src/source/general/libraries.rst @@ -29,4 +29,4 @@ Creating Your Own Libraries =========================== Please read the section of the user guide that discusses how to -:doc:`create your own libraries <creating_libraries>`. +:doc:`create your own libraries <creating_libraries>`.
\ No newline at end of file diff --git a/user_guide_src/source/general/models.rst b/user_guide_src/source/general/models.rst index a028a9569..c4fd12476 100644 --- a/user_guide_src/source/general/models.rst +++ b/user_guide_src/source/general/models.rst @@ -84,8 +84,7 @@ Where **Model_name** is the name of your class. Class names **must** have the first letter capitalized with the rest of the name lowercase. Make sure your class extends the base Model class. -The file name will be a lower case version of your class name. For -example, if your class is this:: +The file name must match the class name. For example, if this is your class:: class User_model extends CI_Model { @@ -98,7 +97,7 @@ example, if your class is this:: Your file will be this:: - application/models/user_model.php + application/models/User_model.php Loading a Model =============== @@ -111,7 +110,7 @@ the following method:: If your model is located in a sub-directory, include the relative path from your models directory. For example, if you have a model located at -*application/models/blog/queries.php* you'll load it using:: +*application/models/blog/Queries.php* you'll load it using:: $this->load->model('blog/queries'); @@ -181,4 +180,4 @@ database. The following options for connecting are available to you: $config['pconnect'] = FALSE; $config['db_debug'] = TRUE; - $this->load->model('Model_name', '', $config);
\ No newline at end of file + $this->load->model('model_name', '', $config);
\ No newline at end of file diff --git a/user_guide_src/source/general/profiling.rst b/user_guide_src/source/general/profiling.rst index 6dbd0be16..f29af8102 100644 --- a/user_guide_src/source/general/profiling.rst +++ b/user_guide_src/source/general/profiling.rst @@ -80,4 +80,8 @@ Key Description **session_data** Data stored in the current session TRUE **query_toggle_count** The number of queries after which the query block will default to 25 hidden. -======================= =================================================================== ========
\ No newline at end of file +======================= =================================================================== ======== + +.. note:: Disabling the **save_queries** setting in your database configuration + will also effectively disable profiling for database queries and render + the 'queries' setting above useless.
\ No newline at end of file diff --git a/user_guide_src/source/general/routing.rst b/user_guide_src/source/general/routing.rst index 5520f59fe..0b91d3fa9 100644 --- a/user_guide_src/source/general/routing.rst +++ b/user_guide_src/source/general/routing.rst @@ -142,6 +142,29 @@ routing rules to process the back-references. Example:: return 'catalog/product_edit/' . strtolower($product_type) . '/' . $id; }; +Using HTTP verbs in routes +========================== + +It is possible to use HTTP verbs (request method) to define your routing rules. +This is particularly useful when building RESTful applications. You can use standard HTTP +verbs (GET, PUT, POST, DELETE, PATCH) or a custom one such (e.g. PURGE). HTTP verb rules +are case-insensitive. All you need to do is to add the verb as an array key to your route. +Example:: + + $route['products']['put'] = 'product/insert'; + +In the above example, a PUT request to URI "products" would call the ``Product::insert()`` +controller method. + +:: + + $route['products/(:num)']['DELETE'] = 'product/delete/$1'; + +A DELETE request to URL with "products" as first the segment and a number in the second will be +mapped to the ``Product::delete()`` method, passing the numeric value as the first parameter. + +Using HTTP verbs is of course, optional. + Reserved Routes =============== diff --git a/user_guide_src/source/general/styleguide.rst b/user_guide_src/source/general/styleguide.rst index 144b362f5..5613eabec 100644 --- a/user_guide_src/source/general/styleguide.rst +++ b/user_guide_src/source/general/styleguide.rst @@ -71,13 +71,42 @@ identify a file as being complete and not truncated. echo "Here's my code!"; - /* End of file myfile.php */ + /* End of file Myfile.php */ /* Location: ./system/modules/mymodule/myfile.php */ .. note:: There should be no empty line or newline character(s) following the closing comments. If you happen to see one when submitting a pull request, please check your IDE settings and fix it. +File Naming +=========== + +Class files must be named in a Ucfirst-like manner, while any other file name +(configurations, views, generic scripts, etc.) should be in all lowercase. + +**INCORRECT**:: + + somelibrary.php + someLibrary.php + SOMELIBRARY.php + Some_Library.php + + Application_config.php + Application_Config.php + applicationConfig.php + +**CORRECT**:: + + Somelibrary.php + Some_library.php + + applicationconfig.php + application_config.php + +Furthermore, class file names should match the name of the class itself. +For example, if you have a class named `Myclass`, then its filename must +be **Myclass.php**. + Class and Method Naming ======================= diff --git a/user_guide_src/source/general/views.rst b/user_guide_src/source/general/views.rst index 4b1ab3c34..2fc0cb2ca 100644 --- a/user_guide_src/source/general/views.rst +++ b/user_guide_src/source/general/views.rst @@ -45,7 +45,7 @@ Where name is the name of your view file. .. note:: The .php file extension does not need to be specified unless you use something other than .php. -Now, open the controller file you made earlier called blog.php, and +Now, open the controller file you made earlier called Blog.php, and replace the echo statement with the view loading method:: <?php diff --git a/user_guide_src/source/helpers/form_helper.rst b/user_guide_src/source/helpers/form_helper.rst index 8ad8f7dcd..dcb5bee21 100644 --- a/user_guide_src/source/helpers/form_helper.rst +++ b/user_guide_src/source/helpers/form_helper.rst @@ -28,7 +28,7 @@ The following functions are available: .. function:: form_open([$action = ''[, $attributes = ''[, $hidden = array()]]]) :param string $action: Form action/target URI string - :param string $attributes: HTML attributes + :param array $attributes: HTML attributes :param array $hidden: An array of hidden fields' definitions :returns: string @@ -85,7 +85,7 @@ The following functions are available: .. function:: form_open_multipart([$action = ''[, $attributes = array()[, $hidden = array()]]) :param string $action: Form action/target URI string - :param string $attributes: HTML attributes + :param array $attributes: HTML attributes :param array $hidden: An array of hidden fields' definitions :returns: string diff --git a/user_guide_src/source/helpers/smiley_helper.rst b/user_guide_src/source/helpers/smiley_helper.rst index 0601f0244..077c56a17 100644 --- a/user_guide_src/source/helpers/smiley_helper.rst +++ b/user_guide_src/source/helpers/smiley_helper.rst @@ -158,8 +158,7 @@ Available Functions Example:: $str = 'Here are some smileys: :-) ;-)'; - $str = parse_smileys($str, "http://example.com/images/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/installation/downloads.rst b/user_guide_src/source/installation/downloads.rst index 8d47ba3a5..93c5cc21b 100644 --- a/user_guide_src/source/installation/downloads.rst +++ b/user_guide_src/source/installation/downloads.rst @@ -3,35 +3,37 @@ Downloading CodeIgniter ####################### - `CodeIgniter v3.0.0 (Current version) <http://ellislab.com/codeigniter/download>`_ -- `CodeIgniter v2.1.4 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.1.4.zip>`_ -- `CodeIgniter v2.1.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.1.3.zip>`_ -- `CodeIgniter v2.1.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.1.2.zip>`_ -- `CodeIgniter v2.1.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.1.1.zip>`_ -- `CodeIgniter v2.1.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.1.0.zip>`_ -- `CodeIgniter v2.0.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.0.3.zip>`_ -- `CodeIgniter v2.0.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.0.2.zip>`_ -- `CodeIgniter v2.0.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.0.1.zip>`_ -- `CodeIgniter v2.0.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.0.0.zip>`_ -- `CodeIgniter v1.7.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.7.3.zip>`_ -- `CodeIgniter v1.7.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.7.2.zip>`_ -- `CodeIgniter v1.7.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.7.1.zip>`_ -- `CodeIgniter v1.7.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.7.0.zip>`_ -- `CodeIgniter v1.6.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.6.3.zip>`_ -- `CodeIgniter v1.6.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.6.2.zip>`_ -- `CodeIgniter v1.6.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.6.1.zip>`_ -- `CodeIgniter v1.6.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.6.0.zip>`_ -- `CodeIgniter v1.5.4 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.5.4.zip>`_ -- `CodeIgniter v1.5.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.5.3.zip>`_ -- `CodeIgniter v1.5.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.5.2.zip>`_ -- `CodeIgniter v1.5.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.5.1.zip>`_ -- `CodeIgniter v1.4.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.4.1.zip>`_ -- `CodeIgniter v1.3.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.3.3.zip>`_ -- `CodeIgniter v1.3.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.3.2.zip>`_ -- `CodeIgniter v1.3.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.3.1.zip>`_ -- `CodeIgniter v1.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.3.zip>`_ -- `CodeIgniter v1.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.2.zip>`_ -- `CodeIgniter v1.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.1b.zip>`_ -- `CodeIgniter v1.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.0b.zip>`_ +- `CodeIgniter v2.1.4 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.1.4.zip>`_ (MD5 Checksum: e74a296c1d412a855c025b9cd468a513) +- `CodeIgniter v2.1.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.1.3.zip>`_ (MD5 Checksum: 781d06be06eaa36f10759ef82c8594d5) +- `CodeIgniter v2.1.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.1.2.zip>`_ (MD5 Checksum: c7a2980dff2774c97bd38bfbf450d8d5) +- `CodeIgniter v2.1.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.1.1.zip>`_ (MD5 Checksum: c4aa5f188f4ff16f919607b46a16c76c) +- `CodeIgniter v2.1.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.1.0.zip>`_ (MD5 Checksum: 8cb676b0f831114935d7dd1ae2e0d490) +- `CodeIgniter v2.0.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.0.3.zip>`_ (MD5 Checksum: 910475d50daf088bdd949c3d35b444d9) +- `CodeIgniter v2.0.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.0.2.zip>`_ (MD5 Checksum: e75bab8cf27d2fb2483c5bb61b85a524) +- `CodeIgniter v2.0.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.0.1.zip>`_ (MD5 Checksum: 675aa95896bfb16467436c0484f15f1f) +- `CodeIgniter v2.0.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_2.0.0.zip>`_ (MD5 Checksum: bd657863de45dbb397f3b3dbc4f13abb) +- `CodeIgniter v1.7.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.7.3.zip>`_ (MD5 Checksum: 16f50e7df4f44c1defe18355131049e9) +- `CodeIgniter v1.7.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.7.2.zip>`_ (MD5 Checksum: ff2f4d1b3ab921f91e006f38b3ae6540) +- `CodeIgniter v1.7.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.7.1.zip>`_ (MD5 Checksum: deca9709cf21b26dc0e4ec040b37e866) +- `CodeIgniter v1.7.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.7.0.zip>`_ (MD5 Checksum: 28037f2071f940d8756864460d949045) +- `CodeIgniter v1.6.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.6.3.zip>`_ (MD5 Checksum: 5ffab52b39b235ed6bd08ee5dd64d2f6) +- `CodeIgniter v1.6.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.6.2.zip>`_ (MD5 Checksum: 0922830f96dfd40874b39ad018a49206) +- `CodeIgniter v1.6.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.6.1.zip>`_ (MD5 Checksum: cc3f0b566e3654d351fa067aeee9bced) +- `CodeIgniter v1.6.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.6.0.zip>`_ (MD5 Checksum: 89efabb8c1d57bb51071e6a20bb5590d) +- `CodeIgniter v1.5.4 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.5.4.zip>`_ (MD5 Checksum: 0d6cc66b01d5ddecde483b3d5f51e4f8) +- `CodeIgniter v1.5.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.5.3.zip>`_ (MD5 Checksum: f44dd21d34a2842bd052879ca5de6630) +- `CodeIgniter v1.5.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.5.2.zip>`_ (MD5 Checksum: 78e7106b271f75af48e626f6e923c1aa) +- `CodeIgniter v1.5.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.5.1.zip>`_ (MD5 Checksum: 9dfd0dbed4f283a42a817e1e88f97481) +- `CodeIgniter v1.5.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.5.0.zip>`_ (MD5 Checksum: 116b805eae4b7e78ddd43a8aee733632) +- `CodeIgniter v1.4.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.4.1.zip>`_ (MD5 Checksum: 470005a83772e9d2e99dec2b4058e584) +- `CodeIgniter v1.4.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.4.0.zip>`_ (MD5 Checksum: 43ca6ff3447d6b5681f98a328b386338) +- `CodeIgniter v1.3.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.3.3.zip>`_ (MD5 Checksum: 55692ba4b55b53b58e4514e310288981) +- `CodeIgniter v1.3.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.3.2.zip>`_ (MD5 Checksum: 7dace6e1d6245b569943e8df952c7637) +- `CodeIgniter v1.3.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.3.1.zip>`_ (MD5 Checksum: f6c6f00830c60d7f98b948269ee81069) +- `CodeIgniter v1.3 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.3.zip>`_ (MD5 Checksum: 03b2f796df6af808ecff3a18b6000477) +- `CodeIgniter v1.2 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.2.zip>`_ (MD5 Checksum: f9289814fabe102bc35beb791d0c0f62) +- `CodeIgniter v1.1 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.1b.zip>`_ (MD5 Checksum: bf4cabb6a3ea3122a974270b8044befb) +- `CodeIgniter v1.0 <http://ellislab.com/asset/ci_download_files/CodeIgniter_1.0b.zip>`_ (MD5 Checksum: 427ca4255e2bdaacee976de1aa143ea0) ****** diff --git a/user_guide_src/source/installation/upgrade_300.rst b/user_guide_src/source/installation/upgrade_300.rst index b36a70cc8..c11db34f8 100644 --- a/user_guide_src/source/installation/upgrade_300.rst +++ b/user_guide_src/source/installation/upgrade_300.rst @@ -17,22 +17,63 @@ they will need to be made fresh in this new one. .. note:: If you have any custom developed files in these folders please make copies of them first. +************************************** +Step 2: Update your classes file names +************************************** + +Starting with CodeIgniter 3.0, all class filenames (libraries, drivers, controllers +and models) must be named in a Ucfirst-like manner or in other words - they must +start with a capital letter. + +For example, if you have the following library file: + + application/libraries/mylibrary.php + +... then you'll have to rename it to: + + application/libraries/Mylibrary.php + +The same goes for driver libraries and extensions and/or overrides of CodeIgniter's +own libraries and core classes. + + application/libraries/MY_email.php + application/core/MY_log.php + +The above files should respectively be renamed to the following: + + application/libraries/MY_Email.php + application/core/MY_Log.php + +Controllers: + + application/controllers/welcome.php -> application/controllers/Welcome.php + +Models: + + application/models/misc_model.php -> application/models/Misc_model.php + +Please note that this DOES NOT affect directories, configuration files, views, +helpers, hooks and anything else - it is only applied to classes. + +You must now follow just one simple rule - class names in Ucfirst and everything else +in lowercase. + ******************************** -Step 2: Replace config/mimes.php +Step 3: Replace config/mimes.php ******************************** This config file has been updated to contain more user mime-types, please copy it to _application/config/mimes.php*. ************************************************************** -Step 3: Remove $autoload['core'] from your config/autoload.php +Step 4: Remove $autoload['core'] from your config/autoload.php ************************************************************** Use of the ``$autoload['core']`` config array has been deprecated as of CodeIgniter 1.4.1 and is now removed. Move any entries that you might have listed there to ``$autoload['libraries']`` instead. *************************************************** -Step 4: Move your Log class overrides or extensions +Step 5: Move your Log class overrides or extensions *************************************************** The Log Class is considered as a "core" class and is now located in the @@ -40,10 +81,10 @@ The Log Class is considered as a "core" class and is now located in the or extensions to work, you need to move them to **application/core/**:: application/libraries/Log.php -> application/core/Log.php - application/libraries/MY_Log.php -> application/core/MY_log.php + application/libraries/MY_Log.php -> application/core/MY_Log.php ********************************************************* -Step 5: Convert your Session usage from library to driver +Step 6: Convert your Session usage from library to driver ********************************************************* When you load (or autoload) the Session library, you must now load it as a driver instead of a library. This means @@ -67,7 +108,7 @@ standard for Drivers. Also beware that some functions which are not part of the the drivers, so your extension may have to be broken down into separate library and driver class extensions. *************************************** -Step 6: Update your config/database.php +Step 7: Update your config/database.php *************************************** Due to 3.0.0's renaming of Active Record to Query Builder, inside your `config/database.php`, you will @@ -78,14 +119,21 @@ need to rename the `$active_record` variable to `$query_builder` // $active_record = TRUE; $query_builder = TRUE; -******************************* -Step 7: Move your errors folder -******************************* +************************************ +Step 8: Replace your error templates +************************************ + +In CodeIgniter 3.0, the error templates are now considered as views and have been moved to the +_application/views/errors* directory. -In version 3.0.0, the errors folder has been moved from _application/errors* to _application/views/errors*. +Furthermore, we've added support for CLI error templates in plain-text format that unlike HTML, +is suitable for the command line. This of course requires another level of separation. + +It is safe to move your old templates from _application/errors* to _application/views/errors/html*, +but you'll have to copy the new _application/views/errors/cli* directory from the CodeIgniter archive. ******************************************************* -Step 8: Update your config/routes.php containing (:any) +Step 9: Update your config/routes.php containing (:any) ******************************************************* Historically, CodeIgniter has always provided the **:any** wildcard in routing, @@ -104,47 +152,93 @@ regular expression:: (.+) // matches ANYTHING (:any) // matches any character, except for '/' -***************************************** -Step 9: Update your libraries' file names -***************************************** +************************************************************************* +Step 10: Many functions now return NULL instead of FALSE on missing items +************************************************************************* -CodeIgniter 3.0 only allows library file names to be named in a *ucfirst* manner -(meaning that the first letter of the class name must be a capital). For example, -if you have the following library file: +Many methods and functions now return NULL instead of FALSE when the required items don't exist: - application/libraries/mylibrary.php + - :doc:`Config Class <../libraries/config>` -... then you'll have to rename it to: + - config->item() + - config->slash_item() - application/libraries/Mylibrary.php + - :doc:`Input Class <../libraries/input>` -The same goes for driver libraries and extensions and/or overrides of CodeIgniter's -own libraries and core classes. + - input->get() + - input->post() + - input->get_post() + - input->cookie() + - input->server() + - input->input_stream() + - input->get_request_header() - application/libraries/MY_email.php - application/core/MY_log.php + - :doc:`Session Class <../libraries/sessions>` -The above files should respectively be renamed to the following: + - session->userdata() + - session->flashdata() - application/libraries/MY_Email.php - application/core/MY_Log.php + - :doc:`URI Class <../libraries/uri>` + + - uri->segment() + - uri->rsegment() -***************************************************************************** -Step 10: Check the calls to Array Helper's element() and elements() functions -***************************************************************************** + - :doc:`Array Helper <../helpers/array_helper>` -The default return value of these functions, when the required elements -don't exist, has been changed from FALSE to NULL. + - element() + - elements() + +******************************* +Step 11: Usage of XSS filtering +******************************* + +Many functions in CodeIgniter allow you to use its XSS filtering feature +on demand by passing a boolean parameter. The default value of that +parameter used to be boolean FALSE, but it is now changed to NULL and it +will be dynamically determined by your ``$config['global_xss_filtering']`` +value. + +If you used to manually pass a boolean value for the ``$xss_filter`` +parameter or if you've always had ``$config['global_xss_filtering']`` set +to FALSE, then this change doesn't concern you. + +Otherwise however, please review your usage of the following functions: + + - :doc:`Input Library <../libraries/input>` + + - input->get() + - input->post() + - input->get_post() + - input->cookie() + - input->server() + - input->input_stream() + + - :doc:`Cookie Helper <../helpers/cookie_helper>` :func:`get_cookie()` + +.. important:: Another related change is that the ``$_GET``, ``$_POST``, + ``$_COOKIE`` and ``$_SERVER`` superglobals are no longer + automatically overwritten when global XSS filtering is turned on. + +******************************************************** +Step 12: Update usage of Input Class's get_post() method +******************************************************** + +Previously, the :doc:`Input Class <../libraries/input>` method ``get_post()`` +was searching first in POST data, then in GET data. This method has been +modified so that it searches in GET then in POST, as its name suggests. + +A method has been added, ``post_get()``, which searches in POST then in GET, as +``get_post()`` was doing before. *********************************************************************** -Step 11: Check the calls to Directory Helper's directory_map() function +Step 13: Update usage of Directory Helper's directory_map() function *********************************************************************** In the resulting array, directories now end with a trailing directory separator (i.e. a slash, usually). ************************************************************* -Step 12: Update usage of Database Forge's drop_table() method +Step 14: Update usage of Database Forge's drop_table() method ************************************************************* Up until now, ``drop_table()`` added an IF EXISTS clause by default or it didn't work @@ -166,7 +260,7 @@ If your application relies on IF EXISTS, you'll have to change its usage. all drivers with the exception of ODBC. *********************************************************** -Step 13: Change usage of Email library with multiple emails +Step 15: Change usage of Email library with multiple emails *********************************************************** The :doc:`Email Library <../libraries/email>` will automatically clear the @@ -181,7 +275,7 @@ pass FALSE as the first parameter in the ``send()`` method: } *************************************************** -Step 14: Update your Form_validation language lines +Step 16: Update your Form_validation language lines *************************************************** Two improvements have been made to the :doc:`Form Validation Library @@ -212,7 +306,7 @@ files and error messages format: later. **************************************************************** -Step 15: Remove usage of (previously) deprecated functionalities +Step 17: Remove usage of (previously) deprecated functionalities **************************************************************** In addition to the ``$autoload['core']`` configuration setting, there's a @@ -239,6 +333,26 @@ Smiley helper js_insert_smiley() :doc:`Smiley Helper <../helpers/smiley_helper>` function ``js_insert_smiley()`` has been deprecated since CodeIgniter 1.7.2 and is now removed. You'll need to switch to ``smiley_js()`` instead. +Database drivers 'mysql', 'sqlite', 'mssql', 'pdo/dblib' +======================================================== + +The **mysql** driver utilizes the old 'mysql' PHP extension, known for its aging code base and +many low-level problems. The extension is deprecated as of PHP 5.5 and CodeIgniter deprecates +it in version 3.0, switching the default configured MySQL driver to **mysqli**. + +Please use either the 'mysqli' or 'pdo/mysql' drivers for MySQL. The old 'mysql' driver will be +removed at some point in the future. + +The **sqlite**, **mssql** and **pdo/dblib** (also known as pdo/mssql or pdo/sybase) drivers +all depend on PHP extensions that for different reasons no longer exist since PHP 5.3. + +Therefore we are now deprecating these drivers as we will have to remove them in one of the next +CodeIgniter versions. You should use the more advanced, **sqlite3**, **sqlsrv** or **pdo/sqlsrv** +drivers respectively. + +.. note:: These drivers are still available, but you're strongly encouraged to switch to other ones + sooner rather than later. + Security helper do_hash() ========================= @@ -401,4 +515,46 @@ then you can now just access the properties instead:: $this->router->method; .. note:: Those methods are still available, but you're strongly encouraged to remove their usage - sooner rather than later.
\ No newline at end of file + sooner rather than later. + +Input library method is_cli_request() +===================================== + +Calls to the ``CI_Input::is_cli_request()`` method are necessary at many places +in the CodeIgniter internals and this is often before the :doc:`Input Library +<../libraries/input>` is loaded. Because of that, it is being replaced by a common +function named :php:func:`is_cli()` and this method is now just an alias. + +The new function is both available at all times for you to use and shorter to type. + +:: + + // Old + $this->input->is_cli_request(); + + // New + is_cli(); + +``CI_Input::is_cli_request()`` is now now deprecated and scheduled for removal in +CodeIgniter 3.1+. + +.. note:: This method is still available, but you're strongly encouraged to remove its usage + sooner rather than later. + +*********************************************************** +Step 18: Check your usage of Text helper highlight_phrase() +*********************************************************** + +The default HTML tag used by :doc:`Text Helper <../helpers/text_helper>` function +:func:`highlight_phrase()` has been changed from ``<strong>`` to the new HTML5 +tag ``<mark>``. + +Unless you've used your own highlighting tags, this might cause trouble +for your visitors who use older web browsers such as Internet Explorer 8. +We therefore suggest that you add the following code to your CSS files +in order to avoid backwards compatibility with old browsers:: + + mark { + background: #ff0; + color: #000; + }; diff --git a/user_guide_src/source/libraries/caching.rst b/user_guide_src/source/libraries/caching.rst index 5a9742378..30a9fed2d 100644 --- a/user_guide_src/source/libraries/caching.rst +++ b/user_guide_src/source/libraries/caching.rst @@ -240,17 +240,28 @@ For more information on WinCache, please see Redis Caching ============= +Redis is an in-memory key-value store which can operate in LRU cache mode. +To use it, you need Redis server and phpredis PHP extension +`https://github.com/nicolasff/phpredis <https://github.com/nicolasff/phpredis>`_. + +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; + $config['timeout'] = 0; + 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->redis->save('foo', 'bar', 10); -.. important:: Redis may require one or more of the following options: - **host**, **post**, **timeout**, **password**. - -The Redis PHP extension repository is located at -`https://github.com/nicolasff/phpredis <https://github.com/nicolasff/phpredis>`_. +For more information on Redis, please see +`http://redis.io <http://redis.io>`_. Dummy Cache =========== diff --git a/user_guide_src/source/libraries/calendar.rst b/user_guide_src/source/libraries/calendar.rst index d9a336d08..3879672ce 100644 --- a/user_guide_src/source/libraries/calendar.rst +++ b/user_guide_src/source/libraries/calendar.rst @@ -97,21 +97,23 @@ The above code would start the calendar on saturday, use the "long" month heading, and the "short" day names. More information regarding preferences below. -====================== =========== =============================================== =================================================================== -Preference Default Options Description -====================== =========== =============================================== =================================================================== -**template** None None A string containing your calendar template. - See the template section below. -**local_time** time() None A Unix timestamp corresponding to the current time. -**start_day** sunday Any week day (sunday, monday, tuesday, etc.) Sets the day of the week the calendar should start on. -**month_type** long long, short Determines what version of the month name to use in the header. - long = January, short = Jan. -**day_type** abr long, short, abr Determines what version of the weekday names to use in - the column headers. long = Sunday, short = Sun, abr = Su. -**show_next_prev** FALSE TRUE/FALSE (boolean) Determines whether to display links allowing you to toggle - to next/previous months. See information on this feature below. -**next_prev_url** None A URL Sets the basepath used in the next/previous calendar links. -====================== =========== =============================================== =================================================================== +====================== ================= ============================================ =================================================================== +Preference Default Options Description +====================== ================= ============================================ =================================================================== +**template** None None A string containing your calendar template. + See the template section below. +**local_time** time() None A Unix timestamp corresponding to the current time. +**start_day** sunday Any week day (sunday, monday, tuesday, etc.) Sets the day of the week the calendar should start on. +**month_type** long long, short Determines what version of the month name to use in the header. + long = January, short = Jan. +**day_type** abr long, short, abr Determines what version of the weekday names to use in + the column headers. long = Sunday, short = Sun, abr = Su. +**show_next_prev** FALSE TRUE/FALSE (boolean) Determines whether to display links allowing you to toggle + to next/previous months. See information on this feature below. +**next_prev_url** controller/method A URL Sets the basepath used in the next/previous calendar links. +**show_other_days** FALSE TRUE/FALSE (boolean) Determines whether to display days of other months that share the + first or last week of the calendar month. +====================== ================= ============================================ =================================================================== Showing Next/Previous Month Links @@ -134,7 +136,8 @@ You'll notice a few things about the above example: - You must set the "show_next_prev" to TRUE. - You must supply the URL to the controller containing your calendar in - the "next_prev_url" preference. + the "next_prev_url" preference. If you don't, it will be set to the current + *controller/method*. - You must supply the "year" and "month" to the calendar generating function via the URI segments where they appear (Note: The calendar class automatically adds the year/month to the base URL you @@ -165,6 +168,8 @@ pair of pseudo-variables as shown here:: {cal_row_start}<tr>{/cal_row_start} {cal_cell_start}<td>{/cal_cell_start} + {cal_cell_start_today}<td>{/cal_cell_start_today} + {cal_cell_start_other}<td class="other-month">{/cal_cell_start_other} {cal_cell_content}<a href="{content}">{day}</a>{/cal_cell_content} {cal_cell_content_today}<div class="highlight"><a href="{content}">{day}</a></div>{/cal_cell_content_today} @@ -174,7 +179,11 @@ pair of pseudo-variables as shown here:: {cal_cell_blank} {/cal_cell_blank} + {cal_cell_other}{day}{cal_cel_other} + {cal_cell_end}</td>{/cal_cell_end} + {cal_cell_end_today}</td>{/cal_cell_end_today} + {cal_cell_end_other}</td>{/cal_cell_end_other} {cal_row_end}</tr>{/cal_row_end} {table_close}</table>{/table_close} diff --git a/user_guide_src/source/libraries/config.rst b/user_guide_src/source/libraries/config.rst index 54aa70b2d..8663324f2 100644 --- a/user_guide_src/source/libraries/config.rst +++ b/user_guide_src/source/libraries/config.rst @@ -99,7 +99,7 @@ example, to fetch your language choice you'll do this:: $lang = $this->config->item('language'); -The function returns FALSE (boolean) if the item you are trying to fetch +The function returns NULL if the item you are trying to fetch does not exist. If you are using the second parameter of the $this->config->load diff --git a/user_guide_src/source/libraries/email.rst b/user_guide_src/source/libraries/email.rst index 1d9d2c171..ec639846f 100644 --- a/user_guide_src/source/libraries/email.rst +++ b/user_guide_src/source/libraries/email.rst @@ -254,7 +254,6 @@ Class Reference message CodeIgniter will extract the message from your HTML email and strip the tags. - .. method:: set_header($header, $value) :param string $header: header name @@ -330,8 +329,8 @@ Class Reference :returns: CI_Email object for method chaining Enables you to send an attachment. Put the file path/name in the first - parameter. Note: Use a file path, not a URL. For multiple attachments - use the method multiple times. For example:: + parameter. For multiple attachments use the method multiple times. + For example:: $this->email->attach('/path/to/photo1.jpg'); $this->email->attach('/path/to/photo2.jpg'); @@ -342,6 +341,10 @@ Class Reference $this->email->attach('image.jpg', 'inline'); + You can also use a URL:: + + $this->email->attach('http://example.com/filename.pdf'); + If you'd like to use a custom file name, you can use the third paramater:: $this->email->attach('filename.pdf', 'attachment', 'report.pdf'); @@ -352,6 +355,26 @@ Class Reference $this->email->attach($buffer, 'attachment', 'report.pdf', 'application/pdf'); + .. method:: attachment_cid($filename) + + :param string $filename: Existing attachment filename + :returns: string + + Sets and returns an attachment's Content-ID, which enables your to embed an inline + (picture) attachment into HTML. First parameter must be the already attached file name. + :: + + $filename = '/img/photo1.jpg'; + $this->email->attach($filename); + foreach ($list as $address) + { + $this->email->to($address); + $cid = $this->email->attach_cid($filename); + $this->email->message('<img src='cid:". $cid ."' alt="photo1" />'); + $this->email->send(); + } + + .. note:: Content-ID for each e-mail must be re-created for it to be unique. .. method:: print_debugger([$include = array('headers', 'subject', 'body')]) diff --git a/user_guide_src/source/libraries/file_uploading.rst b/user_guide_src/source/libraries/file_uploading.rst index 695998d73..d679d8aa2 100644 --- a/user_guide_src/source/libraries/file_uploading.rst +++ b/user_guide_src/source/libraries/file_uploading.rst @@ -90,7 +90,7 @@ place this code and save it to your **application/views/** directory:: The Controller ============== -Using a text editor, create a controller called upload.php. In it, place +Using a text editor, create a controller called Upload.php. In it, place this code and save it to your **application/controllers/** directory:: <?php @@ -231,6 +231,11 @@ Preference Default Value Options Descripti **detect_mime** TRUE TRUE/FALSE (boolean) If set to TRUE, a server side detection of the file type will be performed to avoid code injection attacks. DO NOT disable this option 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>`_. + DO NOT turn off this option if your upload directory is public, as this + is a security risk. ============================ ================= ======================= ====================================================================== Setting preferences in a config file @@ -340,4 +345,4 @@ Class Reference image_height Image height image_type Image type. Typically the file extension without the period. image_size_str A string containing the width and height. Useful to put into an image tag. - ================ ================================================
\ No newline at end of file + ================ ================================================ diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index 35f745fb7..42422f9d7 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -200,6 +200,7 @@ The above method takes **three** parameters as input: message. For example, if your field is named "user" you might give it a human name of "Username". #. The validation rules for this form field. +#. (optional) Set custom error messages on any rules given for current field. If not provided will use the default one. .. note:: If you would like the field name to be stored in a language file, please see :ref:`translating-field-names`. @@ -225,7 +226,9 @@ Your controller should now look like this:: $this->load->library('form_validation'); $this->form_validation->set_rules('username', 'Username', 'required'); - $this->form_validation->set_rules('password', 'Password', 'required'); + $this->form_validation->set_rules('password', 'Password', 'required', + array('required' => 'You must provide a %s.') + ); $this->form_validation->set_rules('passconf', 'Password Confirmation', 'required'); $this->form_validation->set_rules('email', 'Email', 'required'); @@ -263,7 +266,10 @@ you use this approach, you must name your array keys as indicated:: array( 'field' => 'password', 'label' => 'Password', - 'rules' => 'required' + 'rules' => 'required', + 'errors' => array( + 'required' => 'You must provide a %s.', + ), ), array( 'field' => 'passconf', @@ -285,7 +291,14 @@ Cascading Rules CodeIgniter lets you pipe multiple rules together. Let's try it. Change your rules in the third parameter of rule setting method, like this:: - $this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[12]|is_unique[users.username]'); + $this->form_validation->set_rules( + 'username', 'Username', + 'required|min_length[5]|max_length[12]|is_unique[users.username]', + array( + 'required' => 'You have not provided %s.', + 'is_unique' => 'This %s already exists.' + ) + ); $this->form_validation->set_rules('password', 'Password', 'required'); $this->form_validation->set_rules('passconf', 'Password Confirmation', 'required|matches[password]'); $this->form_validation->set_rules('email', 'Email', 'required|valid_email|is_unique[users.email]'); @@ -431,7 +444,7 @@ Here's how your controller should now look:: } } - protected function username_check($str) + public function username_check($str) { if ($str == 'test') { @@ -469,11 +482,18 @@ Setting Error Messages All of the native error messages are located in the following language file: **system/language/english/form_validation_lang.php** -To set your own custom message you can either edit that file, or use the -following method:: +To set your own global custom message for a rule, you can either +edit that file, or use the following method:: $this->form_validation->set_message('rule', 'Error Message'); +If you need to set a custom error message for a particular field on +some particular rule, use the set_rules() method:: + + $this->form_validation->set_rules('field_name', 'Field Label', 'rule1|rule2|rule3', + array('rule2' => 'Error Message on rule2 for this field_name') + ); + Where rule corresponds to the name of a particular rule, and Error Message is the text you would like displayed. @@ -866,7 +886,8 @@ Rule Parameter Description **is_unique** Yes Returns FALSE if the form element is not unique to the table and field name in the is_unique[table.field] parameter. Note: This rule requires :doc:`Query Builder <../database/query_builder>` to be enabled in order to work. -**max_length** Yes Returns FALSE if the form element is longer then the parameter value. max_length[12] +**min_length** Yes Returns FALSE if the form element is shorter than the parameter value. min_length[3] +**max_length** Yes Returns FALSE if the form element is longer than the parameter value. max_length[12] **exact_length** Yes Returns FALSE if the form element is not exactly the parameter value. exact_length[8] **greater_than** Yes Returns FALSE if the form element is less than or equal to the parameter value or not greater_than[8] numeric. diff --git a/user_guide_src/source/libraries/input.rst b/user_guide_src/source/libraries/input.rst index f5ab04883..8a83207af 100644 --- a/user_guide_src/source/libraries/input.rst +++ b/user_guide_src/source/libraries/input.rst @@ -32,7 +32,8 @@ following: (and a few other) characters. - Provides XSS (Cross-site Scripting Hacks) filtering. This can be enabled globally, or upon request. -- Standardizes newline characters to \\n(In Windows \\r\\n) +- Standardizes newline characters to ``PHP_EOL`` (\\n in UNIX-based OSes, + \\r\\n under Windows). This is configurable. XSS Filtering ============= @@ -155,18 +156,32 @@ Class Reference $this->input->get(NULL, TRUE); // returns all GET items with XSS filter $this->input->get(NULL, FALSE); // returns all GET items without XSS filtering + .. method:: post_get([$index = ''[, $xss_clean = NULL]]) + + :param string $index: POST/GET parameter name + :param bool $xss_clean: Whether to apply XSS filtering + :returns: mixed + + This method works the same way as ``post()`` and ``get()``, only combined. + It will search through both POST and GET streams for data, looking in POST + first, and then in GET:: + + $this->input->post_get('some_data', TRUE); + .. method:: get_post([$index = ''[, $xss_clean = NULL]]) :param string $index: GET/POST parameter name :param bool $xss_clean: Whether to apply XSS filtering :returns: mixed - This method works the same way as ``post()`` and ``get()``, only combined. - It will search through both POST and GET streams for data, looking first - in POST, and then in GET:: + This method works the same way as ``post_get()`` only it looks for GET + data first. $this->input->get_post('some_data', TRUE); + .. note:: This method used to act EXACTLY like ``post_get()``, but it's + behavior has changed in CodeIgniter 3.0. + .. method:: cookie([$index = ''[, $xss_clean = NULL]]) :param string $index: COOKIE parameter name @@ -362,6 +377,9 @@ Class Reference $this->input->is_cli_request() + .. note:: This method is DEPRECATED and is now just an alias for the + :func:`is_cli()` function. + .. 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/loader.rst b/user_guide_src/source/libraries/loader.rst index ec5a87bb4..15d9d80fc 100644 --- a/user_guide_src/source/libraries/loader.rst +++ b/user_guide_src/source/libraries/loader.rst @@ -278,6 +278,12 @@ Class Reference This method retrieves all variables available to your views. + .. method:: clear_vars() + + :returns: object + + Clears cached view variables. + .. method:: model($model[, $name = ''[, $db_conn = FALSE]]) :param mixed $model: Model name or an array containing multiple models @@ -292,7 +298,7 @@ Class Reference If your model is located in a subdirectory, include the relative path from your models directory. For example, if you have a model located at - *application/models/blog/queries.php* you'll load it using:: + *application/models/blog/Queries.php* you'll load it using:: $this->load->model('blog/queries'); @@ -370,6 +376,33 @@ Class Reference This method is an alias of the :doc:`config file loading method <config>`: ``$this->config->load()`` + .. method:: is_loaded($class) + + :param string $class: Class name + :returns: mixed + + Allows you to check if a class has already been loaded or not. + + .. note:: The word "class" here refers to libraries and drivers. + + If the requested class has been loaded, the method returns its assigned + name in the CI Super-object and FALSE if it's not:: + + $this->load->library('form_validation'); + $this->load->is_loaded('Form_validation'); // returns 'form_validation' + + $this->load->is_loaded('Nonexistent_library'); // returns FALSE + + .. important:: If you have more than one instance of a class (assigned to + different properties), then the first one will be returned. + + :: + + $this->load->library('form_validation', $config, 'fv'); + $this->load->library('form_validation'); + + $this->load->is_loaded('Form_validation'); // returns 'fv' + .. method:: add_package_path($path[, $view_cascade = TRUE]) :param string $path: Path to add diff --git a/user_guide_src/source/libraries/migration.rst b/user_guide_src/source/libraries/migration.rst index 128796c4d..4143609bb 100644 --- a/user_guide_src/source/libraries/migration.rst +++ b/user_guide_src/source/libraries/migration.rst @@ -94,7 +94,7 @@ Then in **application/config/migration.php** set ``$config['migration_version'] Usage Example ************* -In this example some simple code is placed in **application/controllers/migrate.php** +In this example some simple code is placed in **application/controllers/Migrate.php** to update the schema.:: <?php @@ -175,4 +175,4 @@ Class Reference specific versions. It works just like ``current()`` but ignores ``$config['migration_version']``. :: - $this->migration->version(5);
\ No newline at end of file + $this->migration->version(5); diff --git a/user_guide_src/source/libraries/security.rst b/user_guide_src/source/libraries/security.rst index 8d7ccb1ab..451fadf93 100644 --- a/user_guide_src/source/libraries/security.rst +++ b/user_guide_src/source/libraries/security.rst @@ -67,12 +67,13 @@ file in the following way:: If you use the :doc:`form helper <../helpers/form_helper>`, then :func:`form_open()` will automatically insert a hidden csrf field in -your forms. If not, then you can use ``csrf_get_token_name()`` and ``csrf_get_hash()`` +your forms. If not, then you can use ``get_csrf_token_name()`` +and ``get_csrf_hash()`` :: $csrf = array( - 'name' => $this->security->csrf_get_token_name(), - 'hash' => $this->security->csrf_get_hash() + 'name' => $this->security->get_csrf_token_name(), + 'hash' => $this->security->get_csrf_hash() ); ... @@ -149,4 +150,4 @@ Class Reference This method acts a lot like PHP's own native ``html_entity_decode()`` function in ENT_COMPAT mode, only it tries to detect HTML entities that don't end in a semicolon because some browsers allow that. - If the ``$charset`` parameter is left empty, then your configured ``$config['charset']`` value will be used.
\ No newline at end of file + If the ``$charset`` parameter is left empty, then your configured ``$config['charset']`` value will be used. diff --git a/user_guide_src/source/libraries/sessions.rst b/user_guide_src/source/libraries/sessions.rst index 010b464d3..3e6dcf28b 100644 --- a/user_guide_src/source/libraries/sessions.rst +++ b/user_guide_src/source/libraries/sessions.rst @@ -262,7 +262,7 @@ Session Preferences =================== You'll find the following Session related preferences in your -application/config/config.php file: +*application/config/config.php* file: =========================== =============== =========================== ========================================================================== Preference Default Options Description @@ -281,7 +281,8 @@ Preference Default Options Descript table before enabling this option (Cookie driver only). **sess_table_name** ci_sessions Any valid SQL table name The name of the session database table (Cookie driver only). **sess_time_to_update** 300 Time in seconds This options controls how often the session class will regenerate itself - and create a new session id. + and create a new session ID. Setting it to 0 will disable session + ID regeneartion. **sess_match_ip** FALSE TRUE/FALSE (boolean) Whether to match the user's IP address when reading the session data. Note that some ISPs dynamically changes the IP, so if you want a non-expiring session you will likely set this to FALSE. @@ -673,4 +674,4 @@ Class Reference Example:: $this->session->tempdata('message'); - //returns 'Test message.' considering the set_tempdata example.
\ No newline at end of file + //returns 'Test message.' considering the set_tempdata example. diff --git a/user_guide_src/source/libraries/xmlrpc.rst b/user_guide_src/source/libraries/xmlrpc.rst index 53fe965d7..d9b2dfb1a 100644 --- a/user_guide_src/source/libraries/xmlrpc.rst +++ b/user_guide_src/source/libraries/xmlrpc.rst @@ -307,7 +307,7 @@ Client to send a request to the Server and receive a response. The Client ---------- -Using a text editor, create a controller called xmlrpc_client.php. In +Using a text editor, create a controller called Xmlrpc_client.php. In it, place this code and save it to your application/controllers/ folder:: @@ -348,7 +348,7 @@ folder:: The Server ---------- -Using a text editor, create a controller called xmlrpc_server.php. In +Using a text editor, create a controller called Xmlrpc_server.php. In it, place this code and save it to your application/controllers/ folder:: @@ -569,4 +569,4 @@ Class Reference 'struct' ); - return $this->xmlrpc->send_response($response);
\ No newline at end of file + return $this->xmlrpc->send_response($response); diff --git a/user_guide_src/source/tutorial/news_section.rst b/user_guide_src/source/tutorial/news_section.rst index d7754e9f3..ad9ed41d3 100644 --- a/user_guide_src/source/tutorial/news_section.rst +++ b/user_guide_src/source/tutorial/news_section.rst @@ -16,7 +16,7 @@ are the place where you retrieve, insert, and update information in your database or other data stores. They represent your data. Open up the application/models directory and create a new file called -news_model.php and add the following code. Make sure you've configured +News_model.php and add the following code. Make sure you've configured your database properly as described `here <../database/configuration.html>`_. @@ -85,7 +85,7 @@ Now that the queries are written, the model should be tied to the views that are going to display the news items to the user. This could be done in our pages controller created earlier, but for the sake of clarity, a new "news" controller is defined. Create the new controller at -application/controllers/news.php. +application/controllers/News.php. :: @@ -127,7 +127,7 @@ the views. public function index() { - data['news'] = $this->news_model->get_news(); + $data['news'] = $this->news_model->get_news(); $data['title'] = 'News archive'; $this->load->view('templates/header', $data); diff --git a/user_guide_src/source/tutorial/static_pages.rst b/user_guide_src/source/tutorial/static_pages.rst index 97c74601d..330a50ecf 100644 --- a/user_guide_src/source/tutorial/static_pages.rst +++ b/user_guide_src/source/tutorial/static_pages.rst @@ -20,7 +20,7 @@ match: As URL schemes become more complex, this may change. But for now, this is all we will need to know. -Create a file at application/controllers/pages.php with the following +Create a file at application/controllers/Pages.php with the following code. :: |