Skip to content

Commit

Permalink
Merge pull request #7384 from codeigniter4/develop
Browse files Browse the repository at this point in the history
4.3.3 Ready code
  • Loading branch information
kenjis authored Mar 26, 2023
2 parents ba75eed + 25c7c21 commit 8a74161
Show file tree
Hide file tree
Showing 91 changed files with 1,039 additions and 382 deletions.
29 changes: 28 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,39 @@
# Changelog

## [v4.3.3](https://github.com/codeigniter4/CodeIgniter4/tree/v4.3.3) (2023-03-26)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.3.2...v4.3.3)

### Fixed Bugs

* docs: fix $systemDirectory path in existing project. by @jozefrebjak in https://github.com/codeigniter4/CodeIgniter4/pull/7289
* docs: fix message.rst and improve content_negotiation.rst by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7280
* fix: Encryption CI3 compatibility by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7273
* fix: [QueryBuilder] RawSql causes error when using like() and countAllResults() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7277
* fix: handling of null bytes in `Exceptions::renderBacktrace()` by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/7306
* fix: incorrect metadata querying of Redis cache by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/7307
* fix: [Email] add missing TLS 1.3 support by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7317
* docs: add warning to random_string() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7333
* fix: random_string() numeric by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7336
* docs: add note for addColumn() and NULL by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7342
* fix: respondNoContent() returns Kint script in development mode by @anggadarkprince in https://github.com/codeigniter4/CodeIgniter4/pull/7347
* fix: use first exception in exceptionHandler() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7341
* fix: random_string() alpha alnum nozero by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7344
* fix: migrate:rollback -b negative number by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7350
* fix: site_url() does not support protocol-relative links by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7353
* docs: add uri_string() BC in v4.3.2 by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7356
* fix: Cache FileHandler error when there is a folder in cache dir by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7361

### Refactoring

* refactor: consistent header name case by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7299

## [v4.3.2](https://github.com/codeigniter4/CodeIgniter4/tree/v4.3.2) (2023-02-18)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.3.1...v4.3.2)

### Breaking Changes

* fix: base_url() removes trailing slash in baseURL by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7200
* fix: remove parameter $relative in `uri_string()` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7135

### Fixed Bugs

Expand All @@ -14,7 +42,6 @@
* fix: remove `All` from `Options All -Indexes` in .htaccess by @sba in https://github.com/codeigniter4/CodeIgniter4/pull/7093
* fix: bug on stuck content-type header in Feature Testing by @baycik in https://github.com/codeigniter4/CodeIgniter4/pull/7112
* fix: ordering `Validation` show error by call `setRule()` by @ddevsr in https://github.com/codeigniter4/CodeIgniter4/pull/7149
* fix: remove parameter $relative in `uri_string()` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7135
* fix: [QueryBuilder] where() generates incorrect SQL when using RawSql by @sclubricants in https://github.com/codeigniter4/CodeIgniter4/pull/7147
* fix: [QueryBuilder] RawSql passed to set() disappears without error by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7148
* fix: [Parser] local_currency causes "Passing null to parameter" by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7157
Expand Down
74 changes: 49 additions & 25 deletions admin/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ If you release a new minor version.

## Changelog

