Skip to content

Commit 061356b

Browse files
authored
Merge pull request #6136 from codeigniter4/develop
4.2.1 Ready code
2 parents 394a6c6 + 380fb88 commit 061356b

File tree

85 files changed

+856
-397
lines changed

Some content is hidden

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

85 files changed

+856
-397
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Each pull request should address a single issue and have a meaningful title.
22

3+
- All bug fixes should be sent to the __"develop"__ branch, this is where the next bug fix version will be developed.
4+
- PRs with any enhancement should be sent to the next minor version branch, e.g. __"4.3"__
5+
36
**Description**
47
Explain what you have changed, and why.
58

.github/workflows/test-deptrac.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77
branches:
88
- 'develop'
9-
- 'v4.*'
9+
- '4.*'
1010
paths:
1111
- 'app/**.php'
1212
- 'system/**.php'
@@ -16,7 +16,7 @@ on:
1616
push:
1717
branches:
1818
- 'develop'
19-
- 'v4.*'
19+
- '4.*'
2020
paths:
2121
- 'app/**.php'
2222
- 'system/**.php'

.github/workflows/test-phpcpd.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77
branches:
88
- 'develop'
9-
- 'v4.*'
9+
- '4.*'
1010
paths:
1111
- 'app/**.php'
1212
- 'public/**.php'
@@ -16,7 +16,7 @@ on:
1616
push:
1717
branches:
1818
- 'develop'
19-
- 'v4.*'
19+
- '4.*'
2020
paths:
2121
- 'app/**.php'
2222
- 'public/**.php'

.github/workflows/test-phpstan.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77
branches:
88
- 'develop'
9-
- 'v4.*'
9+
- '4.*'
1010
paths:
1111
- 'app/**.php'
1212
- 'system/**.php'
@@ -18,7 +18,7 @@ on:
1818
push:
1919
branches:
2020
- 'develop'
21-
- 'v4.*'
21+
- '4.*'
2222
paths:
2323
- 'app/**.php'
2424
- 'system/**.php'

.github/workflows/test-phpunit.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- develop
7+
- '4.*'
78
paths:
89
- 'app/**.php'
910
- 'system/**.php'
@@ -16,7 +17,7 @@ on:
1617
pull_request:
1718
branches:
1819
- develop
19-
- 'v4.*'
20+
- '4.*'
2021
paths:
2122
- 'app/**.php'
2223
- 'system/**.php'

.github/workflows/test-rector.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77
branches:
88
- 'develop'
9-
- 'v4.*'
9+
- '4.*'
1010
paths:
1111
- 'app/**.php'
1212
- 'system/**.php'
@@ -18,7 +18,7 @@ on:
1818
push:
1919
branches:
2020
- 'develop'
21-
- 'v4.*'
21+
- '4.*'
2222
paths:
2323
- 'app/**.php'
2424
- 'system/**.php'

.github/workflows/test-scss.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
branches:
66
- 'develop'
7-
- 'v4.x'
7+
- '4.*'
88
paths:
99
- '**.scss'
1010
- '**.css'
@@ -13,7 +13,7 @@ on:
1313
push:
1414
branches:
1515
- 'develop'
16-
- 'v4.x'
16+
- '4.*'
1717
paths:
1818
- '**.scss'
1919
- '**.css'

.php-cs-fixer.dist.php

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
__DIR__ . '/.php-cs-fixer.user-guide.php',
3434
__DIR__ . '/rector.php',
3535
__DIR__ . '/spark',
36-
__DIR__ . '/user_guide_src/renumerate.php',
3736
]);
3837

3938
$overrides = [];

CHANGELOG.md

+28
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
# Changelog
22

