You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: user_guide_src/source/changelogs/v4.8.0.rst
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,20 +24,20 @@ Behavior Changes
24
24
================
25
25
26
26
- The static ``Boot::initializeConsole()`` method no longer handles the display of the console header. This is now handled within ``Console::run()``.
27
-
If you have overridden ``Boot::initializeConsole()``, you should remove any code related to displaying the console header, as this is now the responsibility of the ``Console`` class.
27
+
If you have overridden ``Boot::initializeConsole()``, you should remove any code related to displaying the console header, as this is now the responsibility of the ``Console`` class.
28
28
- **Commands:** The ``filter:check`` command now requires the HTTP method argument to be uppercase (e.g., ``spark filter:check GET /`` instead of ``spark filter:check get /``).
29
29
- **Database:** The Postgre driver's ``$db->error()['code']`` previously always returned ``''``. It now returns the 5-character SQLSTATE string for query and transaction failures (e.g., ``'42P01'``), or ``'08006'`` for connection-level failures. Code that relied on ``$db->error()['code'] === ''`` will need updating.
30
30
- **Filters:** HTTP method matching for method-based filters is now case-sensitive. The keys in ``Config\Filters::$methods`` must exactly match the request method
31
-
(e.g., ``GET``, ``POST``). Lowercase method names (e.g., ``post``) will no longer match.
31
+
(e.g., ``GET``, ``POST``). Lowercase method names (e.g., ``post``) will no longer match.
32
32
- **Testing:** Tests using the ``FeatureTestTrait`` must now use uppercase HTTP method names when performing a request when using the ``call()`` method directly
33
-
(e.g., ``$this->call('GET', '/path')`` instead of ``$this->call('get', '/path')``). Additionally, setting method-based routes using ``withRoutes()`` must
34
-
also use uppercase method names (e.g., ``$this->withRoutes([['GET', 'home', 'Home::index']])``).
33
+
(e.g., ``$this->call('GET', '/path')`` instead of ``$this->call('get', '/path')``). Additionally, setting method-based routes using ``withRoutes()`` must
34
+
also use uppercase method names (e.g., ``$this->withRoutes([['GET', 'home', 'Home::index']])``).
35
35
36
36
Interface Changes
37
37
=================
38
38
39
39
**NOTE:** If you've implemented your own classes that implement these interfaces from scratch, you will need to
40
-
update your implementations to include the new methods or method changes to ensure compatibility.
40
+
update your implementations to include the new methods or method changes to ensure compatibility.
41
41
42
42
- **Logging:** ``CodeIgniter\Log\Handlers\HandlerInterface::handle()`` now requires a third parameter ``array $context = []``. Any custom log handler that overrides ``handle()`` - whether implementing ``HandlerInterface`` directly or extending a built-in handler class - must add the parameter to its ``handle()`` method signature.
43
43
- **Security:** The ``SecurityInterface``'s ``verify()`` method now has a native return type of ``static``.
@@ -48,11 +48,11 @@ Method Signature Changes
48
48
- **CLI:** The ``Console::run()`` method now accepts an optional ``array $tokens`` parameter. This allows you to pass an array of command tokens directly to the console runner, which is useful for testing or programmatically running commands. If not provided, it will default to using the global ``$argv``.
49
49
- **CodeIgniter:** The deprecated parameters in methods have been removed:
50
50
- ``CodeIgniter\CodeIgniter::handleRequest()`` no longer accepts the deprecated ``$cacheConfig`` and ``$returnResponse`` parameters.
51
-
- ``$cacheConfig`` is no longer used and is now hard deprecated. A deprecation notice will be triggered if this is passed to the method.
52
-
- ``$returnResponse`` is now removed since already deprecated and unused.
53
-
- The updated method signature is now ``handleRequest(?RouteCollectionInterface $routes, ?Cache $cacheConfig = null)``.
51
+
- ``$cacheConfig`` is no longer used and is now hard deprecated. A deprecation notice will be triggered if this is passed to the method.
52
+
- ``$returnResponse`` is now removed since already deprecated and unused.
53
+
- The updated method signature is now ``handleRequest(?RouteCollectionInterface $routes, ?Cache $cacheConfig = null)``.
54
54
- ``CodeIgniter\CodeIgniter::gatherOutput()`` no longer accepts the deprecated ``$cacheConfig`` parameter.
55
-
As this is the first parameter, custom uses of this method will need to be updated to remove the parameter.
55
+
As this is the first parameter, custom uses of this method will need to be updated to remove the parameter.
56
56
- **Config:** ``CodeIgniter\Config\Services::request()`` no longer accepts any parameter.
57
57
- **Database:** The following methods have had their signatures updated to remove deprecated parameters:
58
58
- ``CodeIgniter\Database\Forge::_createTable()`` no longer accepts the deprecated ``$ifNotExists`` parameter. The method signature is now ``_createTable(string $table, array $attributes)``.
@@ -174,11 +174,11 @@ Commands
174
174
175
175
- You can now retrieve the last executed command in the console using the new ``Console::getCommand()`` method. This is useful for logging, debugging, or any situation where you need to know which command was run.
176
176
- ``CLI`` now supports the ``--`` separator to mean that what follows are arguments, not options. This allows you to have arguments that start with ``-`` without them being treated as options.
177
-
For example: ``spark my:command -- --myarg`` will pass ``--myarg`` as an argument instead of an option.
177
+
For example: ``spark my:command -- --myarg`` will pass ``--myarg`` as an argument instead of an option.
178
178
- ``CLI`` now supports options with values specified using an equals sign (e.g., ``--option=value``) in addition to the existing space-separated syntax (e.g., ``--option value``).
179
-
This provides more flexibility in how you can pass options to commands.
179
+
This provides more flexibility in how you can pass options to commands.
180
180
- ``CLI`` now supports parsing array options written multiple times (e.g., ``--option=value1 --option=value2``) into an array of values. This allows you to easily pass multiple values for the same option without needing to use a comma-separated string.
181
-
When used with ``CLI::getOption()``, an array option will return its last value (for example, in this case, ``value2``). To retrieve all values for an array option, use ``CLI::getRawOption()``.
181
+
When used with ``CLI::getOption()``, an array option will return its last value (for example, in this case, ``value2``). To retrieve all values for an array option, use ``CLI::getRawOption()``.
182
182
- Likewise, the ``command()`` function now also supports the above enhancements for command-line option parsing when using the function to run commands from code.
- Added :ref:`Form Requests <form-requests>` - a new ``FormRequest`` base class that encapsulates validation rules, custom error messages, and authorization logic for a single HTTP request.
232
232
- Added ``SSEResponse`` class for streaming Server-Sent Events (SSE) over HTTP. See :ref:`server-sent-events`.
233
233
- ``Response`` and its child classes no longer require ``Config\App`` passed to their constructors.
234
-
Consequently, ``CURLRequest``'s ``$config`` parameter is unused and will be removed in a future release.
234
+
Consequently, ``CURLRequest``'s ``$config`` parameter is unused and will be removed in a future release.
235
235
- ``Response`` now lazily loads the ``ContentSecurityPolicy``, ``Cookie``, and ``CookieStore`` classes only when used,
236
-
instead of instantiating them on every request in the constructor. Requests that do not touch CSP or cookies no longer
237
-
incur the cost of loading these classes.
236
+
instead of instantiating them on every request in the constructor. Requests that do not touch CSP or cookies no longer
237
+
incur the cost of loading these classes.
238
238
- ``CLIRequest`` now supports the ``--`` separator to mean that what follows are arguments, not options. This allows you to have arguments that start with ``-`` without them being treated as options.
239
-
For example: ``php index.php command -- --myarg`` will pass ``--myarg`` as an argument instead of an option.
239
+
For example: ``php index.php command -- --myarg`` will pass ``--myarg`` as an argument instead of an option.
240
240
- ``CLIRequest`` now supports options with values specified using an equals sign (e.g., ``--option=value``) in addition to the existing space-separated syntax (e.g., ``--option value``).
241
-
This provides more flexibility in how you can pass options to CLI requests.
241
+
This provides more flexibility in how you can pass options to CLI requests.
242
242
- Added ``$enableStyleNonce`` and ``$enableScriptNonce`` options to ``Config\App`` to automatically add nonces to control whether to add nonces to style-* and script-* directives in the Content Security Policy (CSP) header when CSP is enabled. See :ref:`csp-control-nonce-generation` for details.
243
243
- ``URI`` now accepts an optional boolean second parameter in the constructor, defaulting to ``false``, to control how the query string is parsed in instantiation.
244
-
This is the behavior of ``->useRawQueryString()`` brought into the constructor for convenience. Previously, you need to call ``$uri->useRawQueryString(true)->setURI($uri)`` to get this behavior.
245
-
Now you can simply do ``new URI($uri, true)``.
244
+
This is the behavior of ``->useRawQueryString()`` brought into the constructor for convenience. Previously, you need to call ``$uri->useRawQueryString(true)->setURI($uri)`` to get this behavior.
245
+
Now you can simply do ``new URI($uri, true)``.
246
246
- ``CLIRequest`` now supports parsing array options written multiple times (e.g., ``--option=value1 --option=value2``) into an array of values. This allows you to easily pass multiple values for the same option without needing to use a comma-separated string.
247
-
When used with ``CLIRequest::getOption()``, an array option will return its last value (for example, in this case, ``value2``). To retrieve all values for an array option, use ``CLIRequest::getRawOption()``.
247
+
When used with ``CLIRequest::getOption()``, an array option will return its last value (for example, in this case, ``value2``). To retrieve all values for an array option, use ``CLIRequest::getRawOption()``.
0 commit comments