Skip to content

Commit 9c2ba1f

Browse files
authored
Merge pull request #8948 from codeigniter4/develop
4.5.2 Ready code
2 parents 432d724 + db9cfd4 commit 9c2ba1f

File tree

539 files changed

+2857
-3271
lines changed

Some content is hidden

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

539 files changed

+2857
-3271
lines changed

.gitattributes

+6-3
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,21 @@ CONTRIBUTING.md export-ignore
1717

1818
# contributor/development files
1919
tests/ export-ignore
20+
tools/ export-ignore
2021
utils/ export-ignore
2122
.php-cs-fixer.dist.php export-ignore
2223
.php-cs-fixer.no-header.php export-ignore
24+
.php-cs-fixer.tests.php export-ignore
2325
.php-cs-fixer.user-guide.php export-ignore
2426
deptrac.yaml export-ignore
25-
phpstan-baseline.neon.dist export-ignore
27+
phpmetrics.json export-ignore
28+
phpstan-baseline.php export-ignore
2629
phpstan-bootstrap.php export-ignore
2730
phpstan.neon.dist export-ignore
2831
phpunit.xml.dist export-ignore
29-
psalm_autoload.php export-ignore
30-
psalm-baseline.php export-ignore
32+
psalm-baseline.xml export-ignore
3133
psalm.xml export-ignore
34+
psalm_autoload.php export-ignore
3235
rector.php export-ignore
3336

3437
# source user guide

.github/workflows/test-coding-standards.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
matrix:
3030
php-version:
3131
- '8.1'
32-
- '8.2'
32+
- '8.3'
3333

3434
steps:
3535
- name: Checkout
@@ -60,8 +60,11 @@ jobs:
6060
- name: Run lint on `app/`, `admin/`, `public/`
6161
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.no-header.php --using-cache=no --diff
6262

63-
- name: Run lint on `system/`, `tests`, `utils/`, and root PHP files
63+
- name: Run lint on `system/`, `utils/`, and root PHP files
6464
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff
6565

66+
- name: Run lint on `tests`
67+
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.tests.php --using-cache=no --diff
68+
6669
- name: Run lint on `user_guide_src/source/`
6770
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.user-guide.php --using-cache=no --diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Check File Permissions
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
permission-check:
16+
name: Check File Permission
17+
runs-on: ubuntu-22.04
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Detect unnecessary execution permissions
24+
run: php utils/check_permission_x.php

.github/workflows/test-phpstan.yml

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
paths:
1111
- 'app/**.php'
1212
- 'system/**.php'
13+
- 'tests/**.php'
1314
- 'utils/**.php'
1415
- composer.json
1516
- phpstan.neon.dist
@@ -23,6 +24,7 @@ on:
2324
paths:
2425
- 'app/**.php'
2526
- 'system/**.php'
27+
- 'tests/**.php'
2628
- 'utils/**.php'
2729
- composer.json
2830
- phpstan.neon.dist

.github/workflows/test-phpunit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
enable-artifact-upload: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
115115
enable-coverage: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
116116
enable-profiling: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
117-
extra-extensions: mysqli, oci8, pgsql, sqlsrv-5.10.1, sqlite3
117+
extra-extensions: mysqli, oci8, pgsql, sqlsrv, sqlite3
118118
extra-composer-options: ${{ matrix.composer-option }}
119119

120120
separate-process-tests:

.github/workflows/test-psalm.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ jobs:
3434
uses: shivammathur/setup-php@v2
3535
with:
3636
php-version: '8.1'
37-
tools: phpstan, phpunit
38-
extensions: intl, json, mbstring, xml, oci8
37+
extensions: intl, json, mbstring, xml, mysqli, oci8, pgsql, sqlsrv, sqlite3
3938
coverage: none
4039
env:
4140
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.php-cs-fixer.dist.php

+14-12
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,29 @@
3636
__DIR__ . '/.php-cs-fixer.no-header.php',
3737
__DIR__ . '/.php-cs-fixer.tests.php',
3838
__DIR__ . '/.php-cs-fixer.user-guide.php',
39+
__DIR__ . '/preload.php',
3940
__DIR__ . '/rector.php',
4041
__DIR__ . '/spark',
4142
]);
4243

43-
$overrides = [];
44+
$overrides = [
45+
// for updating to coding-standard
46+
'modernize_strpos' => true,
47+
'ordered_attributes' => ['order' => [], 'sort_algorithm' => 'alpha'],
48+
'php_unit_attributes' => true,
49+
];
4450

4551
$options = [
46-
'cacheFile' => 'build/.php-cs-fixer.cache',
47-
'finder' => $finder,
52+
'cacheFile' => 'build/.php-cs-fixer.cache',
53+
'finder' => $finder,
54+
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
55+
'customRules' => [
56+
NoCodeSeparatorCommentFixer::name() => true,
57+
],
4858
];
4959

50-
$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
60+
return Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
5161
'CodeIgniter 4 framework',
5262
'CodeIgniter Foundation',
5363
5464
);
55-
56-
$config
57-
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
58-
->setRules(array_merge($config->getRules(), [
59-
NoCodeSeparatorCommentFixer::name() => true,
60-
]));
61-
62-
return $config;