3+
## [v4.2.1](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.1) (2022-06-16)
4+
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.2.0...v4.2.1)
5+
6+
### Breaking Changes
7+
* Fix MIME guessing of extension from type by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/6059
8+
* fix: get_cookie() may not use the cookie prefix by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6082
9+
10+
### Fixed Bugs
11+
* fix: get_cookie() does not take Config\Cookie::$prefix by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6080
12+
* fix: session cookie name bug by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6091
13+
* fix: Session Handlers do not take Config\Cookie by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6081
14+
* fix: reverse routing does not work with full classname starting with `\` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6104
15+
* fix: insert error message in QueryBuilder by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6108
16+
* fix: `spark routes` shows "ERROR: 404" by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6098
17+
* fix: Time::setTestNow() does not work with fa Locale by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6116
18+
* fix: `migrate --all` causes `Class "SQLite3" not found` error by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6117
19+
* fix: event DBQuery is not fired on failed query when DBDebug is true by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6127
20+
* fix: `Time::humanize()` causes error with ar locale by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6120
21+
* Fix decorators by @lonnieezell in https://github.com/codeigniter4/CodeIgniter4/pull/6090
22+
* Fix lost error message by test when after testInsertResultFail. by @ytetsuro in https://github.com/codeigniter4/CodeIgniter4/pull/6113
23+
* test: fix forgetting to restore DBDebug value by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6115
24+
25+
### Refactoring
26+
* Apply AutoRouterImproved::translateURIDashes() by @pjsde in https://github.com/codeigniter4/CodeIgniter4/pull/6084
27+
* Remove useless catch by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/6095
28+
* Move preload.php example to starter app by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/6088
29+
* style: compile sass by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6099
30+
331
## [v4.2.0](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.0) (2022-06-03)
432
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.1.9...v4.2.0)
533

admin/RELEASE.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ composer test && composer info codeigniter4/framework
8787
* Description: "CodeIgniter 4.x.x User Guide"
8888
* Watch for the "github pages" Environment to make sure the deployment succeeds
8989

90-
## Website
90+
### Website
9191

92-
Currently the User Guide on the website has to be updated manually. Visit Jim's user home
93-
where the served directory **codeigniter.com** exists. Copy the latest **docs** folder from
94-
the User Guide repo to **public/userguide4** and browse to the website to make sure it works.
92+
The User Guide website should update itself via the deploy GitHub Action. Should this fail
93+
the server must be updated manually. See repo and hosting details in the deploy script
94+
at the User Guide repo.
9595

9696
## Announcement
9797

admin/framework/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"mikey179/vfsstream": "^1.6",
2222
"nexusphp/cs-config": "^3.3",
2323
"phpunit/phpunit": "^9.1",
24-
"predis/predis": "^1.1"
24+
"predis/predis": "^1.1 || ^2.0"
2525
},
2626
"suggest": {
2727
"ext-fileinfo": "Improves mime type detection for files"

preload.php admin/starter/preload.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,14 @@ function str_contains(string $haystack, string $needle): bool
4141
}
4242
}
4343

44-
class Preload
44+
class preload
4545
{
4646
/**
4747
* @var array Paths to preload.
4848
*/
4949
private array $paths = [
5050
[
51-
'include' => // __DIR__ . '/vendor/codeigniter4/framework/system',
52-
__DIR__ . '/system',
51+
'include' => __DIR__ . '/vendor/codeigniter4/framework/system',
5352
'exclude' => [
5453
// Not needed if you don't use them.
5554
'/system/Database/OCI8/',
@@ -110,4 +109,4 @@ public function load()
110109
}
111110
}
112111

113-
(new Preload())->load();
112+
(new preload())->load();

app/Config/Mimes.php

+8-11
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ class Mimes
102102
],
103103
'pptx' => [
104104
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
105-
'application/x-zip',
106-
'application/zip',
107105
],
108106
'wbxml' => 'application/wbxml',
109107
'wmlc' => 'application/wmlc',
@@ -512,20 +510,19 @@ public static function guessExtensionFromType(string $type, ?string $proposedExt
512510

513511
$proposedExtension = trim(strtolower($proposedExtension ?? ''));
514512

515-
if ($proposedExtension !== '') {
516-
if (array_key_exists($proposedExtension, static::$mimes) && in_array($type, is_string(static::$mimes[$proposedExtension]) ? [static::$mimes[$proposedExtension]] : static::$mimes[$proposedExtension], true)) {
517-
// The detected mime type matches with the proposed extension.
518-
return $proposedExtension;
519-
}
520-
521-
// An extension was proposed, but the media type does not match the mime type list.
522-
return null;
513+
if (
514+
$proposedExtension !== ''
515+
&& array_key_exists($proposedExtension, static::$mimes)
516+
&& in_array($type, (array) static::$mimes[$proposedExtension], true)
517+
) {
518+
// The detected mime type matches with the proposed extension.
519+
return $proposedExtension;
523520
}
524521

525522
// Reverse check the mime type list if no extension was proposed.
526523
// This search is order sensitive!
527524
foreach (static::$mimes as $ext => $types) {
528-
if ((is_string($types) && $types === $type) || (is_array($types) && in_array($type, $types, true))) {
525+
if (in_array($type, (array) $types, true)) {
529526
return $ext;
530527
}
531528
}

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"nexusphp/tachycardia": "^1.0",
2424
"phpstan/phpstan": "^1.7.1",
2525
"phpunit/phpunit": "^9.1",
26-
"predis/predis": "^1.1",
27-
"rector/rector": "0.13.3"
26+
"predis/predis": "^1.1 || ^2.0",
27+
"rector/rector": "0.13.5"
2828
},
2929
"suggest": {
3030
"ext-fileinfo": "Improves mime type detection for files"

0 commit comments

Comments
 (0)