Skip to content

Commit 3595944

Browse files
authored
Merge pull request #7512 from codeigniter4/develop
4.3.5 Ready code
2 parents 00a60e0 + a99a5f2 commit 3595944

Some content is hidden

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

62 files changed

+960
-211
lines changed

.github/workflows/test-phpunit.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ jobs:
5959
- '8.0'
6060
- '8.1'
6161
- '8.2'
62-
include:
63-
- php-version: '8.2'
64-
composer-option: '--ignore-platform-req=php'
6562

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

7874
database-live-tests:
7975
needs:
@@ -100,8 +96,6 @@ jobs:
10096
- php-version: '7.4'
10197
db-platform: MySQLi
10298
mysql-version: '8.0'
103-
- php-version: '8.2'
104-
composer-option: '--ignore-platform-req=php'
10599

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

120113
separate-process-tests:
121114
needs:
@@ -129,9 +122,6 @@ jobs:
129122
- '8.0'
130123
- '8.1'
131124
- '8.2'
132-
include:
133-
- php-version: '8.2'
134-
composer-option: '--ignore-platform-req=php'
135125

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

148137
cache-live-tests:
149138
needs:
@@ -157,9 +146,6 @@ jobs:
157146
- '8.0'
158147
- '8.1'
159148
- '8.2'
160-
include:
161-
- php-version: '8.2'
162-
composer-option: '--ignore-platform-req=php'
163149

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

176161
coveralls:
177162
name: Upload coverage results to Coveralls

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# Changelog
22

3+
## [v4.3.5](https://github.com/codeigniter4/CodeIgniter4/tree/v4.3.5) (2023-05-21)
4+
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.3.4...v4.3.5)
5+
6+
### SECURITY
7+
8+
* *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.
9+
* fix: Session::stop() does not destroy session by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7503
10+
11+
### Fixed Bugs
12+
13+
* docs: remove incorrect @property in ResponseTrait by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7495
14+
* 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
15+
* fix: standardize behavior of `make:cell` and `Cells` by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/7481
16+
* fix: PostgreSQL getVersion() logic by @marekmosna in https://github.com/codeigniter4/CodeIgniter4/pull/7488
17+
* fix: PostgreSQL getVersion() output by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7509
18+
19+
### Enhancements
20+
21+
* feat: user guide dark mode by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/7463
22+
23+
### Refactoring
24+
25+
* refactor: Entity variable by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7499
26+
327
## [v4.3.4](https://github.com/codeigniter4/CodeIgniter4/tree/v4.3.4) (2023-04-27)
428
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.3.3...v4.3.4)
529

admin/RELEASE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ the existing content.
145145
changes as well as a link to the User Guide's changelog
146146
* Create a PR for new changelog and upgrade for the next version
147147
* Create **user_guide_src/source/changelogs/{next_version}.rst** and add it to
148-
**index.rst** (See next-changelog-*.rst)
148+
**index.rst** (See **next-changelog-*.rst**)
149149
* Create **user_guide_src/source/installation/upgrade_{next_version}.rst** and add it to
150-
**upgrading.rst**
150+
**upgrading.rst** (See **next-upgrading-guide.rst**)
151151

152152
## After Publishing Security Advisory
153153

admin/next-upgrading-guide.rst

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
##############################
2+
Upgrading from {version} to {version}
3+
##############################
4+
5+
Please refer to the upgrade instructions corresponding to your installation method.
6+
7+
- :ref:`Composer Installation App Starter Upgrading <app-starter-upgrading>`
8+
- :ref:`Composer Installation Adding CodeIgniter4 to an Existing Project Upgrading <adding-codeigniter4-upgrading>`
9+
- :ref:`Manual Installation Upgrading <installing-manual-upgrading>`
10+
11+
.. contents::
12+
:local:
13+
:depth: 2
14+
15+
Mandatory File Changes
16+
**********************
17+
18+
Breaking Changes
19+
****************
20+
21+
Breaking Enhancements
22+
*********************
23+
24+
Project Files
25+
*************
26+
27+
Some files in the **project space** (root, app, public, writable) received updates. Due to
28+
these files being outside of the **system** scope they will not be changed without your intervention.
29+
30+
There are some third-party CodeIgniter modules available to assist with merging changes to
31+
the project space: `Explore on Packagist <https://packagist.org/explore/?query=codeigniter4%20updates>`_.
32+
33+
Content Changes
34+
===============
35+
36+
The following files received significant changes (including deprecations or visual adjustments)
37+
and it is recommended that you merge the updated versions with your application:
38+
39+
Config
40+
------
41+
42+
- @TODO
43+
44+
All Changes
45+
===========
46+
47+
This is a list of all files in the **project space** that received changes;
48+
many will be simple comments or formatting that have no effect on the runtime:
49+
50+
- @TODO

