1
+ #############
1
2
Version 4.5.0
2
3
#############
3
4
@@ -9,12 +10,181 @@ Release Date: Unreleased
9
10
:local:
10
11
:depth: 3
11
12
13
+ **********
12
14
Highlights
13
15
**********
14
16
15
17
- Update minimal PHP requirement to 8.1.
16
18
- TBD
17
19
20
+ ************
21
+ Enhancements
22
+ ************
23
+
24
+ Commands
25
+ ========
26
+
27
+ - Added ``spark make:test `` command to generate a skeleton test file. See
28
+ :ref: `cli-generators-make-test ` for the details.
29
+ - Added ``spark config:check `` command to check Config values. See
30
+ :ref: `confirming-config-values ` for the details.
31
+ - Added ``spark lang:find `` command to update translations keys. See :ref: `generating-translation-files-via-command ` for the details.
32
+ - The ``--dbgroup `` option has been added to the ``spark db:table `` command.
33
+ See :ref: `Database Commands <db-command-specify-the-dbgroup >`.
34
+
35
+ Testing
36
+ =======
37
+
38
+ - **DomParser: ** The new methods were added ``seeXPath() `` and ``dontSeeXPath() ``
39
+ which allows users to work directly with DOMXPath object, using complex expressions.
40
+ - **CLI: ** The new ``InputOutput `` class was added and now you can write tests
41
+ for commands more easily if you use ``MockInputOutput ``.
42
+ See :ref: `using-mock-input-output `.
43
+ - **TestResponse: ** TestResponse no longer extends ``PHPUnit\Framework\TestCase `` as it
44
+ is not a test. Assertions' return types are now natively typed ``void ``.
45
+
46
+ Database
47
+ ========
48
+
49
+ Query Builder
50
+ -------------
51
+
52
+ .. _v450-query-builder-limit-0-behavior :
53
+
54
+ limit(0) Behavior
55
+ ^^^^^^^^^^^^^^^^^
56
+
57
+ - Added a feature flag ``Feature::$limitZeroAsAll `` to fix the incorrect behavior
58
+ of ``limit(0) ``.
59
+ - If ``LIMIT 0 `` is specified in a SQL statement, 0 records are returned. However,
60
+ there is a bug in the Query Builder, and if ``limit(0) `` is specified, the
61
+ generated SQL statement will have no ``LIMIT `` clause and all records will be
62
+ returned.
63
+ - It is recommended that ``$limitZeroAsAll `` in **app/Config/Feature.php ** be set
64
+ to ``false `` as this incorrect behavior will be fixed in a future version. See
65
+ also :ref: `v450-model-findall-limit-0-behavior `.
66
+
67
+ Forge
68
+ -----
69
+
70
+ Others
71
+ ------
72
+
73
+ Model
74
+ =====
75
+
76
+ Model Field Casting
77
+ -------------------
78
+
79
+ Added a feature to convert data retrieved from a database into the appropriate
80
+ PHP type. See :ref: `model-field-casting ` for details.
81
+
82
+ .. _v450-model-findall-limit-0-behavior :
83
+
84
+ findAll(0) Behavior
85
+ -------------------
86
+
87
+ - Added a feature flag ``Feature::$limitZeroAsAll `` to fix the incorrect behavior
88
+ of ``limit(0) `` for Query Builder. See :ref: `v450-query-builder-limit-0-behavior `
89
+ for details.
90
+ - If you disable this flag, you need to change code like ``findAll(0, $offset) ``
91
+ to ``findAll(null, $offset) ``.
92
+
93
+ $updateOnlyChanged
94
+ ------------------
95
+
96
+ Added a property ``$updateOnlyChanged `` whether to update
97
+ :doc: `Entity <../models/entities >`'s only changed fields. If you set this property
98
+ to ``false ``, when you are updating an Entity, ``DataException ``
99
+ "There is no data to update" will not raise even if the values in the Entity have
100
+ not changed.
101
+
102
+ See :ref: `Using CodeIgniter’s Model <model-update-only-changed >` for details.
103
+
104
+ Saving Dates
105
+ ------------
106
+
107
+ Now you can configure the date/time format when you save :doc: `Time <../libraries/time >`
108
+ instances. See :ref: `model-saving-dates ` for details.
109
+
110
+ Libraries
111
+ =========
112
+
113
+ - **Validation: **
114
+ - Added the new rule ``field_exists `` that checks the filed exists in the
115
+ data to be validated.
116
+ - The ``$dbGroup `` parameter of ``Validation::run() `` now accepts not only
117
+ a database group name, but also a database connection instance or an array
118
+ of database settings.
119
+
120
+ Helpers and Functions
121
+ =====================
122
+
123
+ .. _v450-required-filters :
124
+
125
+ Required Filters
126
+ ================
127
+
128
+ New :ref: `Required Filters <filters-required >` have been introduced. They are
129
+ special filters that are applied before and after other kinds of filters, and
130
+ always applied even if a route does not exist.
131
+
132
+ The following existing functionalities have been reimplemented as Required Filters.
133
+
134
+ - :ref: `Force Global Secure Requests <forcehttps >`
135
+ - :doc: `../general/caching `
136
+ - :ref: `performancemetrics `
137
+ - :ref: `the-debug-toolbar `
138
+
139
+ The Benchmark **Timers ** used by Debug Toolbar now collect *Required Before Filters *
140
+ and *Required After Filters * data.
141
+
142
+ The benchmark points have been changed:
143
+
144
+ - Before
145
+
146
+ - ``bootstrap ``: Creating Request and Response objects, Event ``pre_system ``, Instantiating RouteCollection object, Loading Routes files, Instantiating Router object,
147
+ - ``routing ``: Routing,
148
+ - After
149
+
150
+ - ``bootstrap ``: Creating Request and Response objects, Event ``pre_system ``.
151
+ - ``required_before_filters ``: Instantiating Filters object, Running *Required Before Filters *.
152
+ - ``routing ``: Instantiating RouteCollection object, Loading Routes files, Instantiating Router object, Routing,
153
+
154
+ Others
155
+ ======
156
+
157
+ - **AutoRouting Improved: ** The ``$translateUriToCamelCase `` option has been added
158
+ that allows using CamelCase controller and method names. See
159
+ :ref: `controller-translate-uri-to-camelcase `.
160
+ - **Routing: **
161
+ - Added option ``$multipleSegmentsOneParam ``. When this option is
162
+ enabled, a placeholder that matches multiple segments, such as ``(:any) ``, will
163
+ be passed directly as it is to one parameter, even if it contains multiple segments.
164
+ See :ref: `multiple-uri-segments-as-one-parameter ` for details.
165
+ - Now the 404 controller's method that you set in ``$override404 `` also receive
166
+ a ``PageNotFoundException `` message as the first parameter.
167
+ - Now you can use the ``__invoke() `` method as the default method. See
168
+ :ref: `routing-default-method `.
169
+ - **Autoloader: **
170
+ - Autoloading performance when using Composer has been improved.
171
+ Adding the ``App `` namespace in the ``autoload.psr4 `` setting in **composer.json **
172
+ may also improve the performance of your app. See :ref: `autoloader-application-namespace `.
173
+ - FileLocator Caching implemented. See :ref: `file-locator-caching ` for details.
174
+ - ``FileLocatorInterface `` has been added.
175
+ - **CodeIgniter: ** Added a pseudo-variable ``{memory_usage} `` to show your memory
176
+ usage in your view files, which was supported by CodeIgniter 3.
177
+ - **CSP: ** Added ``ContentSecurityPolicy::clearDirective() `` method to clear
178
+ existing CSP directives. See :ref: `csp-clear-directives `.
179
+ - **Events: ** Added event points ``pre_command `` and ``post_command `` for Spark
180
+ commands. See :ref: `Event Points <event-points-for-cli-apps >`.
181
+ - **HTTP: ** Added ``Message::addHeader() `` method to add another header with
182
+ the same name. See :php:meth: `CodeIgniter\\ HTTP\\ Message::addHeader() `.
183
+ - **Web Page Caching: ** ``ResponseCache `` has been improved to include the request
184
+ HTTP method in the cache key. This means that the same URI will be cached separately
185
+ if the HTTP method is different.
186
+
187
+ ********
18
188
BREAKING
19
189
********
20
190
@@ -243,178 +413,14 @@ Others
243
413
``CodeIgniter\Entity\Entity `` instead.
244
414
- **spark: ** The deprecated constant ``SPARKED `` has been removed.
245
415
246
- Enhancements
247
- ************
248
-
249
- Commands
250
- ========
251
-
252
- - Added ``spark make:test `` command to generate a skeleton test file. See
253
- :ref: `cli-generators-make-test ` for the details.
254
- - Added ``spark config:check `` command to check Config values. See
255
- :ref: `confirming-config-values ` for the details.
256
- - Added ``spark lang:find `` command to update translations keys. See :ref: `generating-translation-files-via-command ` for the details.
257
- - The ``--dbgroup `` option has been added to the ``spark db:table `` command.
258
- See :ref: `Database Commands <db-command-specify-the-dbgroup >`.
259
-
260
- Testing
261
- =======
262
-
263
- - **DomParser: ** The new methods were added ``seeXPath() `` and ``dontSeeXPath() ``
264
- which allows users to work directly with DOMXPath object, using complex expressions.
265
- - **CLI: ** The new ``InputOutput `` class was added and now you can write tests
266
- for commands more easily if you use ``MockInputOutput ``.
267
- See :ref: `using-mock-input-output `.
268
- - **TestResponse: ** TestResponse no longer extends ``PHPUnit\Framework\TestCase `` as it
269
- is not a test. Assertions' return types are now natively typed ``void ``.
270
-
271
- Database
272
- ========
273
-
274
- Query Builder
275
- -------------
276
-
277
- .. _v450-query-builder-limit-0-behavior :
278
-
279
- limit(0) Behavior
280
- ^^^^^^^^^^^^^^^^^
281
-
282
- - Added a feature flag ``Feature::$limitZeroAsAll `` to fix the incorrect behavior
283
- of ``limit(0) ``.
284
- - If ``LIMIT 0 `` is specified in a SQL statement, 0 records are returned. However,
285
- there is a bug in the Query Builder, and if ``limit(0) `` is specified, the
286
- generated SQL statement will have no ``LIMIT `` clause and all records will be
287
- returned.
288
- - It is recommended that ``$limitZeroAsAll `` in **app/Config/Feature.php ** be set
289
- to ``false `` as this incorrect behavior will be fixed in a future version. See
290
- also :ref: `v450-model-findall-limit-0-behavior `.
291
-
292
- Forge
293
- -----
294
-
295
- Others
296
- ------
297
-
298
- Model
299
- =====
300
-
301
- Model Field Casting
302
- -------------------
303
-
304
- Added a feature to convert data retrieved from a database into the appropriate
305
- PHP type. See :ref: `model-field-casting ` for details.
306
-
307
- .. _v450-model-findall-limit-0-behavior :
308
-
309
- findAll(0) Behavior
310
- -------------------
311
-
312
- - Added a feature flag ``Feature::$limitZeroAsAll `` to fix the incorrect behavior
313
- of ``limit(0) `` for Query Builder. See :ref: `v450-query-builder-limit-0-behavior `
314
- for details.
315
- - If you disable this flag, you need to change code like ``findAll(0, $offset) ``
316
- to ``findAll(null, $offset) ``.
317
-
318
- $updateOnlyChanged
319
- ------------------
320
-
321
- Added a property ``$updateOnlyChanged `` whether to update
322
- :doc: `Entity <../models/entities >`'s only changed fields. If you set this property
323
- to ``false ``, when you are updating an Entity, ``DataException ``
324
- "There is no data to update" will not raise even if the values in the Entity have
325
- not changed.
326
-
327
- See :ref: `Using CodeIgniter’s Model <model-update-only-changed >` for details.
328
-
329
- Saving Dates
330
- ------------
331
-
332
- Now you can configure the date/time format when you save :doc: `Time <../libraries/time >`
333
- instances. See :ref: `model-saving-dates ` for details.
334
-
335
- Libraries
336
- =========
337
-
338
- - **Validation: **
339
- - Added the new rule ``field_exists `` that checks the filed exists in the
340
- data to be validated.
341
- - The ``$dbGroup `` parameter of ``Validation::run() `` now accepts not only
342
- a database group name, but also a database connection instance or an array
343
- of database settings.
344
-
345
- Helpers and Functions
346
- =====================
347
-
348
- .. _v450-required-filters :
349
-
350
- Required Filters
351
- ================
352
-
353
- New :ref: `Required Filters <filters-required >` have been introduced. They are
354
- special filters that are applied before and after other kinds of filters, and
355
- always applied even if a route does not exist.
356
-
357
- The following existing functionalities have been reimplemented as Required Filters.
358
-
359
- - :ref: `Force Global Secure Requests <forcehttps >`
360
- - :doc: `../general/caching `
361
- - :ref: `performancemetrics `
362
- - :ref: `the-debug-toolbar `
363
-
364
- The Benchmark **Timers ** used by Debug Toolbar now collect *Required Before Filters *
365
- and *Required After Filters * data.
366
-
367
- The benchmark points have been changed:
368
-
369
- - Before
370
-
371
- - ``bootstrap ``: Creating Request and Response objects, Event ``pre_system ``, Instantiating RouteCollection object, Loading Routes files, Instantiating Router object,
372
- - ``routing ``: Routing,
373
- - After
374
-
375
- - ``bootstrap ``: Creating Request and Response objects, Event ``pre_system ``.
376
- - ``required_before_filters ``: Instantiating Filters object, Running *Required Before Filters *.
377
- - ``routing ``: Instantiating RouteCollection object, Loading Routes files, Instantiating Router object, Routing,
378
-
379
- Others
380
- ======
381
-
382
- - **AutoRouting Improved: ** The ``$translateUriToCamelCase `` option has been added
383
- that allows using CamelCase controller and method names. See
384
- :ref: `controller-translate-uri-to-camelcase `.
385
- - **Routing: **
386
- - Added option ``$multipleSegmentsOneParam ``. When this option is
387
- enabled, a placeholder that matches multiple segments, such as ``(:any) ``, will
388
- be passed directly as it is to one parameter, even if it contains multiple segments.
389
- See :ref: `multiple-uri-segments-as-one-parameter ` for details.
390
- - Now the 404 controller's method that you set in ``$override404 `` also receive
391
- a ``PageNotFoundException `` message as the first parameter.
392
- - Now you can use the ``__invoke() `` method as the default method. See
393
- :ref: `routing-default-method `.
394
- - **Autoloader: **
395
- - Autoloading performance when using Composer has been improved.
396
- Adding the ``App `` namespace in the ``autoload.psr4 `` setting in **composer.json **
397
- may also improve the performance of your app. See :ref: `autoloader-application-namespace `.
398
- - FileLocator Caching implemented. See :ref: `file-locator-caching ` for details.
399
- - ``FileLocatorInterface `` has been added.
400
- - **CodeIgniter: ** Added a pseudo-variable ``{memory_usage} `` to show your memory
401
- usage in your view files, which was supported by CodeIgniter 3.
402
- - **CSP: ** Added ``ContentSecurityPolicy::clearDirective() `` method to clear
403
- existing CSP directives. See :ref: `csp-clear-directives `.
404
- - **Events: ** Added event points ``pre_command `` and ``post_command `` for Spark
405
- commands. See :ref: `Event Points <event-points-for-cli-apps >`.
406
- - **HTTP: ** Added ``Message::addHeader() `` method to add another header with
407
- the same name. See :php:meth: `CodeIgniter\\ HTTP\\ Message::addHeader() `.
408
- - **Web Page Caching: ** ``ResponseCache `` has been improved to include the request
409
- HTTP method in the cache key. This means that the same URI will be cached separately
410
- if the HTTP method is different.
411
-
416
+ ***************
412
417
Message Changes
413
418
***************
414
419
415
420
- Added ``CLI.generator.className.test `` message.
416
421
- Added ``Validation.field_exists `` error message.
417
422
423
+ *******
418
424
Changes
419
425
*******
420
426
@@ -433,6 +439,7 @@ Changes
433
439
is deprecated in SQL Server.
434
440
- ``declare(strict_types=1) `` has been added to most framework codebase.
435
441
442
+ ************
436
443
Deprecations
437
444
************
438
445
@@ -453,6 +460,7 @@ Deprecations
453
460
methods accept the lowercase HTTP methods has been deprecated. Use correct
454
461
uppercase HTTP methods instead.
455
462
463
+ **********
456
464
Bugs Fixed
457
465
**********
458
466
0 commit comments