Skip to content

Commit

Permalink
Merge pull request #7512 from codeigniter4/develop
Browse files Browse the repository at this point in the history
4.3.5 Ready code
  • Loading branch information
kenjis authored May 21, 2023
2 parents 00a60e0 + a99a5f2 commit 3595944
Show file tree
Hide file tree
Showing 62 changed files with 960 additions and 211 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/test-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ jobs:
- '8.0'
- '8.1'
- '8.2'
include:
- php-version: '8.2'
composer-option: '--ignore-platform-req=php'

uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
with:
Expand All @@ -73,7 +70,6 @@ jobs:
enable-coverage: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
enable-profiling: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
extra-extensions: imagick, redis, memcached
extra-composer-options: ${{ matrix.composer-option }}

database-live-tests:
needs:
Expand All @@ -100,8 +96,6 @@ jobs:
- php-version: '7.4'
db-platform: MySQLi
mysql-version: '8.0'
- php-version: '8.2'
composer-option: '--ignore-platform-req=php'

uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
with:
Expand All @@ -115,7 +109,6 @@ jobs:
enable-coverage: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
enable-profiling: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
extra-extensions: mysqli, oci8, pgsql, sqlsrv-5.10.1, sqlite3
extra-composer-options: ${{ matrix.composer-option }}

separate-process-tests:
needs:
Expand All @@ -129,9 +122,6 @@ jobs:
- '8.0'
- '8.1'
- '8.2'
include:
- php-version: '8.2'
composer-option: '--ignore-platform-req=php'

uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
with:
Expand All @@ -143,7 +133,6 @@ jobs:
enable-coverage: true # needs xdebug for assertHeaderEmitted() tests
enable-profiling: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
extra-extensions: mysqli, oci8, pgsql, sqlsrv-5.10.1, sqlite3
extra-composer-options: ${{ matrix.composer-option }}

cache-live-tests:
needs:
Expand All @@ -157,9 +146,6 @@ jobs:
- '8.0'
- '8.1'
- '8.2'
include:
- php-version: '8.2'
composer-option: '--ignore-platform-req=php'

uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
with:
Expand All @@ -171,7 +157,6 @@ jobs:
enable-coverage: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
enable-profiling: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
extra-extensions: redis, memcached
extra-composer-options: ${{ matrix.composer-option }}

coveralls:
name: Upload coverage results to Coveralls
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog

## [v4.3.5](https://github.com/codeigniter4/CodeIgniter4/tree/v4.3.5) (2023-05-21)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.3.4...v4.3.5)

### SECURITY

* *Remote Code Execution Vulnerability in Validation Placeholders* was fixed. See the [Security advisory](https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-m6m8-6gq8-c9fj) for more information.
* fix: Session::stop() does not destroy session by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7503

### Fixed Bugs

* docs: remove incorrect @property in ResponseTrait by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7495
* fix: validation error when a closure is used in combination with permit_empty or if_exist rules by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/7492
* fix: standardize behavior of `make:cell` and `Cells` by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/7481
* fix: PostgreSQL getVersion() logic by @marekmosna in https://github.com/codeigniter4/CodeIgniter4/pull/7488
* fix: PostgreSQL getVersion() output by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7509

### Enhancements

* feat: user guide dark mode by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/7463

### Refactoring

* refactor: Entity variable by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7499

## [v4.3.4](https://github.com/codeigniter4/CodeIgniter4/tree/v4.3.4) (2023-04-27)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.3.3...v4.3.4)

Expand Down
4 changes: 2 additions & 2 deletions admin/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ the existing content.
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 **user_guide_src/source/changelogs/{next_version}.rst** and add it to
**index.rst** (See next-changelog-*.rst)
**index.rst** (See **next-changelog-*.rst**)
* Create **user_guide_src/source/installation/upgrade_{next_version}.rst** and add it to
**upgrading.rst**
**upgrading.rst** (See **next-upgrading-guide.rst**)

## After Publishing Security Advisory

Expand Down
50 changes: 50 additions & 0 deletions admin/next-upgrading-guide.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
##############################
Upgrading from {version} to {version}
##############################

Please refer to the upgrade instructions corresponding to your installation method.

