From c672b2bd307ee9739387258cbd20241bd3c29583 Mon Sep 17 00:00:00 2001 From: Donatas Glodenis Date: Sun, 24 Sep 2023 13:06:10 +0300 Subject: [PATCH 01/55] Add note on incompatibility of general rules for file validation use --- user_guide_src/source/libraries/validation.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/user_guide_src/source/libraries/validation.rst b/user_guide_src/source/libraries/validation.rst index 3224961e0821..1d73f3b8aaae 100644 --- a/user_guide_src/source/libraries/validation.rst +++ b/user_guide_src/source/libraries/validation.rst @@ -971,6 +971,9 @@ Rule Parameter Description ======================= ========== ============================================= =================================================== uploaded Yes Fails if the name of the parameter does not ``uploaded[field_name]`` match the name of any uploaded files. + Prevents form from validating if file upload + is required. + max_size Yes Fails if the uploaded file named in the ``max_size[field_name,2048]`` parameter is larger than the second parameter in kilobytes (kb). Or if the file @@ -992,3 +995,7 @@ is_image Yes Fails if the file cannot be determined to be ======================= ========== ============================================= =================================================== The file validation rules apply for both single and multiple file uploads. + +.. note:: Only rules specifically created for file validation (like the ones listed in the table above) can be used to validate files. + Therefore, adding any general rules, like ``permit_empy``, to file validation rules array or string will prevend all rules for the + from file from being processed during validation. From 20b496b057cbc97fd929298d9ca8d8720df91dac Mon Sep 17 00:00:00 2001 From: Donatas Glodenis Date: Wed, 4 Oct 2023 17:36:39 +0300 Subject: [PATCH 02/55] Implement proposed fixes for previous suggestions --- user_guide_src/source/libraries/validation.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/user_guide_src/source/libraries/validation.rst b/user_guide_src/source/libraries/validation.rst index 1d73f3b8aaae..a527dada391c 100644 --- a/user_guide_src/source/libraries/validation.rst +++ b/user_guide_src/source/libraries/validation.rst @@ -971,8 +971,8 @@ Rule Parameter Description ======================= ========== ============================================= =================================================== uploaded Yes Fails if the name of the parameter does not ``uploaded[field_name]`` match the name of any uploaded files. - Prevents form from validating if file upload - is required. + If you want the file upload to be optional (not required), + do not define this rule. max_size Yes Fails if the uploaded file named in the ``max_size[field_name,2048]`` parameter is larger than the second @@ -997,5 +997,5 @@ is_image Yes Fails if the file cannot be determined to be The file validation rules apply for both single and multiple file uploads. .. note:: Only rules specifically created for file validation (like the ones listed in the table above) can be used to validate files. - Therefore, adding any general rules, like ``permit_empy``, to file validation rules array or string will prevend all rules for the - from file from being processed during validation. + Therefore, adding any general rules, like ``permit_empy``, to file validation rules array or string, the file validation will not + work correctly. From db7041cdb1d2cb5eb09684e50efa8e0494f31343 Mon Sep 17 00:00:00 2001 From: Donatas Glodenis Date: Fri, 6 Oct 2023 09:49:53 +0300 Subject: [PATCH 03/55] correct table format --- user_guide_src/source/libraries/validation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/libraries/validation.rst b/user_guide_src/source/libraries/validation.rst index a527dada391c..7a26a41d49fc 100644 --- a/user_guide_src/source/libraries/validation.rst +++ b/user_guide_src/source/libraries/validation.rst @@ -971,8 +971,8 @@ Rule Parameter Description ======================= ========== ============================================= =================================================== uploaded Yes Fails if the name of the parameter does not ``uploaded[field_name]`` match the name of any uploaded files. - If you want the file upload to be optional (not required), - do not define this rule. + If you want the file upload to be optional + (not required), do not define this rule. max_size Yes Fails if the uploaded file named in the ``max_size[field_name,2048]`` parameter is larger than the second From 8513503c38df52c755a5ba1cb5e5bffcf99cf942 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 18 Oct 2023 15:00:45 +0900 Subject: [PATCH 04/55] docs: fix @var type --- app/Config/Filters.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Config/Filters.php b/app/Config/Filters.php index 8c02a4acd331..41e76267a448 100644 --- a/app/Config/Filters.php +++ b/app/Config/Filters.php @@ -15,8 +15,9 @@ class Filters extends BaseConfig * Configures aliases for Filter classes to * make reading things nicer and simpler. * - * @var array - * @phpstan-var array + * @var array|string> [filter_name => classname] + * or [filter_name => [classname1, classname2, ...]] + * @phpstan-var array> */ public array $aliases = [ 'csrf' => CSRF::class, From cc185a87e7bd32b85ef0ddef010a4dc14f30d750 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 18 Oct 2023 15:43:50 +0900 Subject: [PATCH 05/55] test: add assertion --- tests/system/Test/FilterTestTraitTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/system/Test/FilterTestTraitTest.php b/tests/system/Test/FilterTestTraitTest.php index e2d5a423637f..79a7beefcee1 100644 --- a/tests/system/Test/FilterTestTraitTest.php +++ b/tests/system/Test/FilterTestTraitTest.php @@ -68,6 +68,7 @@ public function testCallerUsesClonedInstance(): void $result = $caller(); $this->assertSame('http://hellowworld.com', $result->getBody()); + $this->assertNull(Services::response()->getBody()); $this->resetServices(); } From 66b572a2e4a77776d9c558ab4ab2c60030050ea9 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 18 Oct 2023 15:44:09 +0900 Subject: [PATCH 06/55] fix: getFilterCaller() does not support Filter classes as array --- system/Test/FilterTestTrait.php | 56 ++++++++++++++++++++--- tests/system/Test/FilterTestTraitTest.php | 11 +++++ 2 files changed, 60 insertions(+), 7 deletions(-) diff --git a/system/Test/FilterTestTrait.php b/system/Test/FilterTestTrait.php index 4901a585ce20..084a6cd082fc 100644 --- a/system/Test/FilterTestTrait.php +++ b/system/Test/FilterTestTrait.php @@ -132,26 +132,68 @@ protected function getFilterCaller($filter, string $position): Closure throw new RuntimeException("No filter found with alias '{$filter}'"); } - $filter = $this->filtersConfig->aliases[$filter]; + $filterClasses = $this->filtersConfig->aliases[$filter]; } - // Get an instance - $filter = new $filter(); + $filterClasses = (array) $filterClasses; } - if (! $filter instanceof FilterInterface) { - throw FilterException::forIncorrectInterface(get_class($filter)); + foreach ($filterClasses as $class) { + // Get an instance + $filter = new $class(); + + if (! $filter instanceof FilterInterface) { + throw FilterException::forIncorrectInterface(get_class($filter)); + } } $request = clone $this->request; if ($position === 'before') { - return static fn (?array $params = null) => $filter->before($request, $params); + return static function (?array $params = null) use ($filterClasses, $request) { + foreach ($filterClasses as $class) { + $filter = new $class(); + + $result = $filter->before($request, $params); + + // @TODO The following logic is in Filters class. + // Should use Filters class. + if ($result instanceof RequestInterface) { + $request = $result; + + continue; + } + if ($result instanceof ResponseInterface) { + return $result; + } + if (empty($result)) { + continue; + } + } + + return $result; + }; } $response = clone $this->response; - return static fn (?array $params = null) => $filter->after($request, $response, $params); + return static function (?array $params = null) use ($filterClasses, $request, $response) { + foreach ($filterClasses as $class) { + $filter = new $class(); + + $result = $filter->after($request, $response, $params); + + // @TODO The following logic is in Filters class. + // Should use Filters class. + if ($result instanceof ResponseInterface) { + $response = $result; + + continue; + } + } + + return $result; + }; } /** diff --git a/tests/system/Test/FilterTestTraitTest.php b/tests/system/Test/FilterTestTraitTest.php index 79a7beefcee1..bebec3857030 100644 --- a/tests/system/Test/FilterTestTraitTest.php +++ b/tests/system/Test/FilterTestTraitTest.php @@ -12,6 +12,7 @@ namespace CodeIgniter\Test; use CodeIgniter\HTTP\RequestInterface; +use Config\Services; use Tests\Support\Filters\Customfilter; /** @@ -62,6 +63,16 @@ public function testGetCallerInvalidPosition(): void $this->getFilterCaller('test-customfilter', 'banana'); } + public function testCallerSupportArray(): void + { + $this->filtersConfig->aliases['test-customfilter'] = [Customfilter::class]; + + $caller = $this->getFilterCaller('test-customfilter', 'before'); + $result = $caller(); + + $this->assertSame('http://hellowworld.com', $result->getBody()); + } + public function testCallerUsesClonedInstance(): void { $caller = $this->getFilterCaller('test-customfilter', 'before'); From 2b836f9c037957ff58894572d39f2fac035d73b9 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 18 Oct 2023 10:05:28 +0900 Subject: [PATCH 07/55] docs: fix incorrect descriptions for pre_system and post_system --- user_guide_src/source/extending/events.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/extending/events.rst b/user_guide_src/source/extending/events.rst index 74fe34b4fe70..0221657f8ff1 100644 --- a/user_guide_src/source/extending/events.rst +++ b/user_guide_src/source/extending/events.rst @@ -87,9 +87,12 @@ Event Points The following is a list of available event points within the CodeIgniter core code: -* **pre_system** Called very early during system execution. Only the benchmark and events class have been loaded at this point. No routing or other processes have happened. +* **pre_system** Called early during system execution. The URI, Request, and + Response have been instantiated, but page cache checking, routing, and execution + of "before" controller filters have not yet occurred. * **post_controller_constructor** Called immediately after your controller is instantiated, but prior to any method calls happening. -* **post_system** Called after the final rendered page is sent to the browser, at the end of system execution after the finalized data is sent to the browser. +* **post_system** Called right before the final rendered page is sent to the browser, + at the end of system execution, after the execution of "after" controller filters. * **email** Called after an email sent successfully from ``CodeIgniter\Email\Email``. Receives an array of the ``Email`` class's properties as a parameter. * **DBQuery** Called after a database query whether successful or not. Receives the ``Query`` object. * **migrate** Called after a successful migration call to ``latest()`` or ``regress()``. Receives the current properties of ``MigrationRunner`` as well as the name of the method. From 50e78670fd0a9f537b7fb3f43d772abc1941d2d8 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 18 Oct 2023 10:09:10 +0900 Subject: [PATCH 08/55] docs: add changelog --- user_guide_src/source/changelogs/v4.4.2.rst | 2 ++ user_guide_src/source/extending/events.rst | 2 ++ 2 files changed, 4 insertions(+) diff --git a/user_guide_src/source/changelogs/v4.4.2.rst b/user_guide_src/source/changelogs/v4.4.2.rst index bacfdf2a2e97..9394525b5367 100644 --- a/user_guide_src/source/changelogs/v4.4.2.rst +++ b/user_guide_src/source/changelogs/v4.4.2.rst @@ -47,6 +47,8 @@ Bugs Fixed - **Forge:** Fixed a bug where adding a Primary Key to an existing table was ignored if there were no other Keys added too. - **Routing:** Fixed a bug that ``spark routes`` may show incorrect route names. +- **UserGuide:** Fixed the descriptions for ``pre_system`` and ``post_system`` + in :ref:`event-points`. See the repo's `CHANGELOG.md `_ diff --git a/user_guide_src/source/extending/events.rst b/user_guide_src/source/extending/events.rst index 0221657f8ff1..7891249cdcf6 100644 --- a/user_guide_src/source/extending/events.rst +++ b/user_guide_src/source/extending/events.rst @@ -82,6 +82,8 @@ You can stop simulation by passing false: .. literalinclude:: events/008.php +.. _event-points: + Event Points ============ From 82ccf15f03e4ae3a31dbf01aadee3cf51eb3110f Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 19 Oct 2023 17:36:55 +0900 Subject: [PATCH 09/55] docs: add descriptions to upgrade_4xx Hooks --- user_guide_src/source/installation/upgrade_4xx.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/user_guide_src/source/installation/upgrade_4xx.rst b/user_guide_src/source/installation/upgrade_4xx.rst index ae645d26c1a9..bf7ba85fece6 100644 --- a/user_guide_src/source/installation/upgrade_4xx.rst +++ b/user_guide_src/source/installation/upgrade_4xx.rst @@ -153,6 +153,12 @@ Hooks - Instead of CI3's ``$hook['post_controller_constructor']`` you now use ``Events::on('post_controller_constructor', ['MyClass', 'MyFunction']);``, with the namespace ``CodeIgniter\Events\Events;``. - Events are always enabled, and are available globally. +- The hook point ``pre_controller`` and ``post_controller`` have been removed. + Use :doc:`../incoming/filters` instead. +- The hook point ``display_override`` and ``cache_override`` have been removed. + Because the base methods have been removed. +- The hook point ``post_system`` has moved just before sending the final rendered + page. Extending the Framework ======================= From 0995b382de05e7b1460785754c256441514f2b74 Mon Sep 17 00:00:00 2001 From: ping-yee <611077101@mail.nknu.edu.tw> Date: Wed, 18 Oct 2023 01:43:13 +0800 Subject: [PATCH 10/55] fix: fix the field named `data` will produce bugged output. --- system/View/Table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/View/Table.php b/system/View/Table.php index df0fbebd2bc5..5e241f11fefc 100644 --- a/system/View/Table.php +++ b/system/View/Table.php @@ -265,7 +265,7 @@ protected function _prepArgs(array $args) // If there is no $args[0], skip this and treat as an associative array // This can happen if there is only a single key, for example this is passed to table->generate // array(array('foo'=>'bar')) - if (isset($args[0]) && count($args) === 1 && is_array($args[0]) && ! isset($args[0]['data'])) { + if (isset($args[0]) && count($args) === 1 && is_array($args[0])) { $args = $args[0]; } From df4b7c666348f9324f0cf16e0300c4ec37f6ee69 Mon Sep 17 00:00:00 2001 From: ping-yee <611077101@mail.nknu.edu.tw> Date: Wed, 18 Oct 2023 10:21:25 +0800 Subject: [PATCH 11/55] test: add the test case for the bug fix. --- tests/system/View/TableTest.php | 93 +++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/tests/system/View/TableTest.php b/tests/system/View/TableTest.php index 3c607930616a..492206cefd3b 100644 --- a/tests/system/View/TableTest.php +++ b/tests/system/View/TableTest.php @@ -816,6 +816,99 @@ public static function orderedColumnUsecases(): iterable ], ]; } + + /** + * @see https://github.com/codeigniter4/CodeIgniter4/issues/8051 + */ + public function testGenerateTableWithHeadingContainFieldNamedData(): void + { + $table_template = [ + 'table_open' => '', + + 'thead_open' => '', + 'thead_close' => '', + + 'heading_row_start' => '', + 'heading_row_end' => '', + 'heading_cell_start' => '', + + 'tfoot_open' => '', + 'tfoot_close' => '', + + 'footing_row_start' => '', + 'footing_row_end' => '', + 'footing_cell_start' => '', + + 'tbody_open' => '', + 'tbody_close' => '', + + 'row_start' => '', + 'row_end' => '', + 'cell_start' => '', + + 'row_alt_start' => '', + 'row_alt_end' => '', + 'cell_alt_start' => '', + + 'table_close' => '
', + 'heading_cell_end' => '
', + 'footing_cell_end' => '
', + 'cell_end' => '
', + 'cell_alt_end' => '
', + ]; + + $table = new \CodeIgniter\View\Table($table_template); + $table->setHeading([ + 'codigo' => 'Codigo Orçamento', + 'data' => 'Data do Orçamento', + 'tipo_desconto' => 'Tipo de Desconto', + 'valor_desconto' => 'Valor do Desconto', + ])->setSyncRowsWithHeading(true); + + $sampleData = [ + [ + 'id' => 1, + 'id_cliente' => 1, + 'codigo' => 'codigo1', + 'data' => '2023-10-16 21:53:25', + 'tipo_desconto' => 'NENHUM', + 'valor_desconto' => '', + 'created_at' => '2023-10-16 21:53:25', + 'updated_at' => '2023-10-16 21:53:25', + 'deleted_at' => '', + ], + [ + 'id' => 2, + 'id_cliente' => 2, + 'codigo' => 'codigo2', + 'data' => '2023-10-16 21:53:25', + 'tipo_desconto' => 'REAL', + 'valor_desconto' => 10.00, + 'created_at' => '2023-10-16 21:53:25', + 'updated_at' => '2023-10-16 21:53:25', + 'deleted_at' => '', + ], + [ + 'id' => 3, + 'id_cliente' => 3, + 'codigo' => 'codigo3', + 'data' => '2023-10-16 21:53:25', + 'tipo_desconto' => 'PERCENTUAL', + 'valor_desconto' => 10.00, + 'created_at' => '2023-10-16 21:53:25', + 'updated_at' => '2023-10-16 21:53:25', + 'deleted_at' => '', + ], + ]; + + $generated = $table->generate($sampleData); + + $this->assertStringContainsString('Codigo OrçamentoData do OrçamentoTipo de DescontoValor do Desconto', $generated); + + $this->assertStringContainsString('codigo12023-10-16 21:53:25NENHUM', $generated); + $this->assertStringContainsString('codigo22023-10-16 21:53:25REAL10', $generated); + $this->assertStringContainsString('codigo32023-10-16 21:53:25PERCENTUAL10', $generated); + } } // We need this for the _set_from_db_result() test From 39903e66dcbbac67d0a2bf4cee598ea66189fbcd Mon Sep 17 00:00:00 2001 From: ping-yee <611077101@mail.nknu.edu.tw> Date: Wed, 18 Oct 2023 10:44:40 +0800 Subject: [PATCH 12/55] style: run rector. --- tests/system/View/TableTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/system/View/TableTest.php b/tests/system/View/TableTest.php index 492206cefd3b..1eb0939fa1c3 100644 --- a/tests/system/View/TableTest.php +++ b/tests/system/View/TableTest.php @@ -822,7 +822,7 @@ public static function orderedColumnUsecases(): iterable */ public function testGenerateTableWithHeadingContainFieldNamedData(): void { - $table_template = [ + $tableTemplate = [ 'table_open' => '', 'thead_open' => '', @@ -857,7 +857,7 @@ public function testGenerateTableWithHeadingContainFieldNamedData(): void 'table_close' => '
', ]; - $table = new \CodeIgniter\View\Table($table_template); + $table = new Table($tableTemplate); $table->setHeading([ 'codigo' => 'Codigo Orçamento', 'data' => 'Data do Orçamento', From f098f4e3cd63e65549ccad2ac446d727bf099ff3 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 20 Oct 2023 15:53:23 +0900 Subject: [PATCH 13/55] docs: add changelog and upgrade for v4.4.3 --- user_guide_src/source/changelogs/index.rst | 1 + user_guide_src/source/changelogs/v4.4.3.rst | 29 +++++++++++ .../source/installation/upgrade_443.rst | 50 +++++++++++++++++++ .../source/installation/upgrading.rst | 1 + 4 files changed, 81 insertions(+) create mode 100644 user_guide_src/source/changelogs/v4.4.3.rst create mode 100644 user_guide_src/source/installation/upgrade_443.rst diff --git a/user_guide_src/source/changelogs/index.rst b/user_guide_src/source/changelogs/index.rst index 73eab706433f..5863f9c4fd8f 100644 --- a/user_guide_src/source/changelogs/index.rst +++ b/user_guide_src/source/changelogs/index.rst @@ -12,6 +12,7 @@ See all the changes. .. toctree:: :titlesonly: + v4.4.3 v4.4.2 v4.4.1 v4.4.0 diff --git a/user_guide_src/source/changelogs/v4.4.3.rst b/user_guide_src/source/changelogs/v4.4.3.rst new file mode 100644 index 000000000000..248b71790c05 --- /dev/null +++ b/user_guide_src/source/changelogs/v4.4.3.rst @@ -0,0 +1,29 @@ +Version 4.4.3 +############# + +Release Date: Unreleased + +**4.4.3 release of CodeIgniter4** + +.. contents:: + :local: + :depth: 3 + +BREAKING +******** + +Message Changes +*************** + +Changes +******* + +Deprecations +************ + +Bugs Fixed +********** + +See the repo's +`CHANGELOG.md `_ +for a complete list of bugs fixed. diff --git a/user_guide_src/source/installation/upgrade_443.rst b/user_guide_src/source/installation/upgrade_443.rst new file mode 100644 index 000000000000..d33d162e9383 --- /dev/null +++ b/user_guide_src/source/installation/upgrade_443.rst @@ -0,0 +1,50 @@ +############################# +Upgrading from 4.4.2 to 4.4.3 +############################# + +Please refer to the upgrade instructions corresponding to your installation method. + +- :ref:`Composer Installation App Starter Upgrading ` +- :ref:`Composer Installation Adding CodeIgniter4 to an Existing Project Upgrading ` +- :ref:`Manual Installation Upgrading ` + +.. contents:: + :local: + :depth: 2 + +Mandatory File Changes +********************** + +Breaking Changes +**************** + +Breaking Enhancements +********************* + +Project Files +************* + +Some files in the **project space** (root, app, public, writable) received updates. Due to +these files being outside of the **system** scope they will not be changed without your intervention. + +There are some third-party CodeIgniter modules available to assist with merging changes to +the project space: `Explore on Packagist `_. + +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: + +Config +------ + +- @TODO + +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: + +- @TODO diff --git a/user_guide_src/source/installation/upgrading.rst b/user_guide_src/source/installation/upgrading.rst index 9f9e17528052..b768959eb6c4 100644 --- a/user_guide_src/source/installation/upgrading.rst +++ b/user_guide_src/source/installation/upgrading.rst @@ -16,6 +16,7 @@ See also :doc:`./backward_compatibility_notes`. backward_compatibility_notes + upgrade_443 upgrade_442 upgrade_441 upgrade_440 From 60870b74e0484a7727c22cf2f5a9769bfcc1e4e8 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 20 Oct 2023 15:56:46 +0900 Subject: [PATCH 14/55] docs: update RELEASE.md --- admin/RELEASE.md | 69 ++++++++++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/admin/RELEASE.md b/admin/RELEASE.md index 776c1f70a941..98089ae8181f 100644 --- a/admin/RELEASE.md +++ b/admin/RELEASE.md @@ -10,11 +10,11 @@ If you release a new minor version. -* Create PR to merge `4.x` into `develop` and merge it -* Rename the current minor version (e.g., `4.4`) in Setting > Branches > +* [ ] Create PR to merge `4.x` into `develop` and merge it +* [ ] Rename the current minor version (e.g., `4.4`) in Setting > Branches > "Branch protection rules" to the next minor version. E.g. `4.4` → `4.5` -* Delete the merged `4.x` branch (This closes all PRs to the branch) -* Do the regular release process. Go to the next "Changelog" section +* [ ] Delete the merged `4.x` branch (This closes all PRs to the branch) +* [ ] Do the regular release process. Go to the next "Changelog" section ## Changelog @@ -48,17 +48,18 @@ the existing content. ## Preparation -* Work off direct clones of the repos so the release branches persist for a time -* Clone both **codeigniter4/CodeIgniter4** and **codeigniter4/userguide** and +Work off direct clones of the repos so the release branches persist for a time. + +* [ ] Clone both **codeigniter4/CodeIgniter4** and **codeigniter4/userguide** and resolve any necessary PRs ```console git clone git@github.com:codeigniter4/CodeIgniter4.git git clone git@github.com:codeigniter4/userguide.git ``` -* Vet the **admin/** folders for any removed hidden files (Action deploy scripts +* [ ] Vet the **admin/** folders for any removed hidden files (Action deploy scripts *do not remove these*) * git diff --name-status origin/master admin/ -* Merge any Security Advisory PRs in private forks +* [ ] Merge any Security Advisory PRs in private forks ## Process @@ -66,29 +67,38 @@ the existing content. > been included with their PR, so this process assumes you will not be > generating much new content. -* Create a new branch `release-4.x.x` -* Update **system/CodeIgniter.php** with the new version number: +* [ ] Create a new branch `release-4.x.x` +* [ ] Update **system/CodeIgniter.php** with the new version number: `const CI_VERSION = '4.x.x';` -* Update **user_guide_src/source/conf.py** with the new `version = '4.x'` (if applicable) +* [ ] Update **user_guide_src/source/conf.py** with the new `version = '4.x'` (if applicable) and `release = '4.x.x'` -* Replace **CHANGELOG.md** with the new version generated above -* Update **user_guide_src/source/changelogs/{version}.rst** +* [ ] Replace **CHANGELOG.md** with the new version generated above +* [ ] Update **user_guide_src/source/changelogs/{version}.rst** * Set the date to format `Release Date: January 31, 2021` * Remove the section titles that have no items -* Update **user_guide_src/source/installation/upgrade_{ver}.rst** +* [ ] Update **user_guide_src/source/installation/upgrade_{ver}.rst** * fill in the "All Changes" section, and add it to **upgrading.rst** * git diff --name-status origin/master -- . ':!system' * Remove the section titles that have no items * [Minor version only] Update the "from" version in the title. E.g., `from 4.3.x` → `from 4.3.8` -* Commit the changes with `Prep for 4.x.x release` and push to origin -* Create a new PR from `release-4.x.x` to `develop`: +* [ ] Commit the changes with `Prep for 4.x.x release` and push to origin +* [ ] Create a new PR from `release-4.x.x` to `develop`: * Title: `Prep for 4.x.x release` - * Decription: `Updates changelog and version references for 4.x.x.` (plus checklist) -* Let all tests run, then review and merge the PR -* Create a new PR from `develop` to `master`: + * Description: + ``` + Updates changelog and version references for 4.x.x. + + Previous version: #xxxx + Release Code: TODO + New Changelog: TODO + ``` + (plus checklist) +* [ ] Let all tests run, then review and merge the PR +* [ ] Create a new PR from `develop` to `master`: * Title: `4.x.x Ready code` * Description: blank -* Merge the PR then create a new Release: +* [ ] Merge the PR and wait for all tests. +* [ ] Create a new Release: * Tag: `v4.x.x` (Create new tag) * Target: `master` * Title: `CodeIgniter 4.x.x` @@ -103,22 +113,23 @@ the existing content. **Full Changelog**: https://github.com/codeigniter4/CodeIgniter4/compare/v4.x.x...v4.x.x ``` -* Watch for the "Deploy Distributable Repos" action to make sure **framework**, + Click the "Generate release notes" button, and get the "New Contributors". +* [ ] Watch for the "Deploy Distributable Repos" action to make sure **framework**, **appstarter**, and **userguide** get updated -* Run the following commands to install and test `appstarter` and verify the new +* [ ] Run the following commands to install and test `appstarter` and verify the new version: ```console composer create-project codeigniter4/appstarter release-test cd release-test composer test && composer info codeigniter4/framework ``` -* Verify that the user guide actions succeeded: +* [ ] Verify that the user guide actions succeeded: * "[Deploy Distributable Repos](https://github.com/codeigniter4/CodeIgniter4/actions/workflows/deploy-distributables.yml)", the main repo * "[Deploy Production](https://github.com/codeigniter4/userguide/actions/workflows/deploy.yml)", UG repo * "[pages-build-deployment](https://github.com/codeigniter4/userguide/actions/workflows/pages/pages-build-deployment)", UG repo * Check if "CodeIgniter4.x.x.epub" is added to UG repo. "CodeIgniter.epub" was created when v4.3.8 was released. -* Fast-forward `develop` branch to catch the merge commit from `master` +* [ ] Fast-forward `develop` branch to catch the merge commit from `master` ```console git fetch origin git checkout develop @@ -126,7 +137,7 @@ the existing content. git merge origin/master git push origin HEAD ``` -* Update the next minor upgrade branch `4.x`: +* [ ] Update the next minor upgrade branch `4.x`: ```console git fetch origin git checkout 4.x @@ -134,22 +145,22 @@ the existing content. git merge origin/develop git push origin HEAD ``` -* [Minor version only] Create the next minor upgrade branch `4.x`: +* [ ] [Minor version only] Create the next minor upgrade branch `4.x`: ```console git fetch origin git switch develop git switch -c 4.x git push origin HEAD ``` -* Publish any Security Advisories that were resolved from private forks +* [ ] Publish any Security Advisories that were resolved from private forks (note: publishing is restricted to administrators): -* Announce the release on the forums and Slack channel +* [ ] Announce the release on the forums and Slack channel (note: this forum is restricted to administrators): * Make a new topic in the "News & Discussion" forums: https://forum.codeigniter.com/forum-2.html * The content is somewhat organic, but should include any major features and changes as well as a link to the User Guide's changelog -* Create a PR for new changelog and upgrade for the next version +* [ ] Create a PR for new changelog and upgrade for the next version * Create **user_guide_src/source/changelogs/{next_version}.rst** and add it to **index.rst** (See **next-changelog-*.rst**) * Create **user_guide_src/source/installation/upgrade_{next_version}.rst** and add it to From b5e3212476a70cb83f4ca6d25b1a94cae57657c0 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Dadashi Date: Sun, 22 Oct 2023 07:04:30 +0330 Subject: [PATCH 15/55] phpstan: remove unneeded ignoreErrors --- phpstan.neon.dist | 2 -- 1 file changed, 2 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index eb85c8131723..1fcd28307cf5 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -38,8 +38,6 @@ parameters: booleansInConditions: true disallowedConstructs: true matchingInheritedMethodNames: true - ignoreErrors: - - '#^Call to function config with Config\\.+\:\:class is discouraged\.$#' codeigniter: additionalConfigNamespaces: - CodeIgniter\Config\ From bd7b3b51622d934094adb156978939102f42c6d5 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 23 Oct 2023 06:36:29 +0900 Subject: [PATCH 16/55] docs: improve description --- user_guide_src/source/models/model.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/user_guide_src/source/models/model.rst b/user_guide_src/source/models/model.rst index 46bc5908cb41..880adfc0d9cb 100644 --- a/user_guide_src/source/models/model.rst +++ b/user_guide_src/source/models/model.rst @@ -69,7 +69,10 @@ Connecting to the Database ========================== When the class is first instantiated, if no database connection instance is passed to the constructor, -it will automatically connect to the default database group, as set in the configuration. You can +and if you don't set the ``$DBGroup`` property to your model class, +it will automatically connect to the default database group, as set in the database configuration. + +You can modify which group is used on a per-model basis by adding the ``$DBGroup`` property to your class. This ensures that within the model any references to ``$this->db`` are made through the appropriate connection. From 5d5487c112439c2b89570379a8f47a6363dbec39 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 23 Oct 2023 06:44:26 +0900 Subject: [PATCH 17/55] Revert "docs: fix event points descriptions" --- user_guide_src/source/changelogs/v4.4.2.rst | 2 -- user_guide_src/source/extending/events.rst | 9 ++------- user_guide_src/source/installation/upgrade_4xx.rst | 6 ------ 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/user_guide_src/source/changelogs/v4.4.2.rst b/user_guide_src/source/changelogs/v4.4.2.rst index 12fad5ed55df..eb146ef07c0c 100644 --- a/user_guide_src/source/changelogs/v4.4.2.rst +++ b/user_guide_src/source/changelogs/v4.4.2.rst @@ -44,8 +44,6 @@ Bugs Fixed - **Forge:** Fixed a bug where adding a Primary Key to an existing table was ignored if there were no other Keys added too. - **Routing:** Fixed a bug that ``spark routes`` may show incorrect route names. -- **UserGuide:** Fixed the descriptions for ``pre_system`` and ``post_system`` - in :ref:`event-points`. See the repo's `CHANGELOG.md `_ diff --git a/user_guide_src/source/extending/events.rst b/user_guide_src/source/extending/events.rst index 7891249cdcf6..74fe34b4fe70 100644 --- a/user_guide_src/source/extending/events.rst +++ b/user_guide_src/source/extending/events.rst @@ -82,19 +82,14 @@ You can stop simulation by passing false: .. literalinclude:: events/008.php -.. _event-points: - Event Points ============ The following is a list of available event points within the CodeIgniter core code: -* **pre_system** Called early during system execution. The URI, Request, and - Response have been instantiated, but page cache checking, routing, and execution - of "before" controller filters have not yet occurred. +* **pre_system** Called very early during system execution. Only the benchmark and events class have been loaded at this point. No routing or other processes have happened. * **post_controller_constructor** Called immediately after your controller is instantiated, but prior to any method calls happening. -* **post_system** Called right before the final rendered page is sent to the browser, - at the end of system execution, after the execution of "after" controller filters. +* **post_system** Called after the final rendered page is sent to the browser, at the end of system execution after the finalized data is sent to the browser. * **email** Called after an email sent successfully from ``CodeIgniter\Email\Email``. Receives an array of the ``Email`` class's properties as a parameter. * **DBQuery** Called after a database query whether successful or not. Receives the ``Query`` object. * **migrate** Called after a successful migration call to ``latest()`` or ``regress()``. Receives the current properties of ``MigrationRunner`` as well as the name of the method. diff --git a/user_guide_src/source/installation/upgrade_4xx.rst b/user_guide_src/source/installation/upgrade_4xx.rst index bf7ba85fece6..ae645d26c1a9 100644 --- a/user_guide_src/source/installation/upgrade_4xx.rst +++ b/user_guide_src/source/installation/upgrade_4xx.rst @@ -153,12 +153,6 @@ Hooks - Instead of CI3's ``$hook['post_controller_constructor']`` you now use ``Events::on('post_controller_constructor', ['MyClass', 'MyFunction']);``, with the namespace ``CodeIgniter\Events\Events;``. - Events are always enabled, and are available globally. -- The hook point ``pre_controller`` and ``post_controller`` have been removed. - Use :doc:`../incoming/filters` instead. -- The hook point ``display_override`` and ``cache_override`` have been removed. - Because the base methods have been removed. -- The hook point ``post_system`` has moved just before sending the final rendered - page. Extending the Framework ======================= From e09cfec12dc37b017ffddc8934c647395a611923 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 18 Oct 2023 10:05:28 +0900 Subject: [PATCH 18/55] docs: fix incorrect descriptions for pre_system and post_system --- user_guide_src/source/extending/events.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/extending/events.rst b/user_guide_src/source/extending/events.rst index 74fe34b4fe70..0221657f8ff1 100644 --- a/user_guide_src/source/extending/events.rst +++ b/user_guide_src/source/extending/events.rst @@ -87,9 +87,12 @@ Event Points The following is a list of available event points within the CodeIgniter core code: -* **pre_system** Called very early during system execution. Only the benchmark and events class have been loaded at this point. No routing or other processes have happened. +* **pre_system** Called early during system execution. The URI, Request, and + Response have been instantiated, but page cache checking, routing, and execution + of "before" controller filters have not yet occurred. * **post_controller_constructor** Called immediately after your controller is instantiated, but prior to any method calls happening. -* **post_system** Called after the final rendered page is sent to the browser, at the end of system execution after the finalized data is sent to the browser. +* **post_system** Called right before the final rendered page is sent to the browser, + at the end of system execution, after the execution of "after" controller filters. * **email** Called after an email sent successfully from ``CodeIgniter\Email\Email``. Receives an array of the ``Email`` class's properties as a parameter. * **DBQuery** Called after a database query whether successful or not. Receives the ``Query`` object. * **migrate** Called after a successful migration call to ``latest()`` or ``regress()``. Receives the current properties of ``MigrationRunner`` as well as the name of the method. From bc6229ba6e7ff0f1e82fd44f83f1732a803b8749 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 18 Oct 2023 10:09:10 +0900 Subject: [PATCH 19/55] docs: add changelog --- user_guide_src/source/changelogs/v4.4.3.rst | 3 +++ user_guide_src/source/extending/events.rst | 2 ++ 2 files changed, 5 insertions(+) diff --git a/user_guide_src/source/changelogs/v4.4.3.rst b/user_guide_src/source/changelogs/v4.4.3.rst index 248b71790c05..9a70f3e17a9a 100644 --- a/user_guide_src/source/changelogs/v4.4.3.rst +++ b/user_guide_src/source/changelogs/v4.4.3.rst @@ -24,6 +24,9 @@ Deprecations Bugs Fixed ********** +- **UserGuide:** Fixed the descriptions for ``pre_system`` and ``post_system`` + in :ref:`event-points`. + See the repo's `CHANGELOG.md `_ for a complete list of bugs fixed. diff --git a/user_guide_src/source/extending/events.rst b/user_guide_src/source/extending/events.rst index 0221657f8ff1..7891249cdcf6 100644 --- a/user_guide_src/source/extending/events.rst +++ b/user_guide_src/source/extending/events.rst @@ -82,6 +82,8 @@ You can stop simulation by passing false: .. literalinclude:: events/008.php +.. _event-points: + Event Points ============ From f0f5713f84f14d7f9d4a254bf839371a6912beb1 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 19 Oct 2023 17:36:55 +0900 Subject: [PATCH 20/55] docs: add descriptions to upgrade_4xx Hooks --- user_guide_src/source/installation/upgrade_4xx.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/user_guide_src/source/installation/upgrade_4xx.rst b/user_guide_src/source/installation/upgrade_4xx.rst index ae645d26c1a9..bf7ba85fece6 100644 --- a/user_guide_src/source/installation/upgrade_4xx.rst +++ b/user_guide_src/source/installation/upgrade_4xx.rst @@ -153,6 +153,12 @@ Hooks - Instead of CI3's ``$hook['post_controller_constructor']`` you now use ``Events::on('post_controller_constructor', ['MyClass', 'MyFunction']);``, with the namespace ``CodeIgniter\Events\Events;``. - Events are always enabled, and are available globally. +- The hook point ``pre_controller`` and ``post_controller`` have been removed. + Use :doc:`../incoming/filters` instead. +- The hook point ``display_override`` and ``cache_override`` have been removed. + Because the base methods have been removed. +- The hook point ``post_system`` has moved just before sending the final rendered + page. Extending the Framework ======================= From 58b67f79df798533d0a5b6556d1af195c3f7dc33 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:43:45 +0000 Subject: [PATCH 21/55] chore(deps): bump actions/setup-node from 3.0.0 to 4.0.0 Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3.0.0 to 4.0.0. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v3.0.0...v4.0.0) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/test-scss.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-scss.yml b/.github/workflows/test-scss.yml index 417eede8f344..e93455d3a050 100644 --- a/.github/workflows/test-scss.yml +++ b/.github/workflows/test-scss.yml @@ -36,7 +36,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Node - uses: actions/setup-node@v3.0.0 + uses: actions/setup-node@v4.0.0 with: # node version based on dart-sass test workflow node-version: 16 From cfe8b0986eac213508f45da346169933b45f8048 Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 24 Oct 2023 08:46:27 +0900 Subject: [PATCH 22/55] docs: add new section titles "Confirming Namespaces" and "Application Namespace" --- user_guide_src/source/concepts/autoloader.rst | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/user_guide_src/source/concepts/autoloader.rst b/user_guide_src/source/concepts/autoloader.rst index 22722716661b..1a354208bf17 100644 --- a/user_guide_src/source/concepts/autoloader.rst +++ b/user_guide_src/source/concepts/autoloader.rst @@ -42,8 +42,10 @@ Configuration Initial configuration is done in **app/Config/Autoload.php**. This file contains two primary arrays: one for the classmap, and one for PSR-4 compatible namespaces. +.. _autoloader-namespaces: + Namespaces -********** +========== The recommended method for organizing your classes is to create one or more namespaces for your application's files. This is most important for any business-logic related classes, entity classes, @@ -55,11 +57,19 @@ those classes can be found in: The key of each row is the namespace itself. This does not need a trailing back slash. The value is the location to the directory the classes can be found in. -.. note:: You can check the namespace configuration by ``spark namespaces`` command: +.. _confirming-namespaces: + +Confirming Namespaces +===================== + +You can check the namespace configuration by ``spark namespaces`` command: + +.. code-block:: console - .. code-block:: console + php spark namespaces - php spark namespaces +Application Namespace +===================== By default, the application directory is namespace to the ``App`` namespace. You must namespace the controllers, libraries, or models in the application directory, and they will be found under the ``App`` namespace. @@ -77,7 +87,7 @@ You will need to modify any existing files that are referencing the current name namespace has changed. Classmap -******** +======== The classmap is used extensively by CodeIgniter to eke the last ounces of performance out of the system by not hitting the file-system with extra ``is_file()`` calls. You can use the classmap to link to From 1ab584536e4785e406d270d2a294e28ba470a55c Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 24 Oct 2023 08:48:12 +0900 Subject: [PATCH 23/55] docs: add link to function page --- user_guide_src/source/general/modules.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/general/modules.rst b/user_guide_src/source/general/modules.rst index 2a6df4aa7b2e..c2173792ab4a 100644 --- a/user_guide_src/source/general/modules.rst +++ b/user_guide_src/source/general/modules.rst @@ -240,8 +240,9 @@ For Windows: Helpers ======= -Helpers will be automatically discovered within defined namespaces when using the ``helper()`` function, as long as it -is within the namespaces **Helpers** directory: +Helpers will be automatically discovered within defined namespaces when using the +:php:func:`helper()` function, as long as it is within the namespaces **Helpers** +directory: .. literalinclude:: modules/009.php From bb1369a231ff00d8f3fd8230b45519631f9fe9fc Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 24 Oct 2023 08:48:32 +0900 Subject: [PATCH 24/55] docs: add link to "Helper Functions" --- user_guide_src/source/helpers/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide_src/source/helpers/index.rst b/user_guide_src/source/helpers/index.rst index 7efa4cd069fb..82c8c992a0bf 100644 --- a/user_guide_src/source/helpers/index.rst +++ b/user_guide_src/source/helpers/index.rst @@ -3,6 +3,7 @@ Helpers ####### Helpers are collections of useful procedural functions. +See also :doc:`../general/helpers`. .. toctree:: :glob: From fa31844349cd568e290731fa0e6dfe7136ba5d35 Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 24 Oct 2023 08:49:19 +0900 Subject: [PATCH 25/55] docs: fix description for helper loading and add "Auto-Discovery and Composer Packages" --- user_guide_src/source/general/helpers.rst | 41 ++++++++++++++++------- user_guide_src/source/general/modules.rst | 2 +- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/user_guide_src/source/general/helpers.rst b/user_guide_src/source/general/helpers.rst index 6eadb9be6957..88accffd47b3 100644 --- a/user_guide_src/source/general/helpers.rst +++ b/user_guide_src/source/general/helpers.rst @@ -28,17 +28,17 @@ in your :doc:`controller <../incoming/controllers>` and :doc:`views <../outgoing/views>`. Helpers are typically stored in your **system/Helpers**, or -**app/Helpers** directory. CodeIgniter will look first in your -**app/Helpers** directory. If the directory does not exist or the -specified helper is not located there CI will instead look in your -global **system/Helpers** directory. +**app/Helpers** directory. -**************** -Loading a Helper -**************** +*************** +Loading Helpers +*************** .. note:: The URL helper is always loaded so you do not need to load it yourself. +Loading a Helper +================ + Loading a helper file is quite simple using the following method: .. literalinclude:: helpers/001.php @@ -58,6 +58,23 @@ For example, to load the **Cookie Helper** file, which is named .. note:: The Helper loading method above does not return a value, so don't try to assign it to a variable. Just use it as shown. +Auto-Discovery and Composer Packages +------------------------------------ + +By default, CodeIgniter will search for the helper files in all defined namespaces +by :ref:`auto-discovery`. +You can check your defined namespaces by the spark command. See :ref:`confirming-namespaces`. + +If you use many Composer packages, you will have many defined namespaces. +CodeIgniter will scan all namespaces by default. + +To avoid wasting time scanning for irrelevant Composer packages, you can manually +specify packages for Auto-Discovery. See :ref:`modules-specify-composer-packages` +for details. + +Or you can :ref:`specify a namespace ` +for a helper that you want to load. + Loading Multiple Helpers ======================== @@ -81,14 +98,14 @@ it. However if you want to load in your controller constructor, you can use the ``$helpers`` property in Controller instead. See :ref:`Controllers `. -.. _helpers-loading-from-non-standard-locations: +.. _helpers-loading-from-specified-namespace: -Loading from Non-standard Locations -=================================== +Loading from Specified Namespace +================================ Helpers can be loaded from directories outside of **app/Helpers** and -**system/Helpers**, as long as that path can be found through a namespace that -has been set up within the PSR-4 section of the :doc:`Autoloader config file <../concepts/autoloader>`. +**system/Helpers**, as long as that path can be found in defined namespaces. + You would prefix the name of the Helper with the namespace that it can be located in. Within that namespaced directory, the loader expects it to live within a sub-directory named **Helpers**. An example will help understand this. diff --git a/user_guide_src/source/general/modules.rst b/user_guide_src/source/general/modules.rst index c2173792ab4a..4e5c72a9fa9b 100644 --- a/user_guide_src/source/general/modules.rst +++ b/user_guide_src/source/general/modules.rst @@ -246,7 +246,7 @@ directory: .. literalinclude:: modules/009.php -You can specify namespaces. See :ref:`helpers-loading-from-non-standard-locations` for details. +You can specify namespaces. See :ref:`helpers-loading-from-specified-namespace` for details. Language Files ============== From 59ae2e62ed33028431ae14e37db1856a20950de3 Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 24 Oct 2023 08:49:59 +0900 Subject: [PATCH 26/55] docs: fix typo in doc comment --- system/Common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/Common.php b/system/Common.php index ebfd8e2565e8..80dca72c74e3 100644 --- a/system/Common.php +++ b/system/Common.php @@ -579,7 +579,7 @@ function function_usable(string $functionName): bool if (! function_exists('helper')) { /** * Loads a helper file into memory. Supports namespaced helpers, - * both in and out of the 'helpers' directory of a namespaced directory. + * both in and out of the 'Helpers' directory of a namespaced directory. * * Will load ALL helpers of the matching name, in the following order: * 1. app/Helpers From fde934ee87485d0b0e47b074690d99fcc0040bec Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 24 Oct 2023 11:06:51 +0900 Subject: [PATCH 27/55] docs: fix typo --- user_guide_src/source/libraries/validation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/libraries/validation.rst b/user_guide_src/source/libraries/validation.rst index 7a26a41d49fc..739d51b3fe6a 100644 --- a/user_guide_src/source/libraries/validation.rst +++ b/user_guide_src/source/libraries/validation.rst @@ -997,5 +997,5 @@ is_image Yes Fails if the file cannot be determined to be The file validation rules apply for both single and multiple file uploads. .. note:: Only rules specifically created for file validation (like the ones listed in the table above) can be used to validate files. - Therefore, adding any general rules, like ``permit_empy``, to file validation rules array or string, the file validation will not + Therefore, adding any general rules, like ``permit_empty``, to file validation rules array or string, the file validation will not work correctly. From dc55d41c64c4486928427b2f61c2af4a4de63fd0 Mon Sep 17 00:00:00 2001 From: Samuel Asor <8720569+sammyskills@users.noreply.github.com> Date: Sun, 22 Oct 2023 23:52:16 +0100 Subject: [PATCH 28/55] add dbgroup to model template only when specified as an option --- system/Commands/Generators/ModelGenerator.php | 10 ++++++---- system/Commands/Generators/Views/model.tpl.php | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/system/Commands/Generators/ModelGenerator.php b/system/Commands/Generators/ModelGenerator.php index b4b7ffcda2ca..1e17b6639f85 100644 --- a/system/Commands/Generators/ModelGenerator.php +++ b/system/Commands/Generators/ModelGenerator.php @@ -101,9 +101,11 @@ protected function prepare(string $class): string $baseClass = $match[1]; } - $table = is_string($table) ? $table : plural(strtolower($baseClass)); - $dbGroup = is_string($dbGroup) ? $dbGroup : 'default'; - $return = is_string($return) ? $return : 'array'; + // Add or remove the DBGroup line based on the presence of the dbgroup option + $addDBGroupLine = is_string($dbGroup) ? true : false; + + $table = is_string($table) ? $table : plural(strtolower($baseClass)); + $return = is_string($return) ? $return : 'array'; if (! in_array($return, ['array', 'object', 'entity'], true)) { // @codeCoverageIgnoreStart @@ -129,6 +131,6 @@ protected function prepare(string $class): string $return = "'{$return}'"; } - return $this->parseTemplate($class, ['{table}', '{dbGroup}', '{return}'], [$table, $dbGroup, $return]); + return $this->parseTemplate($class, ['{dbGroup}', '{table}', '{return}'], [$dbGroup, $table, $return], compact('addDBGroupLine')); } } diff --git a/system/Commands/Generators/Views/model.tpl.php b/system/Commands/Generators/Views/model.tpl.php index ca6d0ec8b954..7bf7676f320f 100644 --- a/system/Commands/Generators/Views/model.tpl.php +++ b/system/Commands/Generators/Views/model.tpl.php @@ -6,7 +6,9 @@ class {class} extends Model { + protected $DBGroup = '{dbGroup}'; + protected $table = '{table}'; protected $primaryKey = 'id'; protected $useAutoIncrement = true; From fc8b0364f2d4b08159aadfa70aaed4d41894ef21 Mon Sep 17 00:00:00 2001 From: Samuel Asor <8720569+sammyskills@users.noreply.github.com> Date: Mon, 23 Oct 2023 00:00:42 +0100 Subject: [PATCH 29/55] applied rector fix --- system/Commands/Generators/ModelGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/Commands/Generators/ModelGenerator.php b/system/Commands/Generators/ModelGenerator.php index 1e17b6639f85..cb22ffbbf963 100644 --- a/system/Commands/Generators/ModelGenerator.php +++ b/system/Commands/Generators/ModelGenerator.php @@ -102,7 +102,7 @@ protected function prepare(string $class): string } // Add or remove the DBGroup line based on the presence of the dbgroup option - $addDBGroupLine = is_string($dbGroup) ? true : false; + $addDBGroupLine = is_string($dbGroup); $table = is_string($table) ? $table : plural(strtolower($baseClass)); $return = is_string($return) ? $return : 'array'; From 10815db9eb352de5f0aa9c0ce2fc44eeab433a6c Mon Sep 17 00:00:00 2001 From: Samuel Asor <8720569+sammyskills@users.noreply.github.com> Date: Mon, 23 Oct 2023 00:05:33 +0100 Subject: [PATCH 30/55] fixed phpunit failure --- tests/system/Commands/ModelGeneratorTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/system/Commands/ModelGeneratorTest.php b/tests/system/Commands/ModelGeneratorTest.php index e6ca050d553b..e1b3c4ae354a 100644 --- a/tests/system/Commands/ModelGeneratorTest.php +++ b/tests/system/Commands/ModelGeneratorTest.php @@ -52,7 +52,6 @@ public function testGenerateModel(): void $this->assertFileExists($file); $this->assertStringContainsString('extends Model', $this->getFileContent($file)); $this->assertStringContainsString('protected $table = \'users\';', $this->getFileContent($file)); - $this->assertStringContainsString('protected $DBGroup = \'default\';', $this->getFileContent($file)); $this->assertStringContainsString('protected $returnType = \'array\';', $this->getFileContent($file)); } From 23eb997a61730857e7e4375aceae76b3f953c717 Mon Sep 17 00:00:00 2001 From: Samuel Asor <8720569+sammyskills@users.noreply.github.com> Date: Tue, 24 Oct 2023 09:16:28 +0100 Subject: [PATCH 31/55] applied code review suggestion --- system/Commands/Generators/ModelGenerator.php | 5 +---- system/Commands/Generators/Views/model.tpl.php | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/system/Commands/Generators/ModelGenerator.php b/system/Commands/Generators/ModelGenerator.php index cb22ffbbf963..eb0a1aa9802f 100644 --- a/system/Commands/Generators/ModelGenerator.php +++ b/system/Commands/Generators/ModelGenerator.php @@ -101,9 +101,6 @@ protected function prepare(string $class): string $baseClass = $match[1]; } - // Add or remove the DBGroup line based on the presence of the dbgroup option - $addDBGroupLine = is_string($dbGroup); - $table = is_string($table) ? $table : plural(strtolower($baseClass)); $return = is_string($return) ? $return : 'array'; @@ -131,6 +128,6 @@ protected function prepare(string $class): string $return = "'{$return}'"; } - return $this->parseTemplate($class, ['{dbGroup}', '{table}', '{return}'], [$dbGroup, $table, $return], compact('addDBGroupLine')); + return $this->parseTemplate($class, ['{dbGroup}', '{table}', '{return}'], [$dbGroup, $table, $return], compact('dbGroup')); } } diff --git a/system/Commands/Generators/Views/model.tpl.php b/system/Commands/Generators/Views/model.tpl.php index 7bf7676f320f..b9b9c99eb560 100644 --- a/system/Commands/Generators/Views/model.tpl.php +++ b/system/Commands/Generators/Views/model.tpl.php @@ -6,7 +6,7 @@ class {class} extends Model { - + protected $DBGroup = '{dbGroup}'; protected $table = '{table}'; From 26a3e75fe19bce3340d2f44cfdbfa7be61cdebf8 Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 24 Oct 2023 18:58:12 +0900 Subject: [PATCH 32/55] test: add tests for exact_length --- tests/system/Validation/RulesTest.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/system/Validation/RulesTest.php b/tests/system/Validation/RulesTest.php index f031a129a286..23358d08904b 100644 --- a/tests/system/Validation/RulesTest.php +++ b/tests/system/Validation/RulesTest.php @@ -398,8 +398,10 @@ public function testMaxLengthReturnsFalseWithNonNumericVal(): void /** * @dataProvider provideExactLength + * + * @param int|string|null $data */ - public function testExactLength(?string $data, bool $expected): void + public function testExactLength($data, bool $expected): void { $this->validation->setRules(['foo' => 'exact_length[3]']); $this->assertSame($expected, $this->validation->run(['foo' => $data])); @@ -408,10 +410,13 @@ public function testExactLength(?string $data, bool $expected): void public static function provideExactLength(): iterable { yield from [ - 'null' => [null, false], - 'exact' => ['bar', true], - 'less' => ['ba', false], - 'greater' => ['bars', false], + 'null' => [null, false], + 'exact' => ['bar', true], + 'exact_int' => [123, true], + 'less' => ['ba', false], + 'less_int' => [12, false], + 'greater' => ['bars', false], + 'greater_int' => [1234, false], ]; } From 391723b1c8ffc9ac56cd0fd174a2e56f85413ce5 Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 24 Oct 2023 18:58:42 +0900 Subject: [PATCH 33/55] fix: exact_length does not validate int values --- system/Validation/StrictRules/Rules.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/system/Validation/StrictRules/Rules.php b/system/Validation/StrictRules/Rules.php index 7043646c1f58..0887eff28ada 100644 --- a/system/Validation/StrictRules/Rules.php +++ b/system/Validation/StrictRules/Rules.php @@ -63,6 +63,10 @@ public function equals($str, string $val): bool */ public function exact_length($str, string $val): bool { + if (is_int($str) || is_float($str)) { + $str = (string) $str; + } + if (! is_string($str)) { return false; } From 3808925b5b68ab050004024d9aaf2186f3966197 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 15:16:17 +0000 Subject: [PATCH 34/55] chore(deps-dev): update rector/rector requirement from 0.18.5 to 0.18.6 Updates the requirements on [rector/rector](https://github.com/rectorphp/rector) to permit the latest version. - [Release notes](https://github.com/rectorphp/rector/releases) - [Commits](https://github.com/rectorphp/rector/compare/0.18.5...0.18.6) --- updated-dependencies: - dependency-name: rector/rector dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index cd134a93f9bd..0151c1f982a8 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "phpunit/phpcov": "^8.2", "phpunit/phpunit": "^9.1", "predis/predis": "^1.1 || ^2.0", - "rector/rector": "0.18.5", + "rector/rector": "0.18.6", "vimeo/psalm": "^5.0" }, "suggest": { From 2969640d4a4bf2cf4d345e98faee6d42979e25b9 Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Sat, 21 Oct 2023 15:54:00 +0800 Subject: [PATCH 35/55] Update phpstan-codeigniter to v1.4.1 --- composer.json | 2 +- phpstan.neon.dist | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 0151c1f982a8..9e0288c26f6b 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ }, "require-dev": { "codeigniter/coding-standard": "^1.5", - "codeigniter/phpstan-codeigniter": "^v1.1", + "codeigniter/phpstan-codeigniter": "^1.4", "ergebnis/composer-normalize": "^2.28", "fakerphp/faker": "^1.9", "kint-php/kint": "^5.0.4", diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 1fcd28307cf5..4041710fb703 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -38,6 +38,3 @@ parameters: booleansInConditions: true disallowedConstructs: true matchingInheritedMethodNames: true - codeigniter: - additionalConfigNamespaces: - - CodeIgniter\Config\ From 94130de237e84aee778ca88604da6c0ac527356c Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Sat, 21 Oct 2023 15:59:29 +0800 Subject: [PATCH 36/55] Fix Modules does not extend BaseConfig --- phpstan-baseline.php | 10 ---------- system/Config/BaseConfig.php | 2 +- system/Config/BaseService.php | 8 ++------ .../Cache/FactoriesCacheFileVarExportHandlerTest.php | 2 -- 4 files changed, 3 insertions(+), 19 deletions(-) diff --git a/phpstan-baseline.php b/phpstan-baseline.php index d1c574463f58..0d372afdb97c 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -871,16 +871,6 @@ 'count' => 4, 'path' => __DIR__ . '/system/Config/BaseConfig.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Argument \\#1 \\$name \\(\'Config\\\\\\\\Modules\'\\) passed to function config does not extend CodeIgniter\\\\\\\\Config\\\\\\\\BaseConfig\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Config/BaseConfig.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Argument \\#1 \\$name \\(\'Config\\\\\\\\Modules\'\\) passed to function config does not extend CodeIgniter\\\\\\\\Config\\\\\\\\BaseConfig\\.$#', - 'count' => 2, - 'path' => __DIR__ . '/system/Config/BaseService.php', -]; $ignoreErrors[] = [ 'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#', 'count' => 3, diff --git a/system/Config/BaseConfig.php b/system/Config/BaseConfig.php index 87166737e746..b4b9a4a21349 100644 --- a/system/Config/BaseConfig.php +++ b/system/Config/BaseConfig.php @@ -82,7 +82,7 @@ public static function __set_state(array $array) */ public function __construct() { - static::$moduleConfig = config(Modules::class); + static::$moduleConfig = new Modules(); if (! static::$override) { return; diff --git a/system/Config/BaseService.php b/system/Config/BaseService.php index b66b8c9f535e..22daf7b69e4b 100644 --- a/system/Config/BaseService.php +++ b/system/Config/BaseService.php @@ -330,9 +330,7 @@ public static function injectMock(string $name, $mock) protected static function discoverServices(string $name, array $arguments) { if (! static::$discovered) { - $config = config(Modules::class); - - if ($config->shouldDiscover('services')) { + if ((new Modules())->shouldDiscover('services')) { $locator = static::locator(); $files = $locator->search('Config/Services'); @@ -372,9 +370,7 @@ protected static function discoverServices(string $name, array $arguments) protected static function buildServicesCache(): void { if (! static::$discovered) { - $config = config(Modules::class); - - if ($config->shouldDiscover('services')) { + if ((new Modules())->shouldDiscover('services')) { $locator = static::locator(); $files = $locator->search('Config/Services'); diff --git a/tests/system/Cache/FactoriesCacheFileVarExportHandlerTest.php b/tests/system/Cache/FactoriesCacheFileVarExportHandlerTest.php index a3aff35b000e..8a2dba00703b 100644 --- a/tests/system/Cache/FactoriesCacheFileVarExportHandlerTest.php +++ b/tests/system/Cache/FactoriesCacheFileVarExportHandlerTest.php @@ -15,7 +15,6 @@ use CodeIgniter\Config\Factories; use CodeIgniter\Test\CIUnitTestCase; use Config\App; -use Config\Modules; /** * @internal @@ -58,7 +57,6 @@ public function testSave() $this->assertArrayHasKey('aliases', $cachedData); $this->assertArrayHasKey('instances', $cachedData); - $this->assertArrayHasKey(Modules::class, $cachedData['aliases']); $this->assertArrayHasKey('App', $cachedData['aliases']); } From 89f1cc68ed44a7208d478ab3779b7118abf9a0c0 Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Sun, 22 Oct 2023 19:02:06 +0800 Subject: [PATCH 37/55] Inject Modules into constructor --- system/Config/BaseConfig.php | 4 +-- tests/system/Config/BaseConfigTest.php | 36 +++++++++++++------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/system/Config/BaseConfig.php b/system/Config/BaseConfig.php index b4b9a4a21349..0269194bdc4c 100644 --- a/system/Config/BaseConfig.php +++ b/system/Config/BaseConfig.php @@ -80,9 +80,9 @@ public static function __set_state(array $array) * * The "shortPrefix" is the lowercase-only config class name. */ - public function __construct() + public function __construct(?Modules $modules = null) { - static::$moduleConfig = new Modules(); + static::$moduleConfig = $modules ?? new Modules(); if (! static::$override) { return; diff --git a/tests/system/Config/BaseConfigTest.php b/tests/system/Config/BaseConfigTest.php index 2da390392ed6..ca615602a276 100644 --- a/tests/system/Config/BaseConfigTest.php +++ b/tests/system/Config/BaseConfigTest.php @@ -11,8 +11,11 @@ namespace CodeIgniter\Config; +use CodeIgniter\Autoloader\FileLocator; use CodeIgniter\Test\CIUnitTestCase; +use Config\Modules; use Encryption; +use PHPUnit\Framework\MockObject\MockObject; use RegistrarConfig; use RuntimeException; use SimpleConfig; @@ -45,6 +48,8 @@ protected function setUp(): void if (! class_exists('Encryption', false)) { require $this->fixturesFolder . '/Encryption.php'; } + + BaseConfig::$registrars = []; } public function testBasicValues(): void @@ -265,32 +270,27 @@ public function testBadRegistrar(): void $this->assertSame('bar', $config->foo); } - public function testNotEnabled(): void + public function testDiscoveryNotEnabledWillNotPopulateRegistrarsArray(): void { - $modulesConfig = config('Modules'); - $modulesConfig->enabled = false; - - $config = new RegistrarConfig(); - $config::$registrars = []; - $expected = $config::$registrars; + /** @var MockObject&Modules $modules */ + $modules = $this->createMock(Modules::class); + $modules->method('shouldDiscover')->with('registrars')->willReturn(false); - $method = $this->getPrivateMethodInvoker($config, 'registerProperties'); - $method(); + $config = new RegistrarConfig($modules); - $this->assertSame($expected, $config::$registrars); + $this->assertSame([], $config::$registrars); } - public function testDidDiscovery(): void + public function testRedoingDiscoveryWillStillSetDidDiscoveryPropertyToTrue(): void { - $modulesConfig = config('Modules'); - $modulesConfig->enabled = true; + /** @var FileLocator&MockObject $locator */ + $locator = $this->createMock(FileLocator::class); + $locator->method('search')->with('Config/Registrar.php')->willReturn([]); + Services::injectMock('locator', $locator); - $config = new RegistrarConfig(); - $config::$registrars = []; + $config = new RegistrarConfig(); $this->setPrivateProperty($config, 'didDiscovery', false); - - $method = $this->getPrivateMethodInvoker($config, 'registerProperties'); - $method(); + ($this->getPrivateMethodInvoker($config, 'registerProperties'))(); $this->assertTrue($this->getPrivateProperty($config, 'didDiscovery')); } From 314210848d990d26420fab5d53bba88c626a4d24 Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Tue, 24 Oct 2023 11:34:32 +0800 Subject: [PATCH 38/55] Use static setter --- system/Config/BaseConfig.php | 15 ++++++++++++--- tests/system/Config/BaseConfigTest.php | 4 +++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/system/Config/BaseConfig.php b/system/Config/BaseConfig.php index 0269194bdc4c..7daa6e1544c0 100644 --- a/system/Config/BaseConfig.php +++ b/system/Config/BaseConfig.php @@ -55,7 +55,7 @@ class BaseConfig /** * The modules configuration. * - * @var Modules + * @var Modules|null */ protected static $moduleConfig; @@ -74,15 +74,24 @@ public static function __set_state(array $array) return $obj; } + /** + * @internal For testing purposes only. + * @testTag + */ + public static function setModules(Modules $modules): void + { + static::$moduleConfig = $modules; + } + /** * Will attempt to get environment variables with names * that match the properties of the child class. * * The "shortPrefix" is the lowercase-only config class name. */ - public function __construct(?Modules $modules = null) + public function __construct() { - static::$moduleConfig = $modules ?? new Modules(); + static::$moduleConfig ??= new Modules(); if (! static::$override) { return; diff --git a/tests/system/Config/BaseConfigTest.php b/tests/system/Config/BaseConfigTest.php index ca615602a276..76861ccb12ad 100644 --- a/tests/system/Config/BaseConfigTest.php +++ b/tests/system/Config/BaseConfigTest.php @@ -50,6 +50,7 @@ protected function setUp(): void } BaseConfig::$registrars = []; + BaseConfig::setModules(new Modules()); // reset to clean copy of Modules } public function testBasicValues(): void @@ -276,7 +277,8 @@ public function testDiscoveryNotEnabledWillNotPopulateRegistrarsArray(): void $modules = $this->createMock(Modules::class); $modules->method('shouldDiscover')->with('registrars')->willReturn(false); - $config = new RegistrarConfig($modules); + RegistrarConfig::setModules($modules); + $config = new RegistrarConfig(); $this->assertSame([], $config::$registrars); } From 61bbbca81163dfc61af410972395de9cd905e637 Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Wed, 25 Oct 2023 09:02:56 +0800 Subject: [PATCH 39/55] Simplify test --- tests/system/Config/BaseConfigTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/system/Config/BaseConfigTest.php b/tests/system/Config/BaseConfigTest.php index 76861ccb12ad..958387cc6b6d 100644 --- a/tests/system/Config/BaseConfigTest.php +++ b/tests/system/Config/BaseConfigTest.php @@ -290,9 +290,9 @@ public function testRedoingDiscoveryWillStillSetDidDiscoveryPropertyToTrue(): vo $locator->method('search')->with('Config/Registrar.php')->willReturn([]); Services::injectMock('locator', $locator); + $this->setPrivateProperty(RegistrarConfig::class, 'didDiscovery', false); + $config = new RegistrarConfig(); - $this->setPrivateProperty($config, 'didDiscovery', false); - ($this->getPrivateMethodInvoker($config, 'registerProperties'))(); $this->assertTrue($this->getPrivateProperty($config, 'didDiscovery')); } From c64959eb84b6b44e154248d3aceb4c21664a2643 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 26 Oct 2023 05:45:40 +0900 Subject: [PATCH 40/55] docs: fix by proofreading Co-authored-by: MGatner --- user_guide_src/source/models/model.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/models/model.rst b/user_guide_src/source/models/model.rst index 880adfc0d9cb..db4ecd80b59d 100644 --- a/user_guide_src/source/models/model.rst +++ b/user_guide_src/source/models/model.rst @@ -69,7 +69,7 @@ Connecting to the Database ========================== When the class is first instantiated, if no database connection instance is passed to the constructor, -and if you don't set the ``$DBGroup`` property to your model class, +and if you don't set the ``$DBGroup`` property on your model class, it will automatically connect to the default database group, as set in the database configuration. You can From ccbddae5b46c6c694c4a4da1a360ecdeb697c62c Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 26 Oct 2023 07:13:09 +0900 Subject: [PATCH 41/55] test: reset state after testing Mocks should be removed. --- tests/system/Config/BaseConfigTest.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/system/Config/BaseConfigTest.php b/tests/system/Config/BaseConfigTest.php index 958387cc6b6d..c9780454b497 100644 --- a/tests/system/Config/BaseConfigTest.php +++ b/tests/system/Config/BaseConfigTest.php @@ -276,11 +276,14 @@ public function testDiscoveryNotEnabledWillNotPopulateRegistrarsArray(): void /** @var MockObject&Modules $modules */ $modules = $this->createMock(Modules::class); $modules->method('shouldDiscover')->with('registrars')->willReturn(false); - RegistrarConfig::setModules($modules); + $config = new RegistrarConfig(); $this->assertSame([], $config::$registrars); + + // Reset Modules Config. + RegistrarConfig::setModules(new Modules()); } public function testRedoingDiscoveryWillStillSetDidDiscoveryPropertyToTrue(): void @@ -295,5 +298,8 @@ public function testRedoingDiscoveryWillStillSetDidDiscoveryPropertyToTrue(): vo $config = new RegistrarConfig(); $this->assertTrue($this->getPrivateProperty($config, 'didDiscovery')); + + // Reset locator. + $this->resetServices(); } } From bfecd50ae0327292f5253d23a354e70483e48181 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 26 Oct 2023 07:23:57 +0900 Subject: [PATCH 42/55] docs: add @psalm-suppress --- tests/system/Config/BaseConfigTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/system/Config/BaseConfigTest.php b/tests/system/Config/BaseConfigTest.php index c9780454b497..94d60577e44a 100644 --- a/tests/system/Config/BaseConfigTest.php +++ b/tests/system/Config/BaseConfigTest.php @@ -271,6 +271,9 @@ public function testBadRegistrar(): void $this->assertSame('bar', $config->foo); } + /** + * @psalm-suppress UndefinedClass + */ public function testDiscoveryNotEnabledWillNotPopulateRegistrarsArray(): void { /** @var MockObject&Modules $modules */ @@ -286,6 +289,9 @@ public function testDiscoveryNotEnabledWillNotPopulateRegistrarsArray(): void RegistrarConfig::setModules(new Modules()); } + /** + * @psalm-suppress UndefinedClass + */ public function testRedoingDiscoveryWillStillSetDidDiscoveryPropertyToTrue(): void { /** @var FileLocator&MockObject $locator */ From 469eef4e6fb11de778088d10d76e7de3ea87a305 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 26 Oct 2023 14:40:18 +0900 Subject: [PATCH 43/55] feat: add reset() for testing --- system/Config/BaseConfig.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/system/Config/BaseConfig.php b/system/Config/BaseConfig.php index 7daa6e1544c0..5dd6cde2ad02 100644 --- a/system/Config/BaseConfig.php +++ b/system/Config/BaseConfig.php @@ -83,6 +83,18 @@ public static function setModules(Modules $modules): void static::$moduleConfig = $modules; } + /** + * @internal For testing purposes only. + * @testTag + */ + public static function reset(): void + { + static::$registrars = []; + static::$override = true; + static::$didDiscovery = false; + static::$moduleConfig = null; + } + /** * Will attempt to get environment variables with names * that match the properties of the child class. From f42244fc64a93581cf6e9b90e35e2751378deaa4 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 26 Oct 2023 14:43:52 +0900 Subject: [PATCH 44/55] test: add tearDown() and tweak setUp() --- tests/system/Config/BaseConfigTest.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/system/Config/BaseConfigTest.php b/tests/system/Config/BaseConfigTest.php index 94d60577e44a..7c05af3a390e 100644 --- a/tests/system/Config/BaseConfigTest.php +++ b/tests/system/Config/BaseConfigTest.php @@ -49,8 +49,17 @@ protected function setUp(): void require $this->fixturesFolder . '/Encryption.php'; } - BaseConfig::$registrars = []; - BaseConfig::setModules(new Modules()); // reset to clean copy of Modules + BaseConfig::reset(); + } + + protected function tearDown(): void + { + parent::tearDown(); + + // This test modifies BaseConfig::$modules, so should reset. + BaseConfig::reset(); + // This test modifies Services locator, so should reset. + $this->resetServices(); } public function testBasicValues(): void @@ -284,9 +293,6 @@ public function testDiscoveryNotEnabledWillNotPopulateRegistrarsArray(): void $config = new RegistrarConfig(); $this->assertSame([], $config::$registrars); - - // Reset Modules Config. - RegistrarConfig::setModules(new Modules()); } /** @@ -304,8 +310,5 @@ public function testRedoingDiscoveryWillStillSetDidDiscoveryPropertyToTrue(): vo $config = new RegistrarConfig(); $this->assertTrue($this->getPrivateProperty($config, 'didDiscovery')); - - // Reset locator. - $this->resetServices(); } } From 4c0eab55ef6da3235c23b6a32dda8ab02ac876bb Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 27 Oct 2023 05:32:27 +0900 Subject: [PATCH 45/55] test: remove unneeded table template --- tests/system/View/TableTest.php | 37 +-------------------------------- 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/tests/system/View/TableTest.php b/tests/system/View/TableTest.php index 1eb0939fa1c3..f4d7f4056f2d 100644 --- a/tests/system/View/TableTest.php +++ b/tests/system/View/TableTest.php @@ -822,42 +822,7 @@ public static function orderedColumnUsecases(): iterable */ public function testGenerateTableWithHeadingContainFieldNamedData(): void { - $tableTemplate = [ - 'table_open' => '', - - 'thead_open' => '', - 'thead_close' => '', - - 'heading_row_start' => '', - 'heading_row_end' => '', - 'heading_cell_start' => '', - - 'tfoot_open' => '', - 'tfoot_close' => '', - - 'footing_row_start' => '', - 'footing_row_end' => '', - 'footing_cell_start' => '', - - 'tbody_open' => '', - 'tbody_close' => '', - - 'row_start' => '', - 'row_end' => '', - 'cell_start' => '', - - 'row_alt_start' => '', - 'row_alt_end' => '', - 'cell_alt_start' => '', - - 'table_close' => '
', - 'heading_cell_end' => '
', - 'footing_cell_end' => '
', - 'cell_end' => '
', - 'cell_alt_end' => '
', - ]; - - $table = new Table($tableTemplate); + $table = new Table(); $table->setHeading([ 'codigo' => 'Codigo Orçamento', 'data' => 'Data do Orçamento', From 1874e62fd15b8371c47404be4e954b56c8f443e7 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 25 Oct 2023 07:00:00 +0900 Subject: [PATCH 46/55] fix: detailed error report is displayed in production environment php > ini_set('display_errors', '0'); php > var_dump(ini_get('display_errors')); string(1) "0" php > ini_set('display_errors', 0); php > var_dump(ini_get('display_errors')); string(1) "0" php > ini_set('display_errors', false); php > var_dump(ini_get('display_errors')); string(0) "" php > ini_set('display_errors', null); php > var_dump(ini_get('display_errors')); string(0) "" php > ini_set('display_errors', 'off'); php > var_dump(ini_get('display_errors')); string(3) "off" --- app/Config/Boot/development.php | 2 ++ app/Config/Boot/production.php | 2 ++ system/Debug/ExceptionHandler.php | 8 +++++++- system/Debug/Exceptions.php | 8 +++++++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/Config/Boot/development.php b/app/Config/Boot/development.php index 05a861258fc9..aa8099a46501 100644 --- a/app/Config/Boot/development.php +++ b/app/Config/Boot/development.php @@ -7,6 +7,8 @@ | In development, we want to show as many errors as possible to help | make sure they don't make it to production. And save us hours of | painful debugging. + | + | If you set 'display_errors' to '1', CI4's detailed error report will show. */ error_reporting(-1); ini_set('display_errors', '1'); diff --git a/app/Config/Boot/production.php b/app/Config/Boot/production.php index 21d25805674a..73c7c60afbc7 100644 --- a/app/Config/Boot/production.php +++ b/app/Config/Boot/production.php @@ -6,6 +6,8 @@ |-------------------------------------------------------------------------- | Don't show ANY in production environments. Instead, let the system catch | it and display a generic error message. + | + | If you set 'display_errors' to '1', CI4's detailed error report will show. */ ini_set('display_errors', '0'); error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); diff --git a/system/Debug/ExceptionHandler.php b/system/Debug/ExceptionHandler.php index 9fe40f33728c..46b855e5eca7 100644 --- a/system/Debug/ExceptionHandler.php +++ b/system/Debug/ExceptionHandler.php @@ -129,7 +129,13 @@ protected function determineView(Throwable $exception, string $templatePath): st // Production environments should have a custom exception file. $view = 'production.php'; - if (str_ireplace(['off', 'none', 'no', 'false', 'null'], '', ini_get('display_errors')) !== '') { + if ( + str_ireplace( + ['off', 'none', 'no', 'false', 'null', '0'], + '', + ini_get('display_errors') + ) !== '' + ) { $view = 'error_exception.php'; } diff --git a/system/Debug/Exceptions.php b/system/Debug/Exceptions.php index 885f98ae0b06..b127a58241b0 100644 --- a/system/Debug/Exceptions.php +++ b/system/Debug/Exceptions.php @@ -253,7 +253,13 @@ protected function determineView(Throwable $exception, string $templatePath): st $view = 'production.php'; $templatePath = rtrim($templatePath, '\\/ ') . DIRECTORY_SEPARATOR; - if (str_ireplace(['off', 'none', 'no', 'false', 'null'], '', ini_get('display_errors')) !== '') { + if ( + str_ireplace( + ['off', 'none', 'no', 'false', 'null', '0'], + '', + ini_get('display_errors') + ) !== '' + ) { $view = 'error_exception.php'; } From 1be8686535592738056ea2ad884d0ca79a7fed8c Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 25 Oct 2023 15:44:12 +0900 Subject: [PATCH 47/55] docs: add comments --- app/Config/Boot/testing.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Config/Boot/testing.php b/app/Config/Boot/testing.php index e07a1d43f43e..e84670e972f6 100644 --- a/app/Config/Boot/testing.php +++ b/app/Config/Boot/testing.php @@ -1,5 +1,11 @@ Date: Wed, 25 Oct 2023 16:21:07 +0900 Subject: [PATCH 48/55] fix: SHOW_DEBUG_BACKTRACE does not work in web --- app/Views/errors/html/error_exception.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Views/errors/html/error_exception.php b/app/Views/errors/html/error_exception.php index f311d910c0fa..1d1ac7bd87bb 100644 --- a/app/Views/errors/html/error_exception.php +++ b/app/Views/errors/html/error_exception.php @@ -44,6 +44,7 @@ +
    @@ -375,6 +376,7 @@