app/Config/App.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ class App extends BaseConfig
9494
* by the application in descending order of priority. If no match is
9595
* found, the first locale will be used.
9696
*
97+
* IncomingRequest::setLocale() also uses this list.
98+
*
9799
* @var string[]
98100
*/
99101
public array $supportedLocales = ['en'];

app/Config/Generators.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class Generators extends BaseConfig
2727
*/
2828
public array $views = [
2929
'make:cell' => 'CodeIgniter\Commands\Generators\Views\cell.tpl.php',
30+
'make:cell_view' => 'CodeIgniter\Commands\Generators\Views\cell_view.tpl.php',
3031
'make:command' => 'CodeIgniter\Commands\Generators\Views\command.tpl.php',
3132
'make:config' => 'CodeIgniter\Commands\Generators\Views\config.tpl.php',
3233
'make:controller' => 'CodeIgniter\Commands\Generators\Views\controller.tpl.php',

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"phpunit/phpcov": "^8.2",
2525
"phpunit/phpunit": "^9.1",
2626
"predis/predis": "^1.1 || ^2.0",
27-
"rector/rector": "0.15.25",
27+
"rector/rector": "0.16.0",
2828
"vimeo/psalm": "^5.0"
2929
},
3030
"suggest": {

phpstan-baseline.neon.dist

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ parameters:
6565
count: 3
6666
path: system/Database/MySQLi/PreparedQuery.php
6767

68-
-
69-
message: "#^Strict comparison using \\=\\=\\= between array<string, int|string|null> and false will always evaluate to false\\.$#"
70-
count: 1
71-
path: system/Database/Postgre/Connection.php
72-
7368
-
7469
message: "#^Access to an undefined property CodeIgniter\\\\Database\\\\BaseConnection\\:\\:\\$schema\\.$#"
7570
count: 2

system/API/ResponseTrait.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,13 @@
1313

1414
use CodeIgniter\Format\FormatterInterface;
1515
use CodeIgniter\HTTP\IncomingRequest;
16-
use CodeIgniter\HTTP\RequestInterface;
1716
use CodeIgniter\HTTP\ResponseInterface;
1817
use Config\Services;
1918

2019
/**
2120
* Provides common, more readable, methods to provide
2221
* consistent HTTP responses under a variety of common
2322
* situations when working as an API.
24-
*
25-
* @property RequestInterface $request
26-
* @property ResponseInterface $response
2723
*/
2824
trait ResponseTrait
2925
{

system/CLI/GeneratorTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,15 @@ protected function qualifyClassName(): string
235235
$component = singular($this->component);
236236

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

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

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

system/CodeIgniter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class CodeIgniter
4747
/**
4848
* The current version of CodeIgniter Framework
4949
*/
50-
public const CI_VERSION = '4.3.4';
50+
public const CI_VERSION = '4.3.5';
5151

5252
/**
5353
* App startup time.

system/Commands/Generators/CellGenerator.php

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ class CellGenerator extends BaseCommand
6565
*/
6666
protected $options = [
6767
'--namespace' => 'Set root namespace. Default: "APP_NAMESPACE".',
68-
'--suffix' => 'Append the component title to the class name (e.g. User => UserCell).',
6968
'--force' => 'Force overwrite existing file.',
7069
];
7170

@@ -74,27 +73,26 @@ class CellGenerator extends BaseCommand
7473
*/
7574
public function run(array $params)
7675
{
77-
// Generate the Class first
78-
$this->component = 'Cell';
79-
$this->directory = 'Cells';
76+
$this->component = 'Cell';
77+
$this->directory = 'Cells';
78+
79+
$params = array_merge($params, ['suffix' => null]);
80+
8081
$this->template = 'cell.tpl.php';
8182
$this->classNameLang = 'CLI.generator.className.cell';
82-
8383
$this->generateClass($params);
8484

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

88-
// Form the view name
89-
$segments = explode('\\', $this->qualifyClassName());
90-
91-
$view = array_pop($segments);
92-
$view = decamelize($view);
93-
$segments[] = $view;
94-
$view = implode('\\', $segments);
89+
$className = $this->qualifyClassName();
90+
$viewName = decamelize(class_basename($className));
91+
$viewName = preg_replace('/([a-z][a-z0-9_\/\\\\]+)(_cell)$/i', '$1', $viewName) ?? $viewName;
92+
$namespace = substr($className, 0, strrpos($className, '\\') + 1);
9593

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

98-
$this->generateView($view, $params);
96+
return 0;
9997
}
10098
}

system/Database/BaseConnection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
* @property bool $transFailure
4747
* @property bool $transStatus
4848
*
49-
* @template TConnection of object|resource
50-
* @template TResult of object|resource
49+
* @template TConnection
50+
* @template TResult
5151
*
5252
* @implements ConnectionInterface<TConnection, TResult>
5353
*/

system/Database/BasePreparedQuery.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
use ErrorException;
1919

2020
/**
21-
* @template TConnection of object|resource
22-
* @template TStatement of object|resource
23-
* @template TResult of object|resource
21+
* @template TConnection
22+
* @template TStatement
23+
* @template TResult
2424
*
2525
* @implements PreparedQueryInterface<TConnection, TStatement, TResult>
2626
*/

system/Database/BaseResult.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
use stdClass;
1616

1717
/**
18-
* @template TConnection of object|resource
19-
* @template TResult of object|resource
18+
* @template TConnection
19+
* @template TResult
2020
*
2121
* @implements ResultInterface<TConnection, TResult>
2222
*/
@@ -499,6 +499,8 @@ abstract public function getFieldData(): array;
499499

500500
/**
501501
* Frees the current result.
502+
*
503+
* @return void
502504
*/
503505
abstract public function freeResult();
504506

@@ -525,7 +527,7 @@ abstract protected function fetchAssoc();
525527
*
526528
* Overridden by child classes.
527529
*
528-
* @return object
530+
* @return Entity|false|object|stdClass
529531
*/
530532
abstract protected function fetchObject(string $className = 'stdClass');
531533
}

