Skip to content

Commit 0bfaa0e

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.3
2 parents cf9b56d + 4e12a0e commit 0bfaa0e

9 files changed

Lines changed: 82 additions & 50 deletions

File tree

user_guide_src/source/installation/upgrade_404.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ Please refer to the upgrade instructions corresponding to your installation meth
1515
CodeIgniter 4.0.4 fixes a bug in the implementation of :doc:`Controller Filters </incoming/filters>`, breaking
1616
code implementing the ``FilterInterface``.
1717

18-
**Update FilterInterface declarations**
18+
Breaking Changes
19+
****************
20+
21+
Update FilterInterface Declarations
22+
===================================
1923

2024
The method signatures for ``after()`` and ``before()`` must be updated to include ``$arguments``. The function
2125
definitions should be changed from::

user_guide_src/source/installation/upgrade_405.rst

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,23 @@ Please refer to the upgrade instructions corresponding to your installation meth
1212
:local:
1313
:depth: 2
1414

15-
**Cookie SameSite support**
15+
Breaking Enhancements
16+
*********************
17+
18+
Cookie SameSite Support
19+
=======================
1620

1721
CodeIgniter 4.0.5 introduces a setting for the cookie SameSite attribute. Prior versions did not set this
1822
attribute at all. The default setting for cookies is now `Lax`. This will affect how cookies are handled in
19-
cross-domain contexts and you may need to adjust this setting in your projects. Separate settings in `app/Config/App.php`
23+
cross-domain contexts and you may need to adjust this setting in your projects. Separate settings in **app/Config/App.php**
2024
exists for Response cookies and for CSRF cookies.
2125

2226
For additional information, see `MDN Web Docs <https://developer.mozilla.org/pl/docs/Web/HTTP/Headers/Set-Cookie/SameSite>`_.
2327
The SameSite specifications are described in `RFC 6265 <https://tools.ietf.org/html/rfc6265>`_
2428
and the `RFC 6265bis revision <https://datatracker.ietf.org/doc/draft-ietf-httpbis-rfc6265bis/?include_text=1>`_.
2529

26-
**Message::getHeader(s)**
30+
Message::getHeader(s)
31+
=====================
2732

2833
The HTTP layer is moving towards `PSR-7 compliance <https://www.php-fig.org/psr/psr-7/>`_. Towards this end
2934
``Message::getHeader()`` and ``Message::getHeaders()`` are deprecated and should be replaced
@@ -32,49 +37,51 @@ to all classes that extend ``Message`` as well: ``Request``, ``Response`` and th
3237

3338
Additional related deprecations from the HTTP layer:
3439

35-
* ``Message::isJSON``: Check the "Content-Type" header directly
36-
* ``Request[Interface]::isValidIP``: Use the Validation class with ``valid_ip``
40+
* ``Message::isJSON()``: Check the "Content-Type" header directly
41+
* ``Request[Interface]::isValidIP()``: Use the Validation class with ``valid_ip``
3742
* ``Request[Interface]::getMethod()``: The ``$upper`` parameter will be removed, use str_to_upper()
3843
* ``Request[Trait]::$ipAddress``: This property will become private
3944
* ``Request::$proxyIPs``: This property will be removed; access ``config('App')->proxyIPs`` directly
4045
* ``Request::__construct()``: The constructor will no longer take ``Config\App`` and has been made nullable to aid transition
4146
* ``Response[Interface]::getReason()``: Use ``getReasonPhrase()`` instead
4247
* ``Response[Interface]::getStatusCode()``: The explicit ``int`` return type will be removed (no action required)
4348

44-
**ResponseInterface**
49+
ResponseInterface
50+
=================
4551

4652
This interface intends to include the necessary methods for any framework-compatible response class.
47-
A number of methods expected by the framework were missing and have noe been added. If you use any
53+
A number of methods expected by the framework were missing and have now been added. If you use any
4854
classes the implement ``ResponseInterface`` directly they will need to be compatible with the
4955
updated requirements. These methods are as follows:
5056