- :ref:`Composer Installation App Starter Upgrading <app-starter-upgrading>`
- :ref:`Composer Installation Adding CodeIgniter4 to an Existing Project Upgrading <adding-codeigniter4-upgrading>`
- :ref:`Manual Installation Upgrading <installing-manual-upgrading>`

.. contents::
:local:
:depth: 2

Mandatory File Changes
**********************

Breaking Changes
****************

Breaking Enhancements
*********************

Project Files
*************

Some files in the **project space** (root, app, public, writable) received updates. Due to
these files being outside of the **system** scope they will not be changed without your intervention.

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

Content Changes
===============

The following files received significant changes (including deprecations or visual adjustments)
and it is recommended that you merge the updated versions with your application:

Config
------

- @TODO

All Changes
===========

This is a list of all files in the **project space** that received changes;
many will be simple comments or formatting that have no effect on the runtime:

- @TODO
2 changes: 2 additions & 0 deletions app/Config/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ class App extends BaseConfig
* by the application in descending order of priority. If no match is
* found, the first locale will be used.
*
* IncomingRequest::setLocale() also uses this list.
*
* @var string[]
*/
public array $supportedLocales = ['en'];
Expand Down
1 change: 1 addition & 0 deletions app/Config/Generators.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Generators extends BaseConfig
*/
public array $views = [
'make:cell' => 'CodeIgniter\Commands\Generators\Views\cell.tpl.php',
'make:cell_view' => 'CodeIgniter\Commands\Generators\Views\cell_view.tpl.php',
'make:command' => 'CodeIgniter\Commands\Generators\Views\command.tpl.php',
'make:config' => 'CodeIgniter\Commands\Generators\Views\config.tpl.php',
'make:controller' => 'CodeIgniter\Commands\Generators\Views\controller.tpl.php',
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"phpunit/phpcov": "^8.2",
"phpunit/phpunit": "^9.1",
"predis/predis": "^1.1 || ^2.0",
"rector/rector": "0.15.25",
"rector/rector": "0.16.0",
"vimeo/psalm": "^5.0"
},
"suggest": {
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ parameters:
count: 3
path: system/Database/MySQLi/PreparedQuery.php

-
message: "#^Strict comparison using \\=\\=\\= between array<string, int|string|null> and false will always evaluate to false\\.$#"
count: 1
path: system/Database/Postgre/Connection.php

-
message: "#^Access to an undefined property CodeIgniter\\\\Database\\\\BaseConnection\\:\\:\\$schema\\.$#"
count: 2
Expand Down
4 changes: 0 additions & 4 deletions system/API/ResponseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@

use CodeIgniter\Format\FormatterInterface;
use CodeIgniter\HTTP\IncomingRequest;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Config\Services;

/**
* Provides common, more readable, methods to provide
* consistent HTTP responses under a variety of common
* situations when working as an API.
*
* @property RequestInterface $request
* @property ResponseInterface $response
*/
trait ResponseTrait
{
Expand Down
6 changes: 3 additions & 3 deletions system/CLI/GeneratorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,15 @@ protected function qualifyClassName(): string
$component = singular($this->component);

/**
* @see https://regex101.com/r/a5KNCR/1
* @see https://regex101.com/r/a5KNCR/2
*/
$pattern = sprintf('/([a-z][a-z0-9_\/\\\\]+)(%s)/i', $component);
$pattern = sprintf('/([a-z][a-z0-9_\/\\\\]+)(%s)$/i', $component);

if (preg_match($pattern, $class, $matches) === 1) {
$class = $matches[1] . ucfirst($matches[2]);
}

if ($this->enabledSuffixing && $this->getOption('suffix') && ! strripos($class, $component)) {
if ($this->enabledSuffixing && $this->getOption('suffix') && preg_match($pattern, $class) !== 1) {
$class .= ucfirst($component);
}

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.4';
public const CI_VERSION = '4.3.5';

/**
* App startup time.
Expand Down
28 changes: 13 additions & 15 deletions system/Commands/Generators/CellGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class CellGenerator extends BaseCommand
*/
protected $options = [
'--namespace' => 'Set root namespace. Default: "APP_NAMESPACE".',
'--suffix' => 'Append the component title to the class name (e.g. User => UserCell).',
'--force' => 'Force overwrite existing file.',
];

Expand All @@ -74,27 +73,26 @@ class CellGenerator extends BaseCommand
*/
public function run(array $params)
{
// Generate the Class first
$this->component = 'Cell';
$this->directory = 'Cells';
$this->component = 'Cell';
$this->directory = 'Cells';

$params = array_merge($params, ['suffix' => null]);

$this->template = 'cell.tpl.php';
$this->classNameLang = 'CLI.generator.className.cell';

$this->generateClass($params);

// Generate the View
$this->name = 'make:cell_view';
$this->template = 'cell_view.tpl.php';
$this->classNameLang = 'CLI.generator.viewName.cell';

// Form the view name
$segments = explode('\\', $this->qualifyClassName());

$view = array_pop($segments);
$view = decamelize($view);
$segments[] = $view;
$view = implode('\\', $segments);
$className = $this->qualifyClassName();
$viewName = decamelize(class_basename($className));
$viewName = preg_replace('/([a-z][a-z0-9_\/\\\\]+)(_cell)$/i', '$1', $viewName) ?? $viewName;
$namespace = substr($className, 0, strrpos($className, '\\') + 1);

$this->template = 'cell_view.tpl.php';
$this->generateView($namespace . $viewName, $params);

$this->generateView($view, $params);
return 0;
}
}
4 changes: 2 additions & 2 deletions system/Database/BaseConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
* @property bool $transFailure
* @property bool $transStatus
*
* @template TConnection of object|resource
* @template TResult of object|resource
* @template TConnection
* @template TResult
*
* @implements ConnectionInterface<TConnection, TResult>
*/
Expand Down
6 changes: 3 additions & 3 deletions system/Database/BasePreparedQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
use ErrorException;

/**
* @template TConnection of object|resource
* @template TStatement of object|resource
* @template TResult of object|resource
* @template TConnection
* @template TStatement
* @template TResult
*
* @implements PreparedQueryInterface<TConnection, TStatement, TResult>
*/
Expand Down
8 changes: 5 additions & 3 deletions system/Database/BaseResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
use stdClass;

/**
* @template TConnection of object|resource
* @template TResult of object|resource
* @template TConnection
* @template TResult
*
* @implements ResultInterface<TConnection, TResult>
*/
Expand Down Expand Up @@ -499,6 +499,8 @@ abstract public function getFieldData(): array;

/**
* Frees the current result.
*
* @return void
*/
abstract public function freeResult();

Expand All @@ -525,7 +527,7 @@ abstract protected function fetchAssoc();
*
* Overridden by child classes.
*
* @return object
* @return Entity|false|object|stdClass
*/
abstract protected function fetchObject(string $className = 'stdClass');
}
4 changes: 2 additions & 2 deletions system/Database/ConnectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
namespace CodeIgniter\Database;

/**
* @template TConnection of object|resource
* @template TResult of object|resource
* @template TConnection
* @template TResult
*/
interface ConnectionInterface
{
Expand Down
2 changes: 2 additions & 0 deletions system/Database/MySQLi/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ public function getFieldData(): array

/**
* Frees the current result.
*
* @return void
*/
public function freeResult()
{
Expand Down
1 change: 1 addition & 0 deletions system/Database/OCI8/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use CodeIgniter\Database\BaseResult;
use CodeIgniter\Entity\Entity;
use stdClass;

/**
* Result for OCI8
Expand Down
9 changes: 7 additions & 2 deletions system/Database/Postgre/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,16 @@ public function getVersion(): string
return $this->dataCache['version'];
}

if (! $this->connID || ($pgVersion = pg_version($this->connID)) === false) {
if (! $this->connID) {
$this->initialize();
}

return isset($pgVersion['server']) ? $this->dataCache['version'] = $pgVersion['server'] : false;
$pgVersion = pg_version($this->connID);
$this->dataCache['version'] = isset($pgVersion['server']) ?
(preg_match('/^(\d+\.\d+)/', $pgVersion['server'], $matches) ? $matches[1] : '') :
'';

return $this->dataCache['version'];
}

/**
Expand Down
Loading

0 comments on commit 3595944

Please sign in to comment.