+ diff --git a/app/Views/errors/html/error_exception.php b/app/Views/errors/html/error_exception.php index 1d1ac7bd87bb..1c094d728872 100644 --- a/app/Views/errors/html/error_exception.php +++ b/app/Views/errors/html/error_exception.php @@ -67,7 +67,7 @@
  • - + Date: Wed, 25 Oct 2023 20:46:11 +0900 Subject: [PATCH 50/55] test: add test for determineView() --- tests/system/Debug/ExceptionHandlerTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/system/Debug/ExceptionHandlerTest.php b/tests/system/Debug/ExceptionHandlerTest.php index cd87eff739cf..1321f67195f3 100644 --- a/tests/system/Debug/ExceptionHandlerTest.php +++ b/tests/system/Debug/ExceptionHandlerTest.php @@ -70,6 +70,21 @@ public function testDetermineViewsRuntimeExceptionCode404(): void $this->assertSame('error_404.php', $viewFile); } + public function testDetermineViewsDisplayErrorsOffRuntimeException(): void + { + ini_set('display_errors', '0'); + + $determineView = $this->getPrivateMethodInvoker($this->handler, 'determineView'); + + $exception = new RuntimeException('Exception'); + $templatePath = APPPATH . 'Views/errors/html'; + $viewFile = $determineView($exception, $templatePath); + + $this->assertSame('production.php', $viewFile); + + ini_set('display_errors', '1'); + } + public function testCollectVars(): void { $collectVars = $this->getPrivateMethodInvoker($this->handler, 'collectVars'); From 2a99bdf3fcfa1fe5bd681a570cc80dc052554ae1 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 25 Oct 2023 20:55:12 +0900 Subject: [PATCH 51/55] docs: improve docs --- user_guide_src/source/general/environments.rst | 2 ++ user_guide_src/source/general/errors.rst | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst index 57e85c67c106..428894ad75b5 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -30,6 +30,8 @@ By default, CodeIgniter has three environments defined. If you want another environment, e.g., for staging, you can add custom environments. See `Adding Environments`_. +.. _setting-environment: + ******************* Setting Environment ******************* diff --git a/user_guide_src/source/general/errors.rst b/user_guide_src/source/general/errors.rst index 943793340466..9e49711e7954 100644 --- a/user_guide_src/source/general/errors.rst +++ b/user_guide_src/source/general/errors.rst @@ -49,8 +49,12 @@ Error Reporting --------------- By default, CodeIgniter will display a detailed error report with all errors in the ``development`` and ``testing`` environments, and will not -display any errors in the ``production`` environment. You can change this by setting the ``CI_ENVIRONMENT`` variable -in the :ref:`.env ` file. +display any errors in the ``production`` environment. + +.. image:: ../images/error.png + +You can change your environment by setting the ``CI_ENVIRONMENT`` variable. +See :ref:`setting-environment`. .. important:: Disabling error reporting DOES NOT stop logs from being written if there are errors. From f26b9dc85bdd4bcc785b1c98d86b8ecab62a96db Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 25 Oct 2023 20:56:09 +0900 Subject: [PATCH 52/55] docs: add changelog and upgrade --- user_guide_src/source/changelogs/v4.4.3.rst | 7 +++++++ user_guide_src/source/installation/upgrade_443.rst | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/user_guide_src/source/changelogs/v4.4.3.rst b/user_guide_src/source/changelogs/v4.4.3.rst index 9a70f3e17a9a..36e3dfb41e91 100644 --- a/user_guide_src/source/changelogs/v4.4.3.rst +++ b/user_guide_src/source/changelogs/v4.4.3.rst @@ -9,6 +9,13 @@ Release Date: Unreleased :local: :depth: 3 +SECURITY +******** + +- *Detailed Error Report is Displayed in Production Environment* was fixed. + See the `Security advisory GHSA-hwxf-qxj7-7rfj `_ + for more information. + BREAKING ******** diff --git a/user_guide_src/source/installation/upgrade_443.rst b/user_guide_src/source/installation/upgrade_443.rst index d33d162e9383..0af74926616c 100644 --- a/user_guide_src/source/installation/upgrade_443.rst +++ b/user_guide_src/source/installation/upgrade_443.rst @@ -15,6 +15,14 @@ Please refer to the upgrade instructions corresponding to your installation meth Mandatory File Changes ********************** +error_exception.php +=================== + +The following file received significant changes and +**you must merge the updated versions** with your application: + +- app/Views/errors/html/error_exception.php + Breaking Changes **************** @@ -48,3 +56,9 @@ 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: - @TODO +- app/Config/Boot/development.php +- app/Config/Boot/production.php +- app/Config/Boot/testing.php +- app/Config/Filters.php +- app/Views/errors/html/error_404.php +- app/Views/errors/html/error_exception.php From f251a3c750468e126a996105c544636630a88341 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 26 Oct 2023 08:38:30 +0900 Subject: [PATCH 53/55] refactor: replace str_ireplace() with in_array() php > ini_set('display_errors', '1'); php > var_dump(ini_get('display_errors')); string(1) "1" php > ini_set('display_errors', 1); php > var_dump(ini_get('display_errors')); string(1) "1" php > ini_set('display_errors', true); php > var_dump(ini_get('display_errors')); string(1) "1" php > ini_set('display_errors', 'true'); php > var_dump(ini_get('display_errors')); string(4) "true" --- system/Debug/ExceptionHandler.php | 10 +++++----- system/Debug/Exceptions.php | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/system/Debug/ExceptionHandler.php b/system/Debug/ExceptionHandler.php index 46b855e5eca7..63449888ffb5 100644 --- a/system/Debug/ExceptionHandler.php +++ b/system/Debug/ExceptionHandler.php @@ -130,11 +130,11 @@ protected function determineView(Throwable $exception, string $templatePath): st $view = 'production.php'; if ( - str_ireplace( - ['off', 'none', 'no', 'false', 'null', '0'], - '', - ini_get('display_errors') - ) !== '' + in_array( + strtolower(ini_get('display_errors')), + ['1', 'true', 'on', 'yes'], + true + ) ) { $view = 'error_exception.php'; } diff --git a/system/Debug/Exceptions.php b/system/Debug/Exceptions.php index b127a58241b0..bbcfcc8e8889 100644 --- a/system/Debug/Exceptions.php +++ b/system/Debug/Exceptions.php @@ -254,11 +254,11 @@ protected function determineView(Throwable $exception, string $templatePath): st $templatePath = rtrim($templatePath, '\\/ ') . DIRECTORY_SEPARATOR; if ( - str_ireplace( - ['off', 'none', 'no', 'false', 'null', '0'], - '', - ini_get('display_errors') - ) !== '' + in_array( + strtolower(ini_get('display_errors')), + ['1', 'true', 'on', 'yes'], + true + ) ) { $view = 'error_exception.php'; } From a0d7524bffdfbd8473b4b7d033a4ac3c6f510012 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 26 Oct 2023 16:06:35 +0900 Subject: [PATCH 54/55] Prep for 4.4.3 release --- CHANGELOG.md | 17 +++++++++++++++++ system/CodeIgniter.php | 2 +- user_guide_src/source/changelogs/v4.4.3.rst | 14 +------------- user_guide_src/source/conf.py | 2 +- .../source/installation/upgrade_443.rst | 18 ------------------ 5 files changed, 20 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c9eaea56c91..31e11dbe52c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [v4.4.3](https://github.com/codeigniter4/CodeIgniter4/tree/v4.4.1) (2023-10-26) +[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.4.2...v4.4.3) + +### SECURITY + +* *Detailed Error Report is Displayed in Production Environment* was fixed. See the [Security advisory](https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-hwxf-qxj7-7rfj) for more information. + +### Fixed Bugs + +* fix: FilterTestTrait::getFilterCaller() does not support Filter classes as array by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8058 +* fix: add dbgroup to model template only when specified as an option by @sammyskills in https://github.com/codeigniter4/CodeIgniter4/pull/8077 +* Update phpstan-codeigniter and fix errors on Modules by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/8036 +* fix: [Validation] exact_length does not pass int values by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8088 +* fix: [Table] field named `data` will produce bugged output by @ping-yee in https://github.com/codeigniter4/CodeIgniter4/pull/8054 +* docs: fix event points descriptions by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8076 +* docs: fix helper loading by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8084 + ## [v4.4.2](https://github.com/codeigniter4/CodeIgniter4/tree/v4.4.1) (2023-10-19) [Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.4.1...v4.4.2) diff --git a/system/CodeIgniter.php b/system/CodeIgniter.php index 09fc6a1f689f..9f9f6e174ca7 100644 --- a/system/CodeIgniter.php +++ b/system/CodeIgniter.php @@ -54,7 +54,7 @@ class CodeIgniter /** * The current version of CodeIgniter Framework */ - public const CI_VERSION = '4.4.2'; + public const CI_VERSION = '4.4.3'; /** * App startup time. diff --git a/user_guide_src/source/changelogs/v4.4.3.rst b/user_guide_src/source/changelogs/v4.4.3.rst index 36e3dfb41e91..4629fa28ac58 100644 --- a/user_guide_src/source/changelogs/v4.4.3.rst +++ b/user_guide_src/source/changelogs/v4.4.3.rst @@ -1,7 +1,7 @@ Version 4.4.3 ############# -Release Date: Unreleased +Release Date: October 26, 2023 **4.4.3 release of CodeIgniter4** @@ -16,18 +16,6 @@ SECURITY See the `Security advisory GHSA-hwxf-qxj7-7rfj `_ for more information. -BREAKING -******** - -Message Changes -*************** - -Changes -******* - -Deprecations -************ - Bugs Fixed ********** diff --git a/user_guide_src/source/conf.py b/user_guide_src/source/conf.py index 75454cc17896..e2598cedc2fd 100644 --- a/user_guide_src/source/conf.py +++ b/user_guide_src/source/conf.py @@ -26,7 +26,7 @@ version = '4.4' # The full version, including alpha/beta/rc tags. -release = '4.4.2' +release = '4.4.3' # -- General configuration --------------------------------------------------- diff --git a/user_guide_src/source/installation/upgrade_443.rst b/user_guide_src/source/installation/upgrade_443.rst index 0af74926616c..0cad99237cb9 100644 --- a/user_guide_src/source/installation/upgrade_443.rst +++ b/user_guide_src/source/installation/upgrade_443.rst @@ -23,12 +23,6 @@ The following file received significant changes and - app/Views/errors/html/error_exception.php -Breaking Changes -**************** - -Breaking Enhancements -********************* - Project Files ************* @@ -38,24 +32,12 @@ these files being outside of the **system** scope they will not be changed witho There are some third-party CodeIgniter modules available to assist with merging changes to the project space: `Explore on Packagist `_. -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: - -Config ------- - -- @TODO - 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: -- @TODO - app/Config/Boot/development.php - app/Config/Boot/production.php - app/Config/Boot/testing.php From 84c8f885cd70f03090a40029f47e2be38375e079 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 27 Oct 2023 07:03:45 +0900 Subject: [PATCH 55/55] docs: fix links --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31e11dbe52c5..9cf10b0f8372 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [v4.4.3](https://github.com/codeigniter4/CodeIgniter4/tree/v4.4.1) (2023-10-26) +## [v4.4.3](https://github.com/codeigniter4/CodeIgniter4/tree/v4.4.3) (2023-10-26) [Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.4.2...v4.4.3) ### SECURITY @@ -17,7 +17,7 @@ * docs: fix event points descriptions by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8076 * docs: fix helper loading by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8084 -## [v4.4.2](https://github.com/codeigniter4/CodeIgniter4/tree/v4.4.1) (2023-10-19) +## [v4.4.2](https://github.com/codeigniter4/CodeIgniter4/tree/v4.4.2) (2023-10-19) [Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.4.1...v4.4.2) ### Fixed Bugs