system/Database/ConnectionInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
namespace CodeIgniter\Database;
1313

1414
/**
15-
* @template TConnection of object|resource
16-
* @template TResult of object|resource
15+
* @template TConnection
16+
* @template TResult
1717
*/
1818
interface ConnectionInterface
1919
{

system/Database/MySQLi/Result.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ public function getFieldData(): array
103103

104104
/**
105105
* Frees the current result.
106+
*
107+
* @return void
106108
*/
107109
public function freeResult()
108110
{

system/Database/OCI8/Result.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use CodeIgniter\Database\BaseResult;
1515
use CodeIgniter\Entity\Entity;
16+
use stdClass;
1617

1718
/**
1819
* Result for OCI8

system/Database/Postgre/Connection.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,16 @@ public function getVersion(): string
128128
return $this->dataCache['version'];
129129
}
130130

131-
if (! $this->connID || ($pgVersion = pg_version($this->connID)) === false) {
131+
if (! $this->connID) {
132132
$this->initialize();
133133
}
134134

135-
return isset($pgVersion['server']) ? $this->dataCache['version'] = $pgVersion['server'] : false;
135+
$pgVersion = pg_version($this->connID);
136+
$this->dataCache['version'] = isset($pgVersion['server']) ?
137+
(preg_match('/^(\d+\.\d+)/', $pgVersion['server'], $matches) ? $matches[1] : '') :
138+
'';
139+
140+
return $this->dataCache['version'];
136141
}
137142

138143
/**

0 commit comments

Comments
 (0)