51-
* ``setLastModified($date);``
52-
* ``setLink(PagerInterface $pager);``
53-
* ``setJSON($body, bool $unencoded = false);``
54-
* ``getJSON();``
55-
* ``setXML($body);``
56-
* ``getXML();``
57-
* ``send();``
58-
* ``sendHeaders();``
59-
* ``sendBody();``
60-
* ``setCookie($name, $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = false, $httponly = false, $samesite = null);``
61-
* ``hasCookie(string $name, string $value = null, string $prefix = ''): bool;``
62-
* ``getCookie(string $name = null, string $prefix = '');``
63-
* ``deleteCookie(string $name = '', string $domain = '', string $path = '/', string $prefix = '');``
64-
* ``getCookies();``
65-
* ``redirect(string $uri, string $method = 'auto', int $code = null);``
66-
* ``download(string $filename = '', $data = '', bool $setMime = false);``
57+
* ``setLastModified($date)``
58+
* ``setLink(PagerInterface $pager)``
59+
* ``setJSON($body, bool $unencoded = false)``
60+
* ``getJSON()``
61+
* ``setXML($body)``
62+
* ``getXML()``
63+
* ``send()``
64+
* ``sendHeaders()``
65+
* ``sendBody()``
66+
* ``setCookie($name, $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = false, $httponly = false, $samesite = null)``
67+
* ``hasCookie(string $name, string $value = null, string $prefix = ''): bool``
68+
* ``getCookie(string $name = null, string $prefix = '')``
69+
* ``deleteCookie(string $name = '', string $domain = '', string $path = '/', string $prefix = '')``
70+
* ``getCookies()``
71+
* ``redirect(string $uri, string $method = 'auto', int $code = null)``
72+
* ``download(string $filename = '', $data = '', bool $setMime = false)``
6773

6874
To facilitate use of this interface these methods have been moved from the framework's ``Response`` into a ``ResponseTrait``
6975
which you may use, and ``DownloadResponse`` now extends ``Response`` directly to ensure maximum compatibility.
7076

71-
**Config\Services**
77+
Config\\Services
78+
================
7279

7380
Service discovery has been updated to allow third-party services (when enabled via Modules) to take precedence over core services. Update
7481
**app/Config/Services.php** so the class extends ``CodeIgniter\Config\BaseService`` to allow proper discovery of third-party services.
7582

7683
Project Files
77-
=============
84+
*************
7885

7986
Numerous files in the project space (root, app, public, writable) received updates. Due to
8087
these files being outside of the system scope they will not be changed without your intervention.
@@ -86,7 +93,7 @@ the project space: `Explore on Packagist <https://packagist.org/explore/?query=c
8693
and any mandatory changes will be covered in the sections above.
8794

8895
Content Changes
89-
---------------
96+
===============
9097

9198
The following files received significant changes (including deprecations or visual adjustments)
9299
and it is recommended that you merge the updated versions with your application:
@@ -99,7 +106,7 @@ and it is recommended that you merge the updated versions with your application:
99106
* ``composer.json``
100107

101108
All Changes
102-
-----------
109+
===========
103110

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

user_guide_src/source/installation/upgrade_410.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Please refer to the upgrade instructions corresponding to your installation meth
1515
Breaking Changes
1616
****************
1717

18-
**Legacy Autoloading**
18+
Legacy Autoloading
19+
==================
1920

2021
``Autoloader::loadLegacy()`` method was originally for transition to CodeIgniter v4. Since v4.1.0,
2122
this support was removed. All classes must be namespaced.

user_guide_src/source/installation/upgrade_412.rst

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,20 @@ Please refer to the upgrade instructions corresponding to your installation meth
1212
:local:
1313
:depth: 2
1414

15-
**current_url() and indexPage**
15+
Breaking Changes
16+
****************
17+
18+
current_url() and indexPage
19+
===========================
1620

1721
Due to `a bug <https://github.com/codeigniter4/CodeIgniter4/issues/4116>`_ in ``current_url()``,
1822
the resulting URIs could be incorrect for a project's configuration, most importantly: ``indexPage``
1923
would *not* be included. Projects using ``App::$indexPage`` should expect altered values from
2024
``current_url()`` and all its dependencies (including Response Testing, Pager, Form Helper, Pager,
2125
and View Parser). Update your projects accordingly.
2226