.php-cs-fixer.no-header.php

+13-12
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,20 @@
2929
__DIR__ . '/admin/starter/builds',
3030
]);
3131

32-
$overrides = [];
33-
34-
$options = [
35-
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
36-
'finder' => $finder,
32+
$overrides = [
33+
// for updating to coding-standard
34+
'modernize_strpos' => true,
35+
'ordered_attributes' => ['order' => [], 'sort_algorithm' => 'alpha'],
36+
'php_unit_attributes' => true,
3737
];
3838

39-
$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
40-
41-
$config
42-
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
43-
->setRules(array_merge($config->getRules(), [
39+
$options = [
40+
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
41+
'finder' => $finder,
42+
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
43+
'customRules' => [
4444
NoCodeSeparatorCommentFixer::name() => true,
45-
]));
45+
],
46+
];
4647

47-
return $config;
48+
return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();

.php-cs-fixer.tests.php

+11-11
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@
3535

3636
$overrides = [
3737
'void_return' => true,
38+
// for updating to coding-standard
39+
'modernize_strpos' => true,
40+
'ordered_attributes' => ['order' => [], 'sort_algorithm' => 'alpha'],
41+
'php_unit_attributes' => true,
3842
];
3943

4044
$options = [
41-
'cacheFile' => 'build/.php-cs-fixer.tests.cache',
42-
'finder' => $finder,
45+
'cacheFile' => 'build/.php-cs-fixer.tests.cache',
46+
'finder' => $finder,
47+
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
48+
'customRules' => [
49+
NoCodeSeparatorCommentFixer::name() => true,
50+
],
4351
];
4452

45-
$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
53+
return Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
4654
'CodeIgniter 4 framework',
4755
'CodeIgniter Foundation',
4856
4957
);
50-
51-
$config
52-
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
53-
->setRules(array_merge($config->getRules(), [
54-
NoCodeSeparatorCommentFixer::name() => true,
55-
]));
56-
57-
return $config;

.php-cs-fixer.user-guide.php

+11-11
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@
3939
'import_symbols' => false,
4040
'leading_backslash_in_global_namespace' => true,
4141
],
42+
// for updating to coding-standard
43+
'modernize_strpos' => true,
44+
'ordered_attributes' => ['order' => [], 'sort_algorithm' => 'alpha'],
45+
'php_unit_attributes' => true,
4246
];
4347

4448
$options = [
45-
'cacheFile' => 'build/.php-cs-fixer.user-guide.cache',
46-
'finder' => $finder,
47-
];
48-
49-
$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
50-
51-
$config
52-
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
53-
->setRules(array_merge($config->getRules(), [
49+
'cacheFile' => 'build/.php-cs-fixer.user-guide.cache',
50+
'finder' => $finder,
51+
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
52+
'customRules' => [
5453
NoCodeSeparatorCommentFixer::name() => true,
55-
]));
54+
],
55+
];
5656

57-
return $config;
57+
return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();

CHANGELOG.md

+25
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Changelog
22

