Skip to content

Commit

Permalink
Merge pull request #6136 from codeigniter4/develop
Browse files Browse the repository at this point in the history
4.2.1 Ready code
  • Loading branch information
MGatner authored Jun 16, 2022
2 parents 394a6c6 + 380fb88 commit 061356b
Show file tree
Hide file tree
Showing 85 changed files with 856 additions and 397 deletions.
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Each pull request should address a single issue and have a meaningful title.

- All bug fixes should be sent to the __"develop"__ branch, this is where the next bug fix version will be developed.
- PRs with any enhancement should be sent to the next minor version branch, e.g. __"4.3"__

**Description**
Explain what you have changed, and why.

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-deptrac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
branches:
- 'develop'
- 'v4.*'
- '4.*'
paths:
- 'app/**.php'
- 'system/**.php'
Expand All @@ -16,7 +16,7 @@ on:
push:
branches:
- 'develop'
- 'v4.*'
- '4.*'
paths:
- 'app/**.php'
- 'system/**.php'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-phpcpd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
branches:
- 'develop'
- 'v4.*'
- '4.*'
paths:
- 'app/**.php'
- 'public/**.php'
Expand All @@ -16,7 +16,7 @@ on:
push:
branches:
- 'develop'
- 'v4.*'
- '4.*'
paths:
- 'app/**.php'
- 'public/**.php'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
branches:
- 'develop'
- 'v4.*'
- '4.*'
paths:
- 'app/**.php'
- 'system/**.php'
Expand All @@ -18,7 +18,7 @@ on:
push:
branches:
- 'develop'
- 'v4.*'
- '4.*'
paths:
- 'app/**.php'
- 'system/**.php'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- develop
- '4.*'
paths:
- 'app/**.php'
- 'system/**.php'
Expand All @@ -16,7 +17,7 @@ on:
pull_request:
branches:
- develop
- 'v4.*'
- '4.*'
paths:
- 'app/**.php'
- 'system/**.php'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
branches:
- 'develop'
- 'v4.*'
- '4.*'
paths:
- 'app/**.php'
- 'system/**.php'
Expand All @@ -18,7 +18,7 @@ on:
push:
branches:
- 'develop'
- 'v4.*'
- '4.*'
paths:
- 'app/**.php'
- 'system/**.php'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-scss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
branches:
- 'develop'
- 'v4.x'
- '4.*'
paths:
- '**.scss'
- '**.css'
Expand All @@ -13,7 +13,7 @@ on:
push:
branches:
- 'develop'
- 'v4.x'
- '4.*'
paths:
- '**.scss'
- '**.css'
Expand Down
1 change: 0 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
__DIR__ . '/.php-cs-fixer.user-guide.php',
__DIR__ . '/rector.php',
__DIR__ . '/spark',
__DIR__ . '/user_guide_src/renumerate.php',
]);

$overrides = [];
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## [v4.2.1](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.1) (2022-06-16)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.2.0...v4.2.1)

### Breaking Changes
* Fix MIME guessing of extension from type by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/6059
* fix: get_cookie() may not use the cookie prefix by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6082

### Fixed Bugs
* fix: get_cookie() does not take Config\Cookie::$prefix by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6080
* fix: session cookie name bug by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6091
* fix: Session Handlers do not take Config\Cookie by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6081
* fix: reverse routing does not work with full classname starting with `\` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6104
* fix: insert error message in QueryBuilder by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6108
* fix: `spark routes` shows "ERROR: 404" by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6098
* fix: Time::setTestNow() does not work with fa Locale by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6116
* fix: `migrate --all` causes `Class "SQLite3" not found` error by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6117
* fix: event DBQuery is not fired on failed query when DBDebug is true by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6127
* fix: `Time::humanize()` causes error with ar locale by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6120
* Fix decorators by @lonnieezell in https://github.com/codeigniter4/CodeIgniter4/pull/6090
* Fix lost error message by test when after testInsertResultFail. by @ytetsuro in https://github.com/codeigniter4/CodeIgniter4/pull/6113
* test: fix forgetting to restore DBDebug value by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6115

### Refactoring
* Apply AutoRouterImproved::translateURIDashes() by @pjsde in https://github.com/codeigniter4/CodeIgniter4/pull/6084
* Remove useless catch by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/6095
* Move preload.php example to starter app by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/6088
* style: compile sass by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6099

## [v4.2.0](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.0) (2022-06-03)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.1.9...v4.2.0)

Expand Down
8 changes: 4 additions & 4 deletions admin/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ composer test && composer info codeigniter4/framework
* Description: "CodeIgniter 4.x.x User Guide"
* Watch for the "github pages" Environment to make sure the deployment succeeds

## Website
### Website

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

## Announcement

Expand Down
2 changes: 1 addition & 1 deletion admin/framework/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"mikey179/vfsstream": "^1.6",
"nexusphp/cs-config": "^3.3",
"phpunit/phpunit": "^9.1",
"predis/predis": "^1.1"
"predis/predis": "^1.1 || ^2.0"
},
"suggest": {
"ext-fileinfo": "Improves mime type detection for files"
Expand Down
7 changes: 3 additions & 4 deletions preload.php → admin/starter/preload.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,14 @@ function str_contains(string $haystack, string $needle): bool
}
}

class Preload
class preload
{
/**
* @var array Paths to preload.
*/
private array $paths = [
[
'include' => // __DIR__ . '/vendor/codeigniter4/framework/system',
__DIR__ . '/system',
'include' => __DIR__ . '/vendor/codeigniter4/framework/system',
'exclude' => [
// Not needed if you don't use them.
'/system/Database/OCI8/',
Expand Down Expand Up @@ -110,4 +109,4 @@ public function load()
}
}

(new Preload())->load();
(new preload())->load();
19 changes: 8 additions & 11 deletions app/Config/Mimes.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ class Mimes
],
'pptx' => [
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'application/x-zip',
'application/zip',
],
'wbxml' => 'application/wbxml',
'wmlc' => 'application/wmlc',
Expand Down Expand Up @@ -512,20 +510,19 @@ public static function guessExtensionFromType(string $type, ?string $proposedExt

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

if ($proposedExtension !== '') {
if (array_key_exists($proposedExtension, static::$mimes) && in_array($type, is_string(static::$mimes[$proposedExtension]) ? [static::$mimes[$proposedExtension]] : static::$mimes[$proposedExtension], true)) {
// The detected mime type matches with the proposed extension.
return $proposedExtension;
}

// An extension was proposed, but the media type does not match the mime type list.
return null;
if (
$proposedExtension !== ''
&& array_key_exists($proposedExtension, static::$mimes)
&& in_array($type, (array) static::$mimes[$proposedExtension], true)
) {
// The detected mime type matches with the proposed extension.
return $proposedExtension;
}

// Reverse check the mime type list if no extension was proposed.
// This search is order sensitive!
foreach (static::$mimes as $ext => $types) {
if ((is_string($types) && $types === $type) || (is_array($types) && in_array($type, $types, true))) {
if (in_array($type, (array) $types, true)) {
return $ext;
}
}
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"nexusphp/tachycardia": "^1.0",
"phpstan/phpstan": "^1.7.1",
"phpunit/phpunit": "^9.1",
"predis/predis": "^1.1",
"rector/rector": "0.13.3"
"predis/predis": "^1.1 || ^2.0",
"rector/rector": "0.13.5"
},
"suggest": {
"ext-fileinfo": "Improves mime type detection for files"
Expand Down
Loading

0 comments on commit 061356b

Please sign in to comment.