23-
**Cache Keys**
27+
Cache Keys
28+
==========
2429

2530
Cache handlers had wildly different compatibility for keys. The updated cache drivers now pass
2631
all keys through validation, roughly matching PSR-6's recommendations:
@@ -35,22 +40,28 @@ all keys through validation, roughly matching PSR-6's recommendations:
3540

3641
Update your projects to remove any invalid cache keys.
3742

38-
**BaseConnection::query() return values**
43+
BaseConnection::query() Return Values
44+
=====================================
3945

4046
``BaseConnection::query()`` method in prior versions was incorrectly returning BaseResult objects
4147
even if the query failed. This method will now return ``false`` for failed queries (or throw an
42-
Exception if ``DBDebug==true``) and will return booleans for write-type queries. Review any use
48+
Exception if ``DBDebug`` is ``true``) and will return booleans for write-type queries. Review any use
4349
of ``query()`` method and be assess whether the value might be boolean instead of Result object.
4450
For a better idea of what queries are write-type queries, check ``BaseConnection::isWriteType()``
4551
and any DBMS-specific override ``isWriteType()`` in the relevant Connection class.
4652

47-
**ConnectionInterface::isWriteType() declaration added**
53+
Breaking Enhancements
54+
*********************
55+
56+
ConnectionInterface::isWriteType() Declaration Added
57+
====================================================
4858

4959
If you have written any classes that implement ConnectionInterface, these must now implement the
5060
``isWriteType()`` method, declared as ``public function isWriteType($sql): bool``. If your class extends BaseConnection, then that class will provide a basic ``isWriteType()``
5161
method which you might want to override.
5262

53-
**Test Traits**
63+
Test Traits
64+
===========
5465

5566
The ``CodeIgniter\Test`` namespace has had significant improvements to help developers with their
5667
own test cases. Most notably test extensions have moved to Traits to make them easier to
@@ -68,7 +79,8 @@ and use any traits you need. For example:
6879
Finally, ``ControllerTester`` has been superseded by ``ControllerTestTrait`` to standardize
6980
approach and take advantage of the updated response testing (below).
7081

71-
**Test Responses**
82+
Test Responses
83+
==============
7284

7385
The tools for testing responses have been consolidated and improved. A new
7486
``TestResponse`` replaces ``ControllerResponse`` and ``FeatureResponse`` with a complete
@@ -80,7 +92,7 @@ changes to be aware of:
8092
* ``TestResponse`` does not have ``getBody()`` and ``setBody()`` methods, but rather uses the Response methods directly, e.g.: ``$body = $result->response()->getBody();``
8193

8294
Project Files
83-
=============
95+
*************
8496

8597
Numerous files in the project space (root, app, public, writable) received updates. Due to
8698
these files being outside of the system scope they will not be changed without your intervention.
@@ -92,7 +104,7 @@ the project space: `Explore on Packagist <https://packagist.org/explore/?query=c
92104
and any mandatory changes will be covered in the sections above.
93105

94106
Content Changes
95-
---------------
107+
===============
96108

97109
The following files received significant changes (including deprecations or visual adjustments)
98110
and it is recommended that you merge the updated versions with your application:
@@ -108,7 +120,7 @@ and it is recommended that you merge the updated versions with your application:
108120
* ``spark``
109121

110122
All Changes
111-
-----------
123+
===========
112124

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

user_guide_src/source/installation/upgrade_413.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@ Please refer to the upgrade instructions corresponding to your installation meth
1212
:local:
1313
:depth: 2
1414

15-
**Cache TTL**
15+
Breaking Enhancements
16+
*********************
17+
18+
Cache TTL
19+
=========
1620

1721
There is a new value in **app/Config/Cache.php**: ``$ttl``. This is not used by framework
1822
handlers where 60 seconds is hard-coded, but may be useful to projects and modules.
1923
In a future release this value will replace the hard-coded version, so either leave this as
2024
``60`` or stop relying on the hard-coded version.
2125

2226
Project Files
23-
=============
27+
*************
2428

2529
Only a few files in the project space (root, app, public, writable) received updates. Due to
2630
these files being outside of the system scope they will not be changed without your intervention.

user_guide_src/source/installation/upgrade_414.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ Please refer to the upgrade instructions corresponding to your installation meth
1515
This release focuses on code style. All changes (except those noted below) are cosmetic to bring the code in line with the new
1616
`CodeIgniter Coding Standard <https://github.com/CodeIgniter/coding-standard>`_ (based on PSR-12).
1717