When generating the changelog each Pull Request to be included must have one of the following [labels](https://github.com/codeigniter4/CodeIgniter4/labels):
When generating the changelog each Pull Request to be included must have one of
the following [labels](https://github.com/codeigniter4/CodeIgniter4/labels):
- **bug** ... PRs that fix bugs
- **enhancement** ... PRs to improve existing functionalities
- **new feature** ... PRs for new features
Expand All @@ -27,7 +28,8 @@ PRs with breaking changes must have the following additional label:

### Generate Changelog

To auto-generate, navigate to the [Releases](https://github.com/codeigniter4/CodeIgniter4/releases) page,
To auto-generate, navigate to the
[Releases](https://github.com/codeigniter4/CodeIgniter4/releases) page,
click the "Draft a new release" button.

* Tag: "v4.x.x" (Create new tag)
Expand All @@ -39,32 +41,42 @@ Check the resulting content. If there are items in the *Others* section which
should be included in the changelog, add a label to the PR and regenerate
the changelog.

Copy the resulting content into **CHANGELOG.md** and adjust the format to match the existing content.
Copy the resulting content into **CHANGELOG.md** and adjust the format to match
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 resolve any necessary PRs
* Clone both **codeigniter4/CodeIgniter4** and **codeigniter4/userguide** and
resolve any necessary PRs
```console
git clone [email protected]:codeigniter4/CodeIgniter4.git
git clone [email protected]:codeigniter4/userguide.git
```
* Vet the **admin/** folders for any removed hidden files (Action deploy scripts *do not remove these*)
* Vet the **admin/** folders for any removed hidden files (Action deploy scripts
*do not remove these*)
* 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.
> **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: `const CI_VERSION = '4.x.x';`
* Update **user_guide_src/source/conf.py** with the new `version = '4.x'` (if applicable) and `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)
and `release = '4.x.x'`
* Replace **CHANGELOG.md** with the new version generated above
* Set the date in **user_guide_src/source/changelogs/{version}.rst** to format `Release Date: January 31, 2021`
* Create a new changelog for the next version at **user_guide_src/source/changelogs/{next_version}.rst** and add it to **index.rst**
* Create **user_guide_src/source/installation/upgrade_{ver}.rst**, fill in the "All Changes" section, and add it to **upgrading.rst**
* git diff --name-status master -- . ':!system'
* Set the date in **user_guide_src/source/changelogs/{version}.rst** to format
`Release Date: January 31, 2021`
* Create a new changelog for the next version at
**user_guide_src/source/changelogs/{next_version}.rst** and add it to
**index.rst**
* Create **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'
* 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"
Expand All @@ -85,9 +97,13 @@ See the changelog: https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHA
## New Contributors
*
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**, **appstarter**, and **userguide** get updated
* Run the following commands to install and test `appstarter` and verify the new version:
* 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
version:
```console
composer create-project codeigniter4/appstarter release-test
cd release-test
Expand Down Expand Up @@ -121,22 +137,28 @@ git switch -c 4.x
git push origin HEAD
```
* Publish any Security Advisories that were resolved from private forks
* 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
* 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

## After Publishing Security Advisory

* Send a PR to [PHP Security Advisories Database](https://github.com/FriendsOfPHP/security-advisories).
* E.g. https://github.com/FriendsOfPHP/security-advisories/pull/606
* See https://github.com/FriendsOfPHP/security-advisories#contributing
* Don't forget to run `php -d memory_limit=-1 validator.php`, before submitting the PR
* Don't forget to run `php -d memory_limit=-1 validator.php`, before
submitting the PR

## Appendix

### Sphinx Installation

You may need to install Sphinx and its dependencies prior to building the User Guide.
You may need to install Sphinx and its dependencies prior to building the User
Guide.

This worked seamlessly on Ubuntu 20.04:
```console
sudo apt install python3-sphinx
Expand All @@ -152,8 +174,10 @@ sudo pip3 install sphinx_rtd_theme
* Build the ePub version of the User Guide: `make epub`
* Switch to the **userguide** repo and create a new branch `release-4.x.x`
* Replace **docs/** with **CodeIgniter4/user_guide_src/build/html**
* Ensure the file **docs/.nojekyll** exists or GitHub Pages will ignore folders with an underscore prefix
* Copy **CodeIgniter4/user_guide_src/build/epub/CodeIgniter.epub** to **./CodeIgniter4.x.x.epub**
* Ensure the file **docs/.nojekyll** exists or GitHub Pages will ignore folders
with an underscore prefix
* Copy **CodeIgniter4/user_guide_src/build/epub/CodeIgniter.epub** to
**./CodeIgniter4.x.x.epub**
* Commit the changes with "Update for 4.x.x" and push to origin
* Create a new PR from `release-4.x.x` to `develop`:
* Title: "Update for 4.x.x"
Expand All @@ -165,6 +189,6 @@ sudo pip3 install sphinx_rtd_theme
* Description: "CodeIgniter 4.x.x User Guide"
* Watch for the "github pages" Environment to make sure the deployment succeeds

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.
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.
2 changes: 1 addition & 1 deletion admin/framework/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"psr/log": "^1.1"
},
"require-dev": {
"kint-php/kint": "^5.0.3",
"kint-php/kint": "^5.0.4",
"codeigniter/coding-standard": "^1.5",
"fakerphp/faker": "^1.9",
"friendsofphp/php-cs-fixer": "3.13.0",
Expand Down
2 changes: 1 addition & 1 deletion app/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
* loaded early on, and may also contain additional functions
* that you'd like to use throughout your entire application
*
* @see: https://codeigniter4.github.io/CodeIgniter4/
* @see: https://codeigniter.com/user_guide/extending/common.html
*/
9 changes: 9 additions & 0 deletions app/Config/Encryption.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,13 @@ class Encryption extends BaseConfig
* Set to 'authentication' for CI3 Encryption compatibility.
*/
public string $authKeyInfo = '';

/**
* Cipher to use.
* This setting is only used by OpenSSLHandler.
*
* Set to 'AES-128-CBC' to decrypt encrypted data that encrypted
* by CI3 Encryption default configuration.
*/
public string $cipher = 'AES-256-CTR';
}
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
"psr/log": "^1.1"
},
"require-dev": {
"kint-php/kint": "^5.0.3",
"kint-php/kint": "^5.0.4",
"codeigniter/coding-standard": "^1.5",
"fakerphp/faker": "^1.9",
"friendsofphp/php-cs-fixer": "3.13.0",
"mikey179/vfsstream": "^1.6",
"nexusphp/cs-config": "^3.6",
"nexusphp/tachycardia": "^1.0",
Expand All @@ -25,7 +24,7 @@
"phpunit/phpcov": "^8.2",
"phpunit/phpunit": "^9.1",
"predis/predis": "^1.1 || ^2.0",
"rector/rector": "0.15.16",
"rector/rector": "0.15.23",
"vimeo/psalm": "^5.0"
},
"suggest": {
Expand Down
25 changes: 0 additions & 25 deletions phpstan-baseline.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ parameters:
count: 1
path: system/Cache/Handlers/FileHandler.php

-
message: "#^Unreachable statement \\- code above always terminates\\.$#"
count: 1
path: system/Cache/Handlers/MemcachedHandler.php

-
message: "#^Property CodeIgniter\\\\Cache\\\\Handlers\\\\RedisHandler\\:\\:\\$redis \\(Redis\\) in isset\\(\\) is not nullable\\.$#"
count: 1
Expand All @@ -50,16 +45,6 @@ parameters:
count: 1
path: system/Database/BaseConnection.php

-
message: "#^Unreachable statement \\- code above always terminates\\.$#"
count: 2
path: system/Database/BaseResult.php

-
message: "#^While loop condition is always true\\.$#"
count: 2
path: system/Database/BaseResult.php

-
message: "#^Access to an undefined property CodeIgniter\\\\Database\\\\ConnectionInterface\\:\\:\\$DBDriver\\.$#"
count: 2
Expand Down Expand Up @@ -260,21 +245,11 @@ parameters:
count: 1
path: system/Router/Router.php

-
message: "#^Strict comparison using \\=\\=\\= between string and true will always evaluate to false\\.$#"
count: 1
path: system/Session/Handlers/RedisHandler.php

-
message: "#^Property CodeIgniter\\\\Session\\\\Session\\:\\:\\$sessionExpiration \\(int\\) in isset\\(\\) is not nullable\\.$#"
count: 1
path: system/Session/Session.php

-
message: "#^Negated boolean expression is always false\\.$#"
count: 1
path: system/Test/CIUnitTestCase.php

-
message: "#^Access to an undefined property object\\:\\:\\$createdField\\.$#"
count: 1
Expand Down
1 change: 1 addition & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
__DIR__ . '/system/Debug/Toolbar/Views/toolbar.tpl.php',
__DIR__ . '/system/ThirdParty',
__DIR__ . '/tests/system/Config/fixtures',
__DIR__ . '/tests/system/Filters/fixtures',
__DIR__ . '/tests/_support',
JsonThrowOnErrorRector::class,
StringifyStrNeedlesRector::class,
Expand Down
2 changes: 2 additions & 0 deletions system/API/ResponseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ protected function respond($data = null, ?int $status = null, string $message =
if ($data === null && $status === null) {
$status = 404;
$output = null;
$this->format($data);
} elseif ($data === null && is_numeric($status)) {
$output = null;
$this->format($data);
} else {
$status = empty($status) ? 200 : $status;
$output = $this->format($data);
Expand Down
2 changes: 1 addition & 1 deletion system/Cache/Handlers/FileHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ protected function getDirFileInfo(string $sourceDir, bool $topLevelOnly = true,
while (false !== ($file = readdir($fp))) {
if (is_dir($sourceDir . $file) && $file[0] !== '.' && $topLevelOnly === false) {
$this->getDirFileInfo($sourceDir . $file . DIRECTORY_SEPARATOR, $topLevelOnly, true);
} elseif ($file[0] !== '.') {
} elseif (! is_dir($sourceDir . $file) && $file[0] !== '.') {
$_filedata[$file] = $this->getFileInfo($sourceDir . $file);
$_filedata[$file]['relative_path'] = $relativePath;
}
Expand Down
3 changes: 1 addition & 2 deletions system/Cache/Handlers/RedisHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,11 @@ public function getCacheInfo()
*/
public function getMetaData(string $key)
{
$key = static::validateKey($key, $this->prefix);
$value = $this->get($key);

if ($value !== null) {
$time = Time::now()->getTimestamp();
$ttl = $this->redis->ttl($key);
$ttl = $this->redis->ttl(static::validateKey($key, $this->prefix));

return [
'expire' => $ttl > 0 ? $time + $ttl : null,
Expand Down
2 changes: 1 addition & 1 deletion system/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class CodeIgniter
/**
* The current version of CodeIgniter Framework
*/
public const CI_VERSION = '4.3.2';
public const CI_VERSION = '4.3.3';

/**
* App startup time.
Expand Down
2 changes: 1 addition & 1 deletion system/Commands/Database/MigrateRollback.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class MigrateRollback extends BaseCommand
* @var array
*/
protected $options = [
'-b' => 'Specify a batch to roll back to; e.g. "3" to return to batch #3 or "-2" to roll back twice',
'-b' => 'Specify a batch to roll back to; e.g. "3" to return to batch #3',
'-g' => 'Set database group',
'-f' => 'Force command - this option allows you to bypass the confirmation question when running this command in a production environment',
];
Expand Down
1 change: 1 addition & 0 deletions system/Commands/Utilities/Routes/ControllerFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function find(): array
$nsArray = explode('\\', trim($this->namespace, '\\'));
$count = count($nsArray);
$ns = '';
$files = [];

for ($i = 0; $i < $count; $i++) {
$ns .= '\\' . array_shift($nsArray);
Expand Down
10 changes: 7 additions & 3 deletions system/Database/BaseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2021,9 +2021,9 @@ private function setAlias(string $alias): BaseBuilder
/**
* Sets update fields for upsert, update
*
* @param string|string[] $set
* @param bool $addToDefault adds update fields to the default ones
* @param array|null $ignore ignores items in set
* @param RawSql[]|string|string[] $set
* @param bool $addToDefault adds update fields to the default ones
* @param array|null $ignore ignores items in set
*
* @return $this
*/
Expand Down Expand Up @@ -3082,6 +3082,10 @@ protected function compileWhereHaving(string $qbKey): string
continue;
}

if ($qbkey instanceof RawSql) {
continue;
}

if ($qbkey['condition'] instanceof RawSql) {
$qbkey = $qbkey['condition'];

Expand Down
Loading

0 comments on commit 8a74161

Please sign in to comment.