Skip to content

Commit 977c97b

Browse files
authored
Merge pull request #6906 from kenjis/fix-docs-upgrade_430-config
docs: improve upgrade_430 and changelog
2 parents 9c978b5 + 43174e4 commit 977c97b

File tree

3 files changed

+71
-28
lines changed

3 files changed

+71
-28
lines changed

contributing/pull_request.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,14 @@ all changes will need an entry in it, but the following items should.
121121

122122
#### Upgrading Guide
123123

124-
If your PR requires users to do something when they upgrade CodeIgniter, the
125-
[Upgrading Guide](https://codeigniter4.github.io/CodeIgniter4/installation/upgrading.html) is also needed.
126-
127-
Add an instruction what to do.
124+
If your PR requires users to do something when they upgrade CodeIgniter, or
125+
changes the Config values,
126+
the [Upgrading Guide](https://codeigniter4.github.io/CodeIgniter4/installation/upgrading.html)
127+
is also needed.
128+
129+
- Add an instruction what to do when upgrading.
130+
- If you add new properties or changes default values in Config files, add the
131+
changes in *"Project Files > Content Changes > Config"*.
128132

129133
### CSS
130134

user_guide_src/source/changelogs/v4.3.0.rst

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ Exceptions when Database Errors Occur
2727

2828
- 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``.
2929
- 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``.
30+
- ``DBDebug`` and ``CI_DEBUG``
31+
32+
- To be consistent in behavior regardless of environments, ``Config\Database::$default['DBDebug']``
33+
and ``Config\Database::$tests['DBDebug']`` has been changed to ``true`` by default. With these
34+
settings, an exception is always thrown when a database error occurs.
35+
- Now ``DatabaseException`` thrown in ``BaseBuilder`` is thrown if ``$DBDebug`` is true.
36+
Previously, it is thrown if ``CI_DEBUG`` is true.
37+
- The default value of ``BaseConnection::$DBDebug`` has been changed to ``true``.
38+
- With these changes, ``DBDebug`` **now means whether or not to throw an exception when an error occurs**.
39+
Although unrelated to debugging, the name has not been changed.
40+
- Now when you delete without WHERE clause in ``Model``, ``DatabaseException`` is thrown even if
41+
``CI_DEBUG`` is false. Previously, it is thrown if ``CI_DEBUG`` is true.
3042

3143
HTTP Status Code and Exit Code when Exception Occurs
3244
----------------------------------------------------
@@ -48,6 +60,7 @@ Time
4860
----
4961

5062
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:
63+
5164
- ``add()``
5265
- ``modify()``
5366
- ``setDate()``
@@ -113,6 +126,7 @@ ValidationInterface
113126

114127
- The third parameter ``$dbGroup`` for ``ValidationInterface::run()`` has been added.
115128
- The following methods are added to the interface:
129+
116130
- ``ValidationInterface::setRule()``
117131
- ``ValidationInterface::getRules()``
118132
- ``ValidationInterface::getRuleGroup()``
@@ -148,8 +162,10 @@ Database Forge
148162
- The method signature of ``Forge::addPrimaryKey()`` has changed. An additional optional parameter ``$keyName`` has been added.
149163
- The method signature of ``Forge::addUniqueKey()`` has changed. An additional optional parameter ``$keyName`` has been added.
150164
- The following method has an additional ``$asQuery`` parameter. When set to ``true`` the method returns a stand alone SQL query.
165+
151166
- ``CodeIgniter\Database\Forge::_processPrimaryKeys()``
152167
- In addition to the added ``$asQuery`` parameter above the following methods also now return an array.
168+
153169
- ``CodeIgniter\Database\Forge::_processIndexes()``
154170
- ``CodeIgniter\Database\Forge::_processForeignKeys()``
155171

@@ -158,6 +174,7 @@ Others
158174

159175
- **API:** The return type of ``API\ResponseTrait::failServerError()`` has been changed to ``ResponseInterface``.
160176
- The following methods have been changed to accept ``ResponseInterface`` as a parameter instead of ``Response``.
177+
161178
- ``Debug\Exceptions::__construct()``
162179
- ``Services::exceptions()``
163180

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

267+
.. _v430-multiple-domain-support:
268+
250269
Multiple Domain Support
251270
=======================
252271

@@ -274,14 +293,6 @@ Changes
274293

275294
- Config
276295
- All atomic type properties in ``Config`` classes have been typed.
277-
- 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.
278-
- The default ``Config\App::$appTimezone`` has been changed to ``UTC`` to avoid being affected by daylight saving time.
279-
- DBDebug and CI_DEBUG
280-
- 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.
281-
- Now ``DatabaseException`` thrown in ``BaseBuilder`` is thrown if ``$DBDebug`` is true. Previously, it is thrown if ``CI_DEBUG`` is true.
282-
- The default value of ``BaseConnection::$DBDebug`` has been changed to ``true``.
283-
- 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.
284-
- 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.
285296
- Changed the processing of Spark commands:
286297
- The ``CodeIgniter\CodeIgniter`` no longer handles Spark commands.
287298
- The ``CodeIgniter::isSparked()`` method has been removed.

user_guide_src/source/installation/upgrade_430.rst

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ spark
2121
The following files received significant changes and
2222
**you must merge the updated versions** with your application:
2323

24-
* ``spark``
24+
- ``spark``
2525

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

@@ -45,6 +45,14 @@ Config Files
4545
Breaking Changes
4646
****************
4747

48+
Database Exception Changes
49+
==========================
50+
51+
- The exception classes may be changed when database errors occur. If you catch the exceptions,
52+
you must confirm that your code can catch the exceptions.
53+
- Now a few exceptions will be thrown even if ``CI_DEBUG`` is false.
54+
- See :ref:`exceptions-when-database-errors-occur` for details.
55+
4856
HTTP Status Code and Exit Code of Uncaught Exceptions
4957
=====================================================
5058

@@ -186,11 +194,6 @@ The data returned has the following structure::
186194
* ]
187195
*/
188196

189-
Others
190-
======
191-
192-
- 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.
193-
194197
Breaking Enhancements
195198
*********************
196199

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

231-
* ``app/Config/DocTypes.php``
232-
* 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.
233-
* ``app/Config/Exceptions.php``
234-
* Two additional public properties were added: ``$logDeprecations`` and ``$deprecationLogLevel``.
235-
* ``app/Config/Routes.php``
236-
* 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.
234+
Config
235+
------
236+
237+
- app/Config/App.php
238+
- The new property ``$allowedHostnames`` is added to set allowed hostnames in the site URL
239+
other than the hostname in the ``$baseURL``. See :ref:`v430-multiple-domain-support`.
240+
- The property ``$appTimezone`` has been changed to ``UTC`` to avoid being affected
241+
by daylight saving time.
242+
- app/Config/Autoload.php
243+
- The new property ``$helpers`` is added to autoload helpers.
244+
- app/Config/Database.php
245+
- ``$default['DBDebug']`` and ``$test['DBDebug']`` are changed to ``true`` by default.
246+
See :ref:`exceptions-when-database-errors-occur`.
247+
- app/Config/DocTypes.php
248+
- The property ``$html5`` to determine whether to remove the solidus (``/``) character for void HTML
249+
elements (e.g. ``<input>``) is added, and set to ``true`` by default for HTML5 compatibility.
250+
- app/Config/Encryption.php
251+
- The new property ``$rawData``, ``$encryptKeyInfo``, and ``$authKeyInfo`` are added for for CI3
252+
Encryption compatibility. See :ref:`encryption-compatible-with-ci3`.
253+
- app/Config/Exceptions.php
254+
- Two additional public properties were added: ``$logDeprecations`` and ``$deprecationLogLevel``.
255+
See See :ref:`logging_deprecation_warnings` for details.
256+
- app/Config/Modules.php
257+
- The new property ``$composerPackages`` is added to limit Composer package Auto-Discovery for better
258+
performance.
259+
- app/Config/Routes.php
260+
- Due to the fact that the approach to running Spark Commands has changed, there is no longer a need
261+
to load the internal routes of the framework (``SYSTEMPATH . 'Config/Routes.php'``).
262+
- app/Config/Security.php
263+
- Changed the value of the property ``$redirect`` to ``false`` to prevent redirection when a CSRF
264+
check fails. This is to make it easier to recognize that it is a CSRF error.
237265

238266
All Changes
239267
===========
240268

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

244-
* app/Config/DocTypes.php
245-
* app/Config/Exceptions.php
246-
* app/Config/Routes.php
247-
* spark
272+
- app/Config/DocTypes.php
273+
- app/Config/Exceptions.php
274+
- app/Config/Routes.php
275+
- spark

0 commit comments

Comments
 (0)