Skip to content

docs: improve upgrade_430 and changelog #6906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions contributing/pull_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,14 @@ all changes will need an entry in it, but the following items should.

#### Upgrading Guide

If your PR requires users to do something when they upgrade CodeIgniter, the
[Upgrading Guide](https://codeigniter4.github.io/CodeIgniter4/installation/upgrading.html) is also needed.

Add an instruction what to do.
If your PR requires users to do something when they upgrade CodeIgniter, or
changes the Config values,
the [Upgrading Guide](https://codeigniter4.github.io/CodeIgniter4/installation/upgrading.html)
is also needed.

- Add an instruction what to do when upgrading.
- If you add new properties or changes default values in Config files, add the
changes in *"Project Files > Content Changes > Config"*.

### CSS

Expand Down
27 changes: 19 additions & 8 deletions user_guide_src/source/changelogs/v4.3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ Exceptions when Database Errors Occur

- The exceptions thrown by the database connection classes have been changed to ``CodeIgniter\Database\Exceptions\DatabaseException``. Previously, different database drivers threw different exception classes, but these have been unified into ``DatabaseException``.
- The exceptions thrown by the ``execute()`` method of Prepared Queries have been changed to ``DatabaseException``. Previously, different database drivers might throw different exception classes or did not throw exceptions, but these have been unified into ``DatabaseException``.
- ``DBDebug`` and ``CI_DEBUG``

- To be consistent in behavior regardless of environments, ``Config\Database::$default['DBDebug']``
and ``Config\Database::$tests['DBDebug']`` has been changed to ``true`` by default. With these
settings, an exception is always thrown when a database error occurs.
- Now ``DatabaseException`` thrown in ``BaseBuilder`` is thrown if ``$DBDebug`` is true.
Previously, it is thrown if ``CI_DEBUG`` is true.
- The default value of ``BaseConnection::$DBDebug`` has been changed to ``true``.
- With these changes, ``DBDebug`` **now means whether or not to throw an exception when an error occurs**.
Although unrelated to debugging, the name has not been changed.
- Now when you delete without WHERE clause in ``Model``, ``DatabaseException`` is thrown even if
``CI_DEBUG`` is false. Previously, it is thrown if ``CI_DEBUG`` is true.

HTTP Status Code and Exit Code when Exception Occurs
----------------------------------------------------
Expand All @@ -48,6 +60,7 @@ Time
----

The following methods of the :doc:`Time <../libraries/time>` class had bugs that changed the state of the current object. To fix these bugs, the Time class has been fixed:

- ``add()``
- ``modify()``
- ``setDate()``
Expand Down Expand Up @@ -113,6 +126,7 @@ ValidationInterface

- The third parameter ``$dbGroup`` for ``ValidationInterface::run()`` has been added.
- The following methods are added to the interface:

- ``ValidationInterface::setRule()``
- ``ValidationInterface::getRules()``
- ``ValidationInterface::getRuleGroup()``
Expand Down Expand Up @@ -148,8 +162,10 @@ Database Forge
- The method signature of ``Forge::addPrimaryKey()`` has changed. An additional optional parameter ``$keyName`` has been added.
- The method signature of ``Forge::addUniqueKey()`` has changed. An additional optional parameter ``$keyName`` has been added.
- The following method has an additional ``$asQuery`` parameter. When set to ``true`` the method returns a stand alone SQL query.

- ``CodeIgniter\Database\Forge::_processPrimaryKeys()``
- In addition to the added ``$asQuery`` parameter above the following methods also now return an array.

- ``CodeIgniter\Database\Forge::_processIndexes()``
- ``CodeIgniter\Database\Forge::_processForeignKeys()``

Expand All @@ -158,6 +174,7 @@ Others

- **API:** The return type of ``API\ResponseTrait::failServerError()`` has been changed to ``ResponseInterface``.
- The following methods have been changed to accept ``ResponseInterface`` as a parameter instead of ``Response``.

- ``Debug\Exceptions::__construct()``
- ``Services::exceptions()``

Expand Down Expand Up @@ -247,6 +264,8 @@ Error Handling
- To *temporarily* enable throwing of deprecations, set the environment variable ``CODEIGNITER_SCREAM_DEPRECATIONS`` to a truthy value.
- ``Config\Logger::$threshold`` is now, by default, environment-specific. For production environment, default threshold is still ``4`` but changed to ``9`` for other environments.

.. _v430-multiple-domain-support:

Multiple Domain Support
=======================

Expand Down Expand Up @@ -274,14 +293,6 @@ Changes

- Config
- All atomic type properties in ``Config`` classes have been typed.
- Changed the default setting to not redirect when a CSRF check fails so that it is easy to see that it is a CSRF error.
- The default ``Config\App::$appTimezone`` has been changed to ``UTC`` to avoid being affected by daylight saving time.
- DBDebug and CI_DEBUG
- To be consistent in behavior regardless of environments, ``Config\Database::$default['DBDebug']`` and ``Config\Database::$tests['DBDebug']`` has been changed to ``true`` by default. With these settings, an exception is always thrown when a database error occurs.
- Now ``DatabaseException`` thrown in ``BaseBuilder`` is thrown if ``$DBDebug`` is true. Previously, it is thrown if ``CI_DEBUG`` is true.
- The default value of ``BaseConnection::$DBDebug`` has been changed to ``true``.
- With these changes, ``DBDebug`` now means whether or not to throw an exception when an error occurs. Although unrelated to debugging, the name has not been changed.
- Now when you delete without WHERE clause in ``Model``, ``DatabaseException`` is thrown even if ``CI_DEBUG`` is false. Previously, it is thrown if ``CI_DEBUG`` is true.
- Changed the processing of Spark commands:
- The ``CodeIgniter\CodeIgniter`` no longer handles Spark commands.
- The ``CodeIgniter::isSparked()`` method has been removed.
Expand Down
60 changes: 44 additions & 16 deletions user_guide_src/source/installation/upgrade_430.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spark
The following files received significant changes and
**you must merge the updated versions** with your application:

* ``spark``
- ``spark``

.. important:: If you do not update this file, Spark commands will not work at all after running ``composer update``.

Expand All @@ -45,6 +45,14 @@ Config Files
Breaking Changes
****************

Database Exception Changes
==========================

- The exception classes may be changed when database errors occur. If you catch the exceptions,
you must confirm that your code can catch the exceptions.
- Now a few exceptions will be thrown even if ``CI_DEBUG`` is false.
- See :ref:`exceptions-when-database-errors-occur` for details.

HTTP Status Code and Exit Code of Uncaught Exceptions
=====================================================

Expand Down Expand Up @@ -186,11 +194,6 @@ The data returned has the following structure::
* ]
*/

Others
======

- The exception classes may be changed when database errors occur. If you catch the exceptions, you must confirm that your code can catch the exceptions. See :ref:`exceptions-when-database-errors-occur` for details.

Breaking Enhancements
*********************

Expand Down Expand Up @@ -228,20 +231,45 @@ Content Changes
The following files received significant changes (including deprecations or visual adjustments)
and it is recommended that you merge the updated versions with your application:

* ``app/Config/DocTypes.php``
* The property ``$html5`` to determine whether to remove the solidus (``/``) character for void HTML elements (e.g. ``<input>``) is added, and set to ``true`` by default for HTML5 compatibility.
* ``app/Config/Exceptions.php``
* Two additional public properties were added: ``$logDeprecations`` and ``$deprecationLogLevel``.
* ``app/Config/Routes.php``
* Due to the fact that the approach to running Spark Commands has changed, there is no longer a need to load the internal routes of the framework.
Config
------

- app/Config/App.php
- The new property ``$allowedHostnames`` is added to set allowed hostnames in the site URL
other than the hostname in the ``$baseURL``. See :ref:`v430-multiple-domain-support`.
- The property ``$appTimezone`` has been changed to ``UTC`` to avoid being affected
by daylight saving time.
- app/Config/Autoload.php
- The new property ``$helpers`` is added to autoload helpers.
- app/Config/Database.php
- ``$default['DBDebug']`` and ``$test['DBDebug']`` are changed to ``true`` by default.
See :ref:`exceptions-when-database-errors-occur`.
- app/Config/DocTypes.php
- The property ``$html5`` to determine whether to remove the solidus (``/``) character for void HTML
elements (e.g. ``<input>``) is added, and set to ``true`` by default for HTML5 compatibility.
- app/Config/Encryption.php
- The new property ``$rawData``, ``$encryptKeyInfo``, and ``$authKeyInfo`` are added for for CI3
Encryption compatibility. See :ref:`encryption-compatible-with-ci3`.
- app/Config/Exceptions.php
- Two additional public properties were added: ``$logDeprecations`` and ``$deprecationLogLevel``.
See See :ref:`logging_deprecation_warnings` for details.
- app/Config/Modules.php
- The new property ``$composerPackages`` is added to limit Composer package Auto-Discovery for better
performance.
- app/Config/Routes.php
- Due to the fact that the approach to running Spark Commands has changed, there is no longer a need
to load the internal routes of the framework (``SYSTEMPATH . 'Config/Routes.php'``).
- app/Config/Security.php
- Changed the value of the property ``$redirect`` to ``false`` to prevent redirection when a CSRF
check fails. This is to make it easier to recognize that it is a CSRF error.

All Changes
===========

This is a list of all files in the **project space** that received changes;
many will be simple comments or formatting that have no effect on the runtime:

* app/Config/DocTypes.php
* app/Config/Exceptions.php
* app/Config/Routes.php
* spark
- app/Config/DocTypes.php
- app/Config/Exceptions.php
- app/Config/Routes.php
- spark