summaryrefslogtreecommitdiffstats
path: root/user_guide_src
diff options
context:
space:
mode:
Diffstat (limited to 'user_guide_src')
-rw-r--r--user_guide_src/cilexer/cilexer/cilexer.py8
-rw-r--r--user_guide_src/source/changelog.rst44
-rw-r--r--user_guide_src/source/conf.py4
-rw-r--r--user_guide_src/source/contributing/index.rst4
-rw-r--r--user_guide_src/source/database/db_driver_reference.rst14
-rw-r--r--user_guide_src/source/general/routing.rst11
-rw-r--r--user_guide_src/source/helpers/cookie_helper.rst6
-rw-r--r--user_guide_src/source/helpers/form_helper.rst8
-rw-r--r--user_guide_src/source/installation/upgrade_150.rst4
-rw-r--r--user_guide_src/source/installation/upgrade_300.rst2
-rw-r--r--user_guide_src/source/installation/upgrade_310.rst45
-rw-r--r--user_guide_src/source/libraries/form_validation.rst6
-rw-r--r--user_guide_src/source/libraries/image_lib.rst2
-rw-r--r--user_guide_src/source/libraries/trackback.rst2
-rw-r--r--user_guide_src/source/license.rst2
15 files changed, 120 insertions, 42 deletions
diff --git a/user_guide_src/cilexer/cilexer/cilexer.py b/user_guide_src/cilexer/cilexer/cilexer.py
index 2580b0b30..40582f88a 100644
--- a/user_guide_src/cilexer/cilexer/cilexer.py
+++ b/user_guide_src/cilexer/cilexer/cilexer.py
@@ -1,11 +1,11 @@
# CodeIgniter
-# http://codeigniter.com
+# https://codeigniter.com
#
# An open source application development framework for PHP
#
# This content is released under the MIT License (MIT)
#
-# Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+# Copyright (c) 2014 - 2016, British Columbia Institute of Technology
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -25,8 +25,8 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
-# Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
-# Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
+# Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
+# Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
#
# http://opensource.org/licenses/MIT MIT License
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 986525437..7a0d0f9fa 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -11,12 +11,52 @@ Release Date: Not Released
- Added UNIX socket connection support to :doc:`Session Library <libraries/sessions>` 'redis' driver.
+- Database
+
+ - Changed method ``initialize()`` to return void and instead throw a ``RuntimeException`` in case of failure.
+ - Changed method ``db_connect()`` to always set the connection character set (if supported by the driver) and to fail if it can't.
+ - Removed method ``db_set_charset()`` and the ability to change a connection character set at runtime.
Version 3.0.4
=============
Release Date: Not Released
+- General Changes
+
+ - Updated :doc:`Security Library <libraries/security>` method ``get_random_bytes()`` to use PHP 7's ``random_bytes()`` function when possible.
+ - Updated :doc:`Encryption Library <libraries/security>` method ``create_key()`` to use PHP 7's ``random_bytes()`` function when possible.
+
+- :doc:`Database <database/index>`
+
+ - Added support for ``OFFSET-FETCH`` with Oracle 12c for the 'oci8' and 'pdo/oci' drivers.
+ - Added support for the new ``MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT`` constant from `PHP 5.6.16 <https://secure.php.net/ChangeLog-5.php#5.6.16>`_ for the 'mysqli' driver.
+
+Bug fixes for 3.0.4
+-------------------
+
+- Fixed a bug (#4212) - :doc:`Query Builder <database/query_builder>` method ``count_all_results()`` could fail if an ``ORDER BY`` condition is used.
+- Fixed a bug where :doc:`Form Helper <helpers/form_helper>` functions :php:func:`set_checkbox()`, :php:func:`set_radio()` didn't "uncheck" inputs on a submitted form if the default state is "checked".
+- Fixed a bug (#4217) - :doc:`Config Library <libraries/config>` method ``base_url()`` didn't use proper formatting for IPv6 when it falls back to ``$_SERVER['SERVER_ADDR']``.
+- Fixed a bug where :doc:`CAPTCHA Helper <helpers/captcha_helper>` entered an infinite loop while generating a random string.
+- Fixed a bug (#4223) - :doc:`Database <database/index>` method ``simple_query()`` blindly executes queries without checking if the connection was initialized properly.
+- Fixed a bug (#4244) - :doc:`Email Library <libraries/email>` could improperly use "unsafe" US-ASCII characters during Quoted-printable encoding.
+- Fixed a bug (#4245) - :doc:`Database Forge <database/forge>` couldn't properly handle ``SET`` and ``ENUM`` type fields with string values.
+- Fixed a bug (#4283) - :doc:`String Helper <helpers/string_helper>` function :php:func:`alternator()` couldn't be called without arguments.
+- Fixed a bug (#4306) - :doc:`Database <database/index>` method ``version()`` didn't work properly with the 'mssql' driver.
+- Fixed a bug (#4039) - :doc:`Session Library <libraries/sessions>` could generate multiple (redundant) warnings in case of a read failure with the 'files' driver, due to a bug in PHP.
+- Fixed a bug where :doc:`Session Library <libraries/sessions>` didn't have proper error handling on PHP 5 (due to a PHP bug).
+- Fixed a bug (#4312) - :doc:`Form Validation Library <libraries/form_validation>` didn't provide error feedback for failed validation on empty requests.
+- Fixed a bug where :doc:`Database <database/index>` method `version()` returned banner text instead of only the version number with the 'oci8' and 'pdo/oci' drivers.
+- Fixed a bug (#4331) - :doc:`Database <database/index>` method ``error()`` didn't really work for connection errors with the 'mysqli' driver.
+- Fixed a bug (#4343) - :doc:`Email Library <libraries/email>` failing with a *"More than one 'from' person"* message when using *sendmail*.
+- Fixed a bug (#4350) - :doc:`Loader Library <libraries/loader>` method ``model()`` logic directly instantiated the ``CI_Model`` or ``MY_Model`` classes.
+- Fixed a bug (#4337) - :doc:`Database <database/index>` method ``query()`` didn't return a result set for queries with the ``RETURNING`` statement on PostgreSQL.
+- Fixed a bug (#4362) - :doc:`Session Library <libraries/sessions>` doesn't properly maintain its state after ID regeneration with the 'redis' and 'memcached' drivers on PHP 7.
+- Fixed a bug (#4349) - :doc:`Database <database/index>` drivers 'mysql', 'mysqli', 'pdo/mysql' discard other ``sql_mode`` flags when "stricton" is enabled.
+- Fixed a bug (#4349) - :doc:`Database <database/index>` drivers 'mysql', 'mysqli', 'pdo/mysql' don't turn off ``STRICT_TRANS_TABLES`` on MySQL 5.7+ when "stricton" is disabled.
+- Fixed a bug (#4374) - :doc:`Session Library <libraries/sessions>` with the 'database' driver could be affected by userspace :doc:`Query Builder <database/query_builder>` conditions.
+
Version 3.0.3
=============
@@ -28,7 +68,7 @@ Release Date: October 31, 2015
- Changed :doc:`Config Library <libraries/config>` method ``base_url()`` to fallback to ``$_SERVER['SERVER_ADDR']`` when ``$config['base_url']`` is empty in order to avoid *Host* header injections.
- Changed :doc:`CAPTCHA Helper <helpers/captcha_helper>` to use the operating system's PRNG when possible.
-- Database
+- :doc:`Database`
- Optimized :doc:`Database Utility <database/utilities>` method ``csv_from_result()`` for speed with larger result sets.
- Added proper return values to :doc:`Database Transactions <database/transactions>` method ``trans_start()``.
@@ -37,7 +77,7 @@ Bug fixes for 3.0.3
-------------------
- Fixed a bug (#4170) - :doc:`Database <database/index>` method ``insert_id()`` could return an identity from the wrong scope with the 'sqlsrv' driver.
-- Fixed a bug (#4179) - :doc:`Session Library <libraries/sessions>` doesn't properly maintain its state after ID regeneration with the 'database' driver on PHP7.
+- Fixed a bug (#4179) - :doc:`Session Library <libraries/sessions>` doesn't properly maintain its state after ID regeneration with the 'database' driver on PHP 7.
- Fixed a bug (#4173) - :doc:`Database Forge <database/forge>` method ``add_key()`` didn't allow creation of non-PRIMARY composite keys after the "bugfix" for #3968.
- Fixed a bug (#4171) - :doc:`Database Transactions <database/transactions>` didn't work with nesting in methods ``trans_begin()``, ``trans_commit()``, ``trans_rollback()``.
- Fixed a bug where :doc:`Database Transaction <database/transactions>` methods ``trans_begin()``, ``trans_commit()``, ``trans_rollback()`` ignored failures.
diff --git a/user_guide_src/source/conf.py b/user_guide_src/source/conf.py
index de55513bf..cd060ed67 100644
--- a/user_guide_src/source/conf.py
+++ b/user_guide_src/source/conf.py
@@ -41,7 +41,7 @@ master_doc = 'index'
# General information about the project.
project = u'CodeIgniter'
-copyright = u'2014 - 2015, British Columbia Institute of Technology'
+copyright = u'2014 - 2016, British Columbia Institute of Technology'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@@ -229,7 +229,7 @@ man_pages = [
epub_title = u'CodeIgniter'
epub_author = u'British Columbia Institute of Technology'
epub_publisher = u'British Columbia Institute of Technology'
-epub_copyright = u'2014 - 2015, British Columbia Institute of Technology'
+epub_copyright = u'2014 - 2016, British Columbia Institute of Technology'
# The language of the text. It defaults to the language option
# or en if the language is not set.
diff --git a/user_guide_src/source/contributing/index.rst b/user_guide_src/source/contributing/index.rst
index ef6f4aab4..da5bb527b 100644
--- a/user_guide_src/source/contributing/index.rst
+++ b/user_guide_src/source/contributing/index.rst
@@ -86,9 +86,9 @@ PHP Style
=========
All code must meet the `Style Guide
-<http://www.codeigniter.com/userguide3/general/styleguide.html>`_, which is
+<https://codeigniter.com/userguide3/general/styleguide.html>`_, which is
essentially the `Allman indent style
-<http://en.wikipedia.org/wiki/Indent_style#Allman_style>`_, underscores and
+<https://en.wikipedia.org/wiki/Indent_style#Allman_style>`_, underscores and
readable operators. This makes certain that all code is the same format as the
existing code and means it will be as readable as possible.
diff --git a/user_guide_src/source/database/db_driver_reference.rst b/user_guide_src/source/database/db_driver_reference.rst
index 8fc26c01b..75d1538bd 100644
--- a/user_guide_src/source/database/db_driver_reference.rst
+++ b/user_guide_src/source/database/db_driver_reference.rst
@@ -17,8 +17,8 @@ This article is intended to be a reference for them.
.. php:method:: initialize()
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
+ :rtype: void
+ :throws: RuntimeException In case of failure
Initialize database settings, establish a connection to
the database.
@@ -61,14 +61,6 @@ This article is intended to be a reference for them.
Select / switch the current database.
- .. php:method:: db_set_charset($charset)
-
- :param string $charset: Character set name
- :returns: TRUE on success, FALSE on failure
- :rtype: bool
-
- Set client character set.
-
.. php:method:: platform()
:returns: Platform name
@@ -83,7 +75,7 @@ This article is intended to be a reference for them.
Database version number.
- .. php:method:: query($sql[, $binds = FALSE[, $return_object = NULL]]])
+ .. php:method:: query($sql[, $binds = FALSE[, $return_object = NULL]])
:param string $sql: The SQL statement to execute
:param array $binds: An array of binding data
diff --git a/user_guide_src/source/general/routing.rst b/user_guide_src/source/general/routing.rst
index b2c9873ab..515368099 100644
--- a/user_guide_src/source/general/routing.rst
+++ b/user_guide_src/source/general/routing.rst
@@ -113,18 +113,19 @@ A typical RegEx route might look something like this::
In the above example, a URI similar to products/shirts/123 would instead
call the "shirts" controller class and the "id_123" method.
-With regular expressions, you can also catch a segment containing a
-forward slash ('/'), which would usually represent the delimiter between
-multiple segments.
-
+With regular expressions, you can also catch multiple segments at once.
For example, if a user accesses a password protected area of your web
application and you wish to be able to redirect them back to the same
page after they log in, you may find this example useful::
$route['login/(.+)'] = 'auth/login/$1';
+.. note:: In the above example, if the ``$1`` placeholder contains a
+ slash, it will still be split into multiple parameters when
+ passed to ``Auth::login()``.
+
For those of you who don't know regular expressions and want to learn
-more about them, `regular-expressions.info <http://www.regular-expressions.info/>`
+more about them, `regular-expressions.info <http://www.regular-expressions.info/>`_
might be a good starting point.
.. note:: You can also mix and match wildcards with regular expressions.
diff --git a/user_guide_src/source/helpers/cookie_helper.rst b/user_guide_src/source/helpers/cookie_helper.rst
index da26151cb..c9d2f419c 100644
--- a/user_guide_src/source/helpers/cookie_helper.rst
+++ b/user_guide_src/source/helpers/cookie_helper.rst
@@ -25,7 +25,7 @@ Available Functions
The following functions are available:
-.. php:function:: set_cookie($name[, $value = ''[, $expire = ''[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = FALSE[, $httponly = FALSE]]]]]]]])
+.. php:function:: set_cookie($name[, $value = ''[, $expire = ''[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = FALSE[, $httponly = FALSE]]]]]]])
:param mixed $name: Cookie name *or* associative array of all of the parameters available to this function
:param string $value: Cookie value
@@ -42,7 +42,7 @@ The following functions are available:
a description of its use, as this function is an alias for
``CI_Input::set_cookie()``.
-.. php:function:: get_cookie($index[, $xss_clean = NULL]])
+.. php:function:: get_cookie($index[, $xss_clean = NULL])
:param string $index: Cookie name
:param bool $xss_clean: Whether to apply XSS filtering to the returned value
@@ -56,7 +56,7 @@ The following functions are available:
the ``$config['cookie_prefix']`` that you might've set in your
*application/config/config.php* file.
-.. php:function:: delete_cookie($name[, $domain = ''[, $path = '/'[, $prefix = '']]]])
+.. php:function:: delete_cookie($name[, $domain = ''[, $path = '/'[, $prefix = '']]])
:param string $name: Cookie name
:param string $domain: Cookie domain (usually: .yourdomain.com)
diff --git a/user_guide_src/source/helpers/form_helper.rst b/user_guide_src/source/helpers/form_helper.rst
index d3ee3ffb6..bc30a0e98 100644
--- a/user_guide_src/source/helpers/form_helper.rst
+++ b/user_guide_src/source/helpers/form_helper.rst
@@ -108,7 +108,7 @@ The following functions are available:
<input type="hidden" name="member_id" value="234" />
-.. php:function:: form_open_multipart([$action = ''[, $attributes = array()[, $hidden = array()]])
+.. php:function:: form_open_multipart([$action = ''[, $attributes = array()[, $hidden = array()]]])
:param string $action: Form action/target URI string
:param array $attributes: HTML attributes
@@ -187,7 +187,7 @@ The following functions are available:
<input type="hidden" name="email" value="john@example.com" id="hiddenemail" class="hiddenemail" />
*/
-.. php:function:: form_input([$data = ''[, $value = ''[, $extra = '']])
+.. php:function:: form_input([$data = ''[, $value = ''[, $extra = '']]])
:param array $data: Field attributes data
:param string $value: Field value
@@ -461,12 +461,12 @@ The following functions are available:
fourth parameter::
$js = 'onClick="some_function()"';
- echo form_checkbox('newsletter', 'accept', TRUE, $js)
+ echo form_checkbox('newsletter', 'accept', TRUE, $js);
Or you can pass it as an array::
$js = array('onClick' => 'some_function();');
- echo form_checkbox('newsletter', 'accept', TRUE, $js)
+ echo form_checkbox('newsletter', 'accept', TRUE, $js);
.. php:function:: form_radio([$data = ''[, $value = ''[, $checked = FALSE[, $extra = '']]]])
diff --git a/user_guide_src/source/installation/upgrade_150.rst b/user_guide_src/source/installation/upgrade_150.rst
index bfe01ebba..50eb5eae5 100644
--- a/user_guide_src/source/installation/upgrade_150.rst
+++ b/user_guide_src/source/installation/upgrade_150.rst
@@ -49,8 +49,8 @@ Open your application/config/config.php file and ADD these new items::
| This item allows you to set the filename/classname prefix when extending
| native libraries. For more information please see the user guide:
|
- | http://codeigniter.com/user_guide/general/core_classes.html
- | http://codeigniter.com/user_guide/general/creating_libraries.html
+ | https://codeigniter.com/user_guide/general/core_classes.html
+ | https://codeigniter.com/user_guide/general/creating_libraries.html
|
*/
$config['subclass_prefix'] = 'MY_';
diff --git a/user_guide_src/source/installation/upgrade_300.rst b/user_guide_src/source/installation/upgrade_300.rst
index a29f400f8..45ce21320 100644
--- a/user_guide_src/source/installation/upgrade_300.rst
+++ b/user_guide_src/source/installation/upgrade_300.rst
@@ -855,7 +855,7 @@ It is now deprecated and scheduled for removal in CodeIgniter 3.1+.
sooner rather than later.
***********************************************************
-Step 20: Check your usage of Text helper highlight_phrase()
+Step 21: Check your usage of Text helper highlight_phrase()
***********************************************************
The default HTML tag used by :doc:`Text Helper <../helpers/text_helper>` function
diff --git a/user_guide_src/source/installation/upgrade_310.rst b/user_guide_src/source/installation/upgrade_310.rst
index 7060ebc4c..37772cd4f 100644
--- a/user_guide_src/source/installation/upgrade_310.rst
+++ b/user_guide_src/source/installation/upgrade_310.rst
@@ -12,3 +12,48 @@ Replace all files and directories in your *system/* directory.
.. note:: If you have any custom developed files in these directories,
please make copies of them first.
+
+Step 2: Change database connection handling
+===========================================
+
+"Loading" a database, whether by using the *config/autoload.php* settings
+or manually via calling ``$this->load->database()`` or the less-known
+``DB()`` function, will now throw a ``RuntimeException`` in case of a
+failure.
+
+In addition, being unable to set the configured character set is now also
+considered a connection failure.
+
+.. note:: This has been the case for most database drivers in the in the
+ past as well (i.e. all but the 'mysql', 'mysqli' and 'postgre'
+ drivers).
+
+What this means is that if you're unable to connect to a database, or
+have an erroneous character set configured, CodeIgniter will no longer
+fail silently, but will throw an exception instead.
+
+You may choose to explicitly catch it (and for that purpose you can't use
+*config/autoload.php* to load the :doc:`Database Class <../database/index>`)
+::
+
+ try
+ {
+ $this->load->database();
+ }
+ catch (RuntimeException $e)
+ {
+ // Handle the failure
+ }
+
+Or you may leave it to CodeIgniter's default exception handler, which would
+log the error message and display an error screen if you're running in
+development mode.
+
+Remove db_set_charset() calls
+-----------------------------
+
+With the above-mentioned changes, the purpose of the ``db_set_charset()``
+method would now only be to change the connection character set at runtime.
+That doesn't make sense and that's the reason why most database drivers
+don't support it at all.
+Thus, ``db_set_charset()`` is no longer necessary and is removed.
diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst
index c288cc8c0..9189d082e 100644
--- a/user_guide_src/source/libraries/form_validation.rst
+++ b/user_guide_src/source/libraries/form_validation.rst
@@ -116,7 +116,7 @@ this code and save it to your application/views/ folder::
The Controller
==============
-Using a text editor, create a controller called form.php. In it, place
+Using a text editor, create a controller called Form.php. In it, place
this code and save it to your application/controllers/ folder::
<?php
@@ -175,7 +175,7 @@ The form (myform.php) is a standard web form with a couple exceptions:
This function will return any error messages sent back by the
validator. If there are no messages it returns an empty string.
-The controller (form.php) has one method: ``index()``. This method
+The controller (Form.php) has one method: ``index()``. This method
initializes the validation class and loads the form helper and URL
helper used by your view files. It also runs the validation routine.
Based on whether the validation was successful it either presents the
@@ -205,7 +205,7 @@ The above method takes **three** parameters as input:
.. note:: If you would like the field name to be stored in a language
file, please see :ref:`translating-field-names`.
-Here is an example. In your controller (form.php), add this code just
+Here is an example. In your controller (Form.php), add this code just
below the validation initialization method::
$this->form_validation->set_rules('username', 'Username', 'required');
diff --git a/user_guide_src/source/libraries/image_lib.rst b/user_guide_src/source/libraries/image_lib.rst
index 40a280b5c..d5c24c1b0 100644
--- a/user_guide_src/source/libraries/image_lib.rst
+++ b/user_guide_src/source/libraries/image_lib.rst
@@ -471,4 +471,4 @@ Class Reference
Returns all detected errors formatted as a string.
::
- echo $this->image_lib->diplay_errors(); \ No newline at end of file
+ echo $this->image_lib->display_errors();
diff --git a/user_guide_src/source/libraries/trackback.rst b/user_guide_src/source/libraries/trackback.rst
index 4e0cb5541..bceb515f2 100644
--- a/user_guide_src/source/libraries/trackback.rst
+++ b/user_guide_src/source/libraries/trackback.rst
@@ -239,7 +239,7 @@ Class Reference
This method simply validates the incoming TB data, returning TRUE on success and FALSE on failure.
If the data is valid it is set to the ``$this->data`` array so that it can be inserted into a database.
- .. php:method:: send_error([$message = 'Incomplete information')
+ .. php:method:: send_error([$message = 'Incomplete information'])
:param string $message: Error message
:rtype: void
diff --git a/user_guide_src/source/license.rst b/user_guide_src/source/license.rst
index c1a32772f..3f7b2f58b 100644
--- a/user_guide_src/source/license.rst
+++ b/user_guide_src/source/license.rst
@@ -2,7 +2,7 @@
The MIT License (MIT)
#####################
-Copyright (c) 2014 - 2015, British Columbia Institute of Technology
+Copyright (c) 2014 - 2016, British Columbia Institute of Technology
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal