Skip to content

Commit

Permalink
Merge pull request #8098 from codeigniter4/develop
Browse files Browse the repository at this point in the history
4.4.3 Ready code
  • Loading branch information
kenjis authored Oct 26, 2023
2 parents cf43310 + 2b3ec1a commit 4b71437
Show file tree
Hide file tree
Showing 45 changed files with 467 additions and 129 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-scss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
# Changelog

## [v4.4.2](https://github.com/codeigniter4/CodeIgniter4/tree/v4.4.1) (2023-10-19)
## [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

* *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.2) (2023-10-19)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.4.1...v4.4.2)

### Fixed Bugs
Expand Down
69 changes: 40 additions & 29 deletions admin/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -48,47 +48,57 @@ 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

> **Note** Most changes that need noting in the User Guide and docs should have
> 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`
Expand All @@ -103,53 +113,54 @@ 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
git merge origin/develop
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
git merge origin/4.x
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
Expand Down
2 changes: 2 additions & 0 deletions app/Config/Boot/development.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 2 additions & 0 deletions app/Config/Boot/production.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions app/Config/Boot/testing.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/*
* The environment testing is reserved for PHPUnit testing. It has special
* conditions built into the framework at various places to assist with that.
* You can’t use it for your development.
*/

/*
|--------------------------------------------------------------------------
| ERROR DISPLAY
Expand Down
5 changes: 3 additions & 2 deletions app/Config/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ class Filters extends BaseConfig
* Configures aliases for Filter classes to
* make reading things nicer and simpler.
*
* @var array<string, string>
* @phpstan-var array<string, class-string>
* @var array<string, array<int, string>|string> [filter_name => classname]
* or [filter_name => [classname1, classname2, ...]]
* @phpstan-var array<string, class-string|list<class-string>>
*/
public array $aliases = [
'csrf' => CSRF::class,
Expand Down
2 changes: 1 addition & 1 deletion app/Views/errors/html/error_404.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<?= nl2br(esc($message)) ?>
<?php else : ?>
<?= lang('Errors.sorryCannotFind') ?>
<?php endif ?>
<?php endif; ?>
</p>
</div>
</body>
Expand Down
7 changes: 5 additions & 2 deletions app/Views/errors/html/error_exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<?php endif; ?>
</div>
<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) : ?>
<div class="container">

<ul class="tabs" id="tabs">
Expand All @@ -66,7 +67,7 @@
<li>
<p>
<!-- Trace info -->
<?php if (isset($row['file']) && is_file($row['file'])) :?>
<?php if (isset($row['file']) && is_file($row['file'])) : ?>
<?php
if (isset($row['function']) && in_array($row['function'], ['include', 'include_once', 'require', 'require_once'], true)) {
echo esc($row['function'] . ' ' . clean_path($row['file']));
Expand Down Expand Up @@ -375,14 +376,16 @@
</div> <!-- /tab-content -->

</div> <!-- /container -->
<?php endif; ?>

<div class="footer">
<div class="container">

<p>
Displayed at <?= esc(date('H:i:sa')) ?> &mdash;
PHP: <?= esc(PHP_VERSION) ?> &mdash;
CodeIgniter: <?= esc(CodeIgniter::CI_VERSION) ?>
CodeIgniter: <?= esc(CodeIgniter::CI_VERSION) ?> --
Environment: <?= ENVIRONMENT ?>
</p>

</div>
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": {
Expand Down
10 changes: 0 additions & 10 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 0 additions & 5 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,3 @@ parameters:
booleansInConditions: true
disallowedConstructs: true
matchingInheritedMethodNames: true
ignoreErrors:
- '#^Call to function config with Config\\.+\:\:class is discouraged\.$#'
codeigniter:
additionalConfigNamespaces:
- CodeIgniter\Config\
2 changes: 1 addition & 1 deletion system/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 3 additions & 4 deletions system/Commands/Generators/ModelGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ 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';
$table = is_string($table) ? $table : plural(strtolower($baseClass));
$return = is_string($return) ? $return : 'array';

if (! in_array($return, ['array', 'object', 'entity'], true)) {
// @codeCoverageIgnoreStart
Expand All @@ -129,6 +128,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('dbGroup'));
}
}
2 changes: 2 additions & 0 deletions system/Commands/Generators/Views/model.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

class {class} extends Model
{
<?php if (is_string($dbGroup)): ?>
protected $DBGroup = '{dbGroup}';
<?php endif; ?>
protected $table = '{table}';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
Expand Down
2 changes: 1 addition & 1 deletion system/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 4b71437

Please sign in to comment.