Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
a477400
docs: replace mixed in filter class.
ping-yee Apr 25, 2023
d9313c4
docs: replace type.
ping-yee Apr 27, 2023
172f246
docs: remove the section titles that have no items
kenjis Apr 27, 2023
31af271
docs: add changelog and upgrade guide for v4.3.5
kenjis Apr 27, 2023
b381b22
docs: add templete for next upgrading guide
kenjis Apr 27, 2023
f132558
user guide - dark mode
michalsn Dec 16, 2022
9a4d261
new and deprecated info
michalsn Jan 9, 2023
a0ec7ab
search text color update
michalsn Jan 10, 2023
041cb86
Merge pull request #7462 from kenjis/docs-new-changelog
kenjis Apr 28, 2023
3680f30
Url typo (double /)
gremirarunico Apr 28, 2023
1c28935
Controller name error in Controllers and Routing => URI Routing => Fo…
gremirarunico Apr 28, 2023
483674d
Merge pull request #7466 from gremirarunico/develop
kenjis Apr 29, 2023
8ac0d33
docs: add comment
kenjis Apr 29, 2023
4689e3f
docs: make depth 3
kenjis Apr 29, 2023
ab7f942
docs: add "Setting the Locale" section
kenjis Apr 29, 2023
b25726d
docs: decorate variable
kenjis Apr 29, 2023
dc5bf05
docs: change section title
kenjis Apr 29, 2023
c52050e
docs: change sentence to note
kenjis Apr 29, 2023
729634c
Merge pull request #7468 from kenjis/fix-docs-setlocale
kenjis Apr 29, 2023
586c56c
docs: remove type resource in @template
kenjis Apr 14, 2023
f7c5b7e
docs: remove unused @templete in interfaces
kenjis Apr 14, 2023
372435d
docs: fix @return type
kenjis Apr 14, 2023
bd17c8f
fix: MockResult::dataSeek() return type
kenjis Apr 14, 2023
377ef3d
docs: restore @template with no types
kenjis Apr 30, 2023
49f1201
add important to some css classes
michalsn Apr 30, 2023
831a401
docs: change back mixed return type in filterInterface class.
ping-yee May 1, 2023
b1e6a21
change css for tables
michalsn May 1, 2023
c2842c6
Merge pull request #7463 from michalsn/feat/user-guide-dark-mode
kenjis May 2, 2023
824ca83
Merge pull request #7436 from kenjis/fix-phpdoc-types-database
kenjis May 4, 2023
8eadea8
Remove composer compatibility option for PHP 8.2
paulbalandan May 4, 2023
b9b9e48
Merge pull request #7480 from paulbalandan/remove-8.2-compat
paulbalandan May 4, 2023
acfb51d
build(deps-dev): update rector/rector requirement from 0.15.25 to 0.16.0
dependabot[bot] May 5, 2023
19c28a1
Merge pull request #7482 from codeigniter4/dependabot/composer/rector…
samsonasik May 5, 2023
42b174f
Merge pull request #7451 from ping-yee/docs-replace-filter
kenjis May 9, 2023
44c0c19
fix: validation error when a closure is used in combination with perm…
michalsn May 11, 2023
31f82f9
docs: remove incorrect @property
kenjis May 12, 2023
2d574c3
docs: add section titles
kenjis May 13, 2023
c9b62d8
docs: fix section level
kenjis May 13, 2023
f647602
docs: add empty line
kenjis May 13, 2023
4a5030d
docs: change important to warning
kenjis May 13, 2023
6c33a3c
docs: add spaces before and after `=`
kenjis May 13, 2023
075fa7d
docs: add link to dotenv file explanation
kenjis May 13, 2023
81c5e48
Merge pull request #7495 from kenjis/fix-phpdoc-ResponseTrait
kenjis May 14, 2023
fb0583f
Merge pull request #7492 from michalsn/fix/closure-with-permit_empty
kenjis May 14, 2023
302f2f1
refactor: do not reassign $key
kenjis May 14, 2023
af0c2f1
refactor: rename variable name
kenjis May 14, 2023
9b74099
docs: improve comment
kenjis May 14, 2023
38840b0
Merge pull request #7498 from kenjis/fix-docs-dotenv
kenjis May 16, 2023
2f405da
fix: Session::stop() does not destory the session
kenjis May 17, 2023
4baf5ab
docs: update docs
kenjis May 17, 2023
1e006ca
fix: typo in log message
kenjis May 17, 2023
862c333
Merge pull request #7504 from kenjis/fix-session-log-msg
kenjis May 17, 2023
52ac307
docs: require PostgreSQL 7.4 or later
kenjis May 17, 2023
d670d69
Merge pull request #7507 from kenjis/fix-docs-requirements.rst
kenjis May 18, 2023
4f8c46b
Standardize cell behavior
paulbalandan May 11, 2023
6f05243
Update cell documentation
paulbalandan May 11, 2023
735b823
Merge pull request #7499 from kenjis/refactor-Entity-variable
kenjis May 19, 2023
509b38a
Merge pull request #7503 from kenjis/fix-session-stop
kenjis May 19, 2023
601d98e
refactor: normailze $this->rules
kenjis Apr 29, 2023
249c915
fix: add missing validation for placeholder field
kenjis Apr 29, 2023
a6024ba
docs: add docs
kenjis Apr 29, 2023
2e7eb50
doc: simpler wording
kenjis May 2, 2023
4c6e4ec
Fix PostgreSQL getVersion() logic
marekmosna May 9, 2023
81f280f
Improve exception message
paulbalandan May 20, 2023
61df4df
Merge pull request #7481 from paulbalandan/standard-make-cell
kenjis May 21, 2023
d334a2a
Merge pull request #7488 from marekmosna/7484-postgresql-server-version
kenjis May 21, 2023
00993a3
test: add test for getVersion()
kenjis May 21, 2023
55970d0
fix: PostgreSQL version
kenjis May 21, 2023
dee68cc
Merge pull request #7509 from kenjis/test-db-getVersion
kenjis May 21, 2023
6af6771
Merge pull request from GHSA-m6m8-6gq8-c9fj
kenjis May 21, 2023
6234eb3
test: fix Model Validation tests
kenjis May 21, 2023
2c9f381
Merge pull request #7511 from kenjis/test-fix-model-validation-placeh…
kenjis May 21, 2023
ffdc4d0
Prep for 4.3.5 release
kenjis May 21, 2023
a99a5f2
Merge pull request #7510 from kenjis/release-4.3.5
kenjis May 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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