Skip to content

Commit eb252d2

Browse files
authored
Merge pull request #8377 from codeigniter4/develop
4.4.4 Ready code
2 parents 4b71437 + 14c8609 commit eb252d2

File tree

427 files changed

+4492
-2498
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

427 files changed

+4492
-2498
lines changed

.github/workflows/deploy-distributables.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
run: ./source/.github/scripts/deploy-framework ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/framework ${GITHUB_REF##*/}
6767

6868
- name: Release
69-
uses: actions/github-script@v6
69+
uses: actions/github-script@v7
7070
with:
7171
github-token: ${{secrets.ACCESS_TOKEN}}
7272
script: |
@@ -116,7 +116,7 @@ jobs:
116116
run: ./source/.github/scripts/deploy-appstarter ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/appstarter ${GITHUB_REF##*/}
117117

118118
- name: Release
119-
uses: actions/github-script@v6
119+
uses: actions/github-script@v7
120120
with:
121121
github-token: ${{secrets.ACCESS_TOKEN}}
122122
script: |
@@ -172,7 +172,7 @@ jobs:
172172
run: ./source/.github/scripts/deploy-userguide ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/userguide ${GITHUB_REF##*/}
173173

174174
- name: Release
175-
uses: actions/github-script@v6
175+
uses: actions/github-script@v7
176176
with:
177177
github-token: ${{secrets.ACCESS_TOKEN}}
178178
script: |

.github/workflows/test-autoreview.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Automatic Code Review
1+
name: AutoReview
22

33
on:
44
pull_request:
@@ -23,9 +23,10 @@ permissions:
2323

2424
jobs:
2525
auto-review-tests:
26+
name: Automatic Code Review
2627
uses: ./.github/workflows/reusable-serviceless-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
2728
with:
28-
job-name: Automatic Code Review [PHP 8.1]
29+
job-name: PHP 8.1
2930
php-version: '8.1'
3031
job-id: auto-review-tests
3132
group-name: AutoReview

.github/workflows/test-phpcpd.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,5 @@ jobs:
5656
--exclude system/Database/Postgre/Builder.php
5757
--exclude system/Debug/Exceptions.php
5858
--exclude system/HTTP/SiteURI.php
59+
--exclude system/Validation/Rules.php
5960
-- app/ public/ system/

.github/workflows/test-phpunit.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
echo "version=8.1" >> $GITHUB_OUTPUT
5151
5252
sanity-tests:
53+
name: Others
5354
needs: coverage-php-version
5455

5556
strategy:
@@ -77,6 +78,7 @@ jobs:
7778
extra-composer-options: ${{ matrix.composer-option }}
7879

7980
database-live-tests:
81+
name: DatabaseLive
8082
needs:
8183
- coverage-php-version
8284
- sanity-tests
@@ -97,17 +99,17 @@ jobs:
9799
- SQLSRV
98100
- SQLite3
99101
mysql-version:
100-
- '5.7'
102+
- '8.0'
101103
include:
102104
- php-version: '7.4'
103105
db-platform: MySQLi
104-
mysql-version: '8.0'
106+
mysql-version: '5.7'
105107
- php-version: '8.3'
106108
composer-option: '--ignore-platform-req=php'
107109

108110
uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
109111
with:
110-
job-name: Database Live Tests
112+
job-name: ''
111113
php-version: ${{ matrix.php-version }}
112114
job-id: database-live-tests
113115
db-platform: ${{ matrix.db-platform }}
@@ -120,6 +122,7 @@ jobs:
120122
extra-composer-options: ${{ matrix.composer-option }}
121123

122124
separate-process-tests:
125+
name: SeparateProcess
123126
needs:
124127
- coverage-php-version
125128
- sanity-tests
@@ -138,7 +141,7 @@ jobs:
138141

139142
uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
140143
with:
141-
job-name: Separate Process Tests
144+
job-name: ''
142145
php-version: ${{ matrix.php-version }}
143146
job-id: separate-process-tests
144147
group-name: SeparateProcess
@@ -149,6 +152,7 @@ jobs:
149152
extra-composer-options: ${{ matrix.composer-option }}
150153

151154
cache-live-tests:
155+
name: CacheLive
152156
needs:
153157
- coverage-php-version
154158
- sanity-tests

CHANGELOG.md

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,59 @@
11
# Changelog
22

3+
## [v4.4.4](https://github.com/codeigniter4/CodeIgniter4/tree/v4.4.4) (2023-12-28)
4+
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.4.3...v4.4.4)
5+
6+
### Breaking Changes
7+
8+
* fix: Validation rule with `*` gets incorrect values as dot array syntax by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8129
9+
* fix: validation rule `matches` and `differs` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8122
10+
* fix: [CURLRequest] skip hostname checks if options 'verify' false by @NicolaeIotu in https://github.com/codeigniter4/CodeIgniter4/pull/8258
11+
* fix: get_filenames() does not follow symlinks by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8298
12+
13+
### Fixed Bugs
14+
15+
* fix: change make:command default $group to `App` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8109
16+
* fix: typo in help message in `spark filter:check` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8118
17+
* fix: Hot reloading when session is enabled by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/8112
18+
* fix: make:cell help message by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8133
19+
* fix: [DebugBar] dark mode timeline "Controller" by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8125
20+
* fix: PHPDoc types in controller.tpl.php by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8144
21+
* fix: `@return` in filter.tpl.php by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8145
22+
* fix: when request body is `0`, $body will be null by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8161
23+
* fix: `spark routes` outputs `<unknown>` only when {locale} with `useSupportedLocalesOnly(true)` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8167
24+
* fix: Undefined array key error in `spark db:table` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8173
25+
* fix: force_https() redirects to wrong URL when baseURL has subfolder by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8191
26+
* fix: Validation raises TypeError when invalid JSON comes by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8153
27+
* fix: FilterTestTrait Undefined variable $filterClasses by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8195
28+
* fix: Image::save() causes error with webp by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8210
29+
* fix issue where running FileLocator::getClassname() on a directory would cause a PHP error by @colethorsen in https://github.com/codeigniter4/CodeIgniter4/pull/8216
30+
* fix: make Request::getEnv() deprecated by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8234
31+
* fix: ExceptionHandler displays incorrect Exception classname by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8239
32+
* fix: [Cache] Double prefix for increment in FileHandler by @il-coder in https://github.com/codeigniter4/CodeIgniter4/pull/8255
33+
* docs: fix Database Utility Class `getXMLFromResult()` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8276
34+
* fix: autoload helpers in test bootstrap by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8275
35+
* fix: Model handling of Entity $primaryKey casting by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8282
36+
* fix: Handle non-array JSON in validation by @woodongwong in https://github.com/codeigniter4/CodeIgniter4/pull/8288
37+
* fix: DEPRECATED error in Honeypot by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8316
38+
* fix: [Auto Routing Improved] `spark routes` shows incorrect routes when translateURIDashes is enabled by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8320
39+
* fix: migrations not using custom DB connection of migration runner by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/8221
40+
* Always return a new instance of a Cell by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/8330
41+
* fix: DOMParser cannot see element with `id="0"` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8360
42+
43+
### Refactoring
44+
45+
* [Rector] Apply SingleInArrayToCompareRector by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/8102
46+
* refactor: RedisHandler ttl() calls by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8155
47+
* [Testing] Use assertEqualsWithDelta() when possible by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/8158
48+
* refactor: replace non-boolean if conditions in Model by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8193
49+
* refactor: View classes to fix PHPStan errors by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8208
50+
* refactor: Model by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8260
51+
* replace -1 with E_ALL in error_reporting calls by @ThomasMeschke in https://github.com/codeigniter4/CodeIgniter4/pull/8212
52+
* refactor: apply SimplifyEmptyCheckOnEmptyArrayRector by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8341
53+
* refactor: apply DisallowedEmptyRuleFixerRector by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8344
54+
* refactor: rely on $config property in ViewDecoratorTrait by @mostafakhudair in https://github.com/codeigniter4/CodeIgniter4/pull/8021
55+
* refactor: replace empty() Part 1 by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8345
56+
357
## [v4.4.3](https://github.com/codeigniter4/CodeIgniter4/tree/v4.4.3) (2023-10-26)
458
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.4.2...v4.4.3)
559

@@ -59,8 +113,6 @@
59113
* refactor: delete duplicate code for Composer loading by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8004
60114
* [Rector] Apply BooleanInIfConditionRuleFixerRector by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/7951
61115

62-
**Full Changelog**: https://github.com/codeigniter4/CodeIgniter4/compare/v4.4.1...v4.4.2
63-
64116
## [v4.4.1](https://github.com/codeigniter4/CodeIgniter4/tree/v4.4.1) (2023-09-05)
65117
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.4.0...v4.4.1)
66118