18-
**Method Scope**
18+
Breaking Changes
19+
****************
1920

20-
The following methods were changed from "public" to "protected" to match their parent class methods and better align with their uses.
21+
Method Scope
22+
============
23+
24+
The following methods were changed from ``public`` to ``protected`` to match their parent class methods and better align with their uses.
2125
If you relied on any of these methods being public (highly unlikely) adjust your code accordingly:
2226

2327
* ``CodeIgniter\Database\MySQLi\Connection::execute()``
@@ -45,7 +49,7 @@ If you relied on any of these methods being public (highly unlikely) adjust your
4549
* ``CodeIgniter\Test\Mock\MockSecurity.php::sendCookie()``
4650

4751
Project Files
48-
=============
52+
*************
4953

5054
All files in the project space were reformatted with the new coding style. This will not affect
5155
existing code but you may want to apply the updated coding style to your own projects to keep

user_guide_src/source/installation/upgrade_415.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ and modified the ``set()`` method, then you need to change its definition from
2424
``public function set($key, ?string $value = '', ?bool $escape = null)`` to
2525
``public function set($key, $value = '', ?bool $escape = null)``.
2626

27-
Session DatabaseHandler's database table change
27+
Session DatabaseHandler's Database Table Change
2828
-----------------------------------------------
2929

3030
The types of the following columns in the session table have been changed for optimization.
@@ -60,15 +60,15 @@ Protecting **GET** method needs only when you use ``form_open()`` auto-generatio
6060
because :ref:`auto-routing-legacy` permits any HTTP method to access a controller.
6161
Accessing the controller with a method you don't expect could bypass the filter.
6262

63-
CURLRequest header change
63+
CURLRequest Header Change
6464
-------------------------
6565

6666
In the previous version, if you didn't provide your own headers, ``CURLRequest`` would send the request-headers from the browser.
6767
The bug was fixed. If your requests depend on the headers, your requests might fail after upgrading.
6868
In this case, add the necessary headers manually.
6969
See :ref:`CURLRequest Class <curlrequest-request-options-headers>` for how to add.
7070

71-
Query Builder changes
71+
Query Builder Changes
7272
---------------------
7373

7474
For optimization and a bug fix, the following behaviors, mostly used in testing, have been changed.
@@ -81,7 +81,7 @@ Breaking Enhancements
8181

8282
.. _upgrade-415-multiple-filters-for-a-route:
8383

84-
Multiple filters for a route
84+
Multiple Filters for a Route
8585
----------------------------
8686

8787
A new feature to set multiple filters for a route.

user_guide_src/source/installation/upgrade_416.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Please refer to the upgrade instructions corresponding to your installation meth
1515
Breaking Changes
1616
****************
1717

18-
Validation result changes
18+
Validation Result Changes
1919
=========================
2020

2121
Due to a bug fix, the Validation now might change the validation results when you validate an array item (see :ref:`Changelog <changelog-v416-validation-changes>`). So check the validation results for all the code that validates the array. Validating multiple fields like ``contacts.*.name`` is not affected.

user_guide_src/source/installation/upgrade_418.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ Please refer to the upgrade instructions corresponding to your installation meth
1515
Breaking Changes
1616
****************
1717

18-
- Due to a security issue in the ``API\ResponseTrait`` all trait methods are now scoped to ``protected``. See the `Security advisory` <https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-7528-7jg5-6g62>` for more information.
18+
- Due to a security issue in the ``API\ResponseTrait`` all trait methods are now scoped to ``protected``. See the `Security advisory GHSA-7528-7jg5-6g62 <https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-7528-7jg5-6g62>`_ for more information.

0 commit comments

Comments
 (0)