3+
## [v4.5.2](https://github.com/codeigniter4/CodeIgniter4/tree/v4.5.2) (2024-06-10)
4+
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.5.1...v4.5.2)
5+
6+
### Fixed Bugs
7+
8+
* chore: fix phpunit.xml.dist for appstarter by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8785
9+
* fix: update `preload.php` for 4.5 by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8805
10+
* fix: [ErrorException] Undefined array key in `spark phpini:check` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8804
11+
* fix: incorrect Security exception message by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8818
12+
* fix: [QueryBuilder] TypeError in join() with BETWEEN by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8792
13+
* fix: [SQLSRV] Query Builder always sets `"<database>"."<schema>".` to the table name. by @ping-yee in https://github.com/codeigniter4/CodeIgniter4/pull/8786
14+
* fix: remove unused undefined param $raw in MockCache::save() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8847
15+
* fix: FileCollection pseudo-regex by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8868
16+
* fix: [Model] casting may throw InvalidArgumentException: Invalid parameter: nullable by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8870
17+
* fix: [Model] casting causes TypeError when finding no record by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8871
18+
* fix: correct property default values in Email by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8855
19+
* fix: CLI::promptByMultipleKeys() and prompt() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8873
20+
* fix: [Postgres] show missing error message by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8913
21+
* fix: TypeError in number_to_amount() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8932
22+
* fix: Model::find() returns incorrect data with casting by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8933
23+
24+
### Refactoring
25+
26+
* refactor: remove unused path parameter on PhpStreamWrapper::stream_open() by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/8926
27+
328
## [v4.5.1](https://github.com/codeigniter4/CodeIgniter4/tree/v4.5.1) (2024-04-14)
429
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.5.0...v4.5.1)
530

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ PHP version 8.1 or higher is required, with the following extensions installed:
9393
- [mbstring](http://php.net/manual/en/mbstring.installation.php)
9494

9595
> [!WARNING]
96-
> The end of life date for PHP 7.4 was November 28, 2022.
97-
> The end of life date for PHP 8.0 was November 26, 2023.
98-
> If you are still using PHP 7.4 or 8.0, you should upgrade immediately.
99-
> The end of life date for PHP 8.1 will be November 25, 2024.
96+
> - The end of life date for PHP 7.4 was November 28, 2022.
97+
> - The end of life date for PHP 8.0 was November 26, 2023.
98+
> - If you are still using PHP 7.4 or 8.0, you should upgrade immediately.
99+
> - The end of life date for PHP 8.1 will be December 31, 2025.
100100
101101
Additionally, make sure that the following extensions are enabled in your PHP:
102102

admin/framework/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ PHP version 8.1 or higher is required, with the following extensions installed:
4848
- [mbstring](http://php.net/manual/en/mbstring.installation.php)
4949

5050
> [!WARNING]
51-
> The end of life date for PHP 7.4 was November 28, 2022.
52-
> The end of life date for PHP 8.0 was November 26, 2023.
53-
> If you are still using PHP 7.4 or 8.0, you should upgrade immediately.
54-
> The end of life date for PHP 8.1 will be November 25, 2024.
51+
> - The end of life date for PHP 7.4 was November 28, 2022.
52+
> - The end of life date for PHP 8.0 was November 26, 2023.
53+
> - If you are still using PHP 7.4 or 8.0, you should upgrade immediately.
54+
> - The end of life date for PHP 8.1 will be December 31, 2025.
5555
5656
Additionally, make sure that the following extensions are enabled in your PHP:
5757

admin/next-upgrading-guide.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ Project Files
3131
Some files in the **project space** (root, app, public, writable) received updates. Due to
3232
these files being outside of the **system** scope they will not be changed without your intervention.
3333

34-
There are some third-party CodeIgniter modules available to assist with merging changes to
35-
the project space: `Explore on Packagist <https://packagist.org/explore/?query=codeigniter4%20updates>`_.
34+
.. note:: There are some third-party CodeIgniter modules available to assist
35+
with merging changes to the project space:
36+
`Explore on Packagist <https://packagist.org/explore/?query=codeigniter4%20updates>`_.
3637

3738
Content Changes
3839
===============

admin/starter/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ PHP version 8.1 or higher is required, with the following extensions installed:
5656
- [mbstring](http://php.net/manual/en/mbstring.installation.php)
5757

5858
> [!WARNING]
59-
> The end of life date for PHP 7.4 was November 28, 2022.
60-
> The end of life date for PHP 8.0 was November 26, 2023.
61-
> If you are still using PHP 7.4 or 8.0, you should upgrade immediately.
62-
> The end of life date for PHP 8.1 will be November 25, 2024.
59+
> - The end of life date for PHP 7.4 was November 28, 2022.
60+
> - The end of life date for PHP 8.0 was November 26, 2023.
61+
> - If you are still using PHP 7.4 or 8.0, you should upgrade immediately.
62+
> - The end of life date for PHP 8.1 will be December 31, 2025.
6363
6464
Additionally, make sure that the following extensions are enabled in your PHP:
6565

admin/starter/phpunit.xml.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
5-
bootstrap="system/Test/bootstrap.php"
5+
bootstrap="vendor/codeigniter4/framework/system/Test/bootstrap.php"
66
backupGlobals="false"
77
beStrictAboutOutputDuringTests="true"
88
colors="true"

admin/starter/tests/.htaccess

100755100644
File mode changed.

admin/starter/tests/index.html

100755100644
File mode changed.

admin/userguide/.github/scripts/deploy

-15
This file was deleted.
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh -e
2+
3+
# Deploys the User Guide to the production
4+
# website. Triggered by updates to the GitHub
5+
# codeigniter4/userguide repo's master branch.
6+
# See https://github.com/codeigniter4/userguide/blob/master/.github/workflows/deploy.yml
7+
8+
REPO="/opt/userguide"
9+
SITE="/home/public_html/userguides/userguide4"
10+
11+
if [ "$(id -u)" = "0" ]; then
12+
echo "Cannot be run as root. Please run as the user for deployment."
13+
exit 1
14+
fi
15+
16+
cd "$REPO"
17+
git switch master
18+
git pull
19+
20+
cp -R "$REPO/docs" "$SITE.new"
21+
mv "$SITE" "$SITE.old"
22+
mv "$SITE.new" "$SITE"
23+
rm -rf "$SITE.old"

admin/userguide/.github/workflows/deploy.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Deploy Production
44

55
on:
66
push:
7-
branches:
7+
branches:
88
- master
99

1010
jobs:
@@ -19,4 +19,4 @@ jobs:
1919
username: ${{ secrets.USERNAME }}
2020
key: ${{ secrets.KEY }}
2121
port: ${{ secrets.PORT }}
22-
script: /opt/userguide/.github/scripts/deploy
22+
script: /opt/userguide/.github/scripts/deploy.sh

app/Config/DocTypes.php

100755100644
File mode changed.

0 commit comments

Comments
 (0)