admin/RELEASE.md

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> Documentation guide based on the releases of `4.0.5` and `4.1.0` on January 31, 2021.
44
>
5-
> Updated for `4.3.0` on January 10, 2023.
5+
> Updated for `4.4.3` on October 27, 2023.
66
>
77
> -MGatner, kenjis
88
@@ -53,12 +53,18 @@ Work off direct clones of the repos so the release branches persist for a time.
5353
* [ ] Clone both **codeigniter4/CodeIgniter4** and **codeigniter4/userguide** and
5454
resolve any necessary PRs
5555
```console
56+
rm -rf CodeIgniter4.bk userguide.bk
57+
mv CodeIgniter4 CodeIgniter4.bk
58+
mv userguide userguide.bk
5659
git clone [email protected]:codeigniter4/CodeIgniter4.git
5760
git clone [email protected]:codeigniter4/userguide.git
5861
```
5962
* [ ] Vet the **admin/** folders for any removed hidden files (Action deploy scripts
6063
*do not remove these*)
61-
* git diff --name-status origin/master admin/
64+
```console
65+
cd CodeIgniter4
66+
git diff --name-status origin/master admin/
67+
```
6268
* [ ] Merge any Security Advisory PRs in private forks
6369

6470
## Process
@@ -67,21 +73,26 @@ Work off direct clones of the repos so the release branches persist for a time.
6773
> been included with their PR, so this process assumes you will not be
6874
> generating much new content.
6975
70-
* [ ] Create a new branch `release-4.x.x`
71-
* [ ] Update **system/CodeIgniter.php** with the new version number:
72-
`const CI_VERSION = '4.x.x';`
73-
* [ ] Update **user_guide_src/source/conf.py** with the new `version = '4.x'` (if applicable)
74-
and `release = '4.x.x'`
7576
* [ ] Replace **CHANGELOG.md** with the new version generated above
7677
* [ ] Update **user_guide_src/source/changelogs/{version}.rst**
77-
* Set the date to format `Release Date: January 31, 2021`
7878
* Remove the section titles that have no items
7979
* [ ] Update **user_guide_src/source/installation/upgrade_{ver}.rst**
8080
* fill in the "All Changes" section, and add it to **upgrading.rst**
8181
* git diff --name-status origin/master -- . ':!system'
8282
* Remove the section titles that have no items
8383
* [Minor version only] Update the "from" version in the title. E.g., `from 4.3.x``from 4.3.8`
84-
* [ ] Commit the changes with `Prep for 4.x.x release` and push to origin
84+
* [ ] Run `php admin/prepare-release.php 4.x.x` and push to origin
85+
* The above command does the following:
86+
* Create a new branch `release-4.x.x`
87+
* Update **system/CodeIgniter.php** with the new version number:
88+
`const CI_VERSION = '4.x.x';`
89+
* Update **user_guide_src/source/conf.py** with the new `version = '4.x'` (if applicable)
90+
and `release = '4.x.x'`
91+
* Update **user_guide_src/source/changelogs/{version}.rst**
92+
* Set the date to format `Release Date: January 31, 2021`
93+
* Update **phpdoc.dist.xml** with the new `<title>CodeIgniter v4.x API</title>`
94+
and `<version number="4.x.x">`
95+
* Commit the changes with `Prep for 4.x.x release`
8596
* [ ] Create a new PR from `release-4.x.x` to `develop`:
8697
* Title: `Prep for 4.x.x release`
8798
* Description:
@@ -119,6 +130,7 @@ Work off direct clones of the repos so the release branches persist for a time.
119130
* [ ] Run the following commands to install and test `appstarter` and verify the new
120131
version:
121132
```console
133+
rm -rf release-test
122134
composer create-project codeigniter4/appstarter release-test
123135
cd release-test
124136
composer test && composer info codeigniter4/framework
@@ -152,19 +164,21 @@ Work off direct clones of the repos so the release branches persist for a time.
152164
git switch -c 4.x
153165
git push origin HEAD
154166
```
155-
* [ ] Publish any Security Advisories that were resolved from private forks
167+
* [ ] Request CVEs and Publish any Security Advisories that were resolved from private forks
156168
(note: publishing is restricted to administrators):
157169
* [ ] Announce the release on the forums and Slack channel
158170
(note: this forum is restricted to administrators):
159171
* Make a new topic in the "News & Discussion" forums:
160172
https://forum.codeigniter.com/forum-2.html
161173
* The content is somewhat organic, but should include any major features and
162174
changes as well as a link to the User Guide's changelog
175+
* [ ] Run `php admin/create-new-changelog.php <current_version> <new_version>`
176+
* The above command does the following:
177+
* Create **user_guide_src/source/changelogs/{next_version}.rst** and add it to
178+
**index.rst** (See **next-changelog-*.rst**)
179+
* Create **user_guide_src/source/installation/upgrade_{next_version}.rst** and add it to
180+
**upgrading.rst** (See **next-upgrading-guide.rst**)
163181
* [ ] Create a PR for new changelog and upgrade for the next version
164-
* Create **user_guide_src/source/changelogs/{next_version}.rst** and add it to
165-
**index.rst** (See **next-changelog-*.rst**)
166-
* Create **user_guide_src/source/installation/upgrade_{next_version}.rst** and add it to
167-
**upgrading.rst** (See **next-upgrading-guide.rst**)
168182
169183
## Appendix
170184

admin/create-new-changelog.php

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
function replace_file_content(string $path, string $pattern, string $replace): void
6+
{
7+
$file = file_get_contents($path);
8+
$output = preg_replace($pattern, $replace, $file);
9+
file_put_contents($path, $output);
10+
}
11+
12+
// Main.
13+
chdir(__DIR__ . '/..');
14+
15+
if ($argc !== 3) {
16+
echo "Usage: php {$argv[0]} <current_version> <new_version>" . PHP_EOL;
17+
echo "E.g.,: php {$argv[0]} 4.4.3 4.4.4" . PHP_EOL;
18+
19+
exit(1);
20+
}
21+
22+
// Gets version number from argument.
23+
$versionCurrent = $argv[1]; // e.g., '4.4.3'
24+
$versionCurrentParts = explode('.', $versionCurrent);
25+
$minorCurrent = $versionCurrentParts[0] . '.' . $versionCurrentParts[1];
26+
$version = $argv[2]; // e.g., '4.4.4'
27+
$versionParts = explode('.', $version);
28+
$minor = $versionParts[0] . '.' . $versionParts[1];
29+
$isMinorUpdate = ($minorCurrent !== $minor);
30+
31+
// Creates a branch for release.
32+
system('git switch develop');
33+
system('git switch -c docs-changelog-' . $version);
34+
system('git switch docs-changelog-' . $version);
35+
36+
// Copy changelog
37+
$changelog = "./user_guide_src/source/changelogs/v{$version}.rst";
38+
$changelogIndex = './user_guide_src/source/changelogs/index.rst';
39+
if ($isMinorUpdate) {
40+
copy('./admin/next-changelog-minor.rst', $changelog);
41+
} else {
42+
copy('./admin/next-changelog-patch.rst', $changelog);
43+
}
44+
// Add changelog to index.rst.
45+
replace_file_content(
46+
$changelogIndex,
47+
'/\.\. toctree::\n :titlesonly:\n/u',
48+
".. toctree::\n :titlesonly:\n\n v{$version}"
49+
);
50+
// Replace {version}
51+
$length = mb_strlen("Version {$version}");
52+
$underline = str_repeat('#', $length);
53+
replace_file_content(
54+
$changelog,
55+
'/#################\nVersion {version}\n#################/u',
56+
"{$underline}\nVersion {$version}\n{$underline}"
57+
);
58+
replace_file_content(
59+
$changelog,
60+
'/{version}/u',
61+
"{$version}"
62+
);
63+
64+
// Copy upgrading
65+
$versionWithoutDots = str_replace('.', '', $version);
66+
$upgrading = "./user_guide_src/source/installation/upgrade_{$versionWithoutDots}.rst";
67+
$upgradingIndex = './user_guide_src/source/installation/upgrading.rst';
68+
copy('./admin/next-upgrading-guide.rst', $upgrading);
69+
// Add upgrading to upgrading.rst.
70+
replace_file_content(
71+
$upgradingIndex,
72+
'/ backward_compatibility_notes\n/u',
73+
" backward_compatibility_notes\n\n upgrade_{$versionWithoutDots}"
74+
);
75+
// Replace {version}
76+
$length = mb_strlen("Upgrading from {$versionCurrent} to {$version}");
77+
$underline = str_repeat('#', $length);
78+
replace_file_content(
79+
$upgrading,
80+
'/##############################\nUpgrading from {version} to {version}\n##############################/u',
81+
"{$underline}\nUpgrading from {$versionCurrent} to {$version}\n{$underline}"
82+
);
83+
84+
// Commits
85+
system("git add {$changelog} {$changelogIndex}");
86+
system("git add {$upgrading} {$upgradingIndex}");
87+
system('git commit -m "docs: add changelog and upgrade for v' . $version . '"');

admin/css/debug-toolbar/_theme-dark.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,6 @@
150150
.timer {
151151
background-color: $g-orange;
152152
}
153-
154-
.timeline-parent-open td {
155-
color: $t-dark;
156-
}
157153
}
158154
}
159155

admin/framework/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"require-dev": {
2121
"codeigniter/coding-standard": "^1.5",
2222
"fakerphp/faker": "^1.9",
23-
"friendsofphp/php-cs-fixer": "3.13.0",
23+
"friendsofphp/php-cs-fixer": "~3.41.0",
2424
"kint-php/kint": "^5.0.4",
2525
"mikey179/vfsstream": "^1.6",
2626
"nexusphp/cs-config": "^3.6",
@@ -43,6 +43,7 @@
4343
"ext-readline": "Improves CLI::input() usability",
4444
"ext-redis": "If you use Cache class RedisHandler",
4545
"ext-simplexml": "If you format XML",
46+
"ext-sodium": "If you use Encryption SodiumHandler",
4647
"ext-sqlite3": "If you use SQLite3",
4748
"ext-sqlsrv": "If you use SQL Server",
4849
"ext-xdebug": "If you use CIUnitTestCase::assertHeaderEmitted()"

0 commit comments

Comments
 (0)