Skip to content

Commit

Permalink
Merge pull request #8948 from codeigniter4/develop
Browse files Browse the repository at this point in the history
4.5.2 Ready code
  • Loading branch information
kenjis authored Jun 10, 2024
2 parents 432d724 + db9cfd4 commit 9c2ba1f
Show file tree
Hide file tree
Showing 539 changed files with 2,857 additions and 3,271 deletions.
9 changes: 6 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@ CONTRIBUTING.md export-ignore

# contributor/development files
tests/ export-ignore
tools/ export-ignore
utils/ export-ignore
.php-cs-fixer.dist.php export-ignore
.php-cs-fixer.no-header.php export-ignore
.php-cs-fixer.tests.php export-ignore
.php-cs-fixer.user-guide.php export-ignore
deptrac.yaml export-ignore
phpstan-baseline.neon.dist export-ignore
phpmetrics.json export-ignore
phpstan-baseline.php export-ignore
phpstan-bootstrap.php export-ignore
phpstan.neon.dist export-ignore
phpunit.xml.dist export-ignore
psalm_autoload.php export-ignore
psalm-baseline.php export-ignore
psalm-baseline.xml export-ignore
psalm.xml export-ignore
psalm_autoload.php export-ignore
rector.php export-ignore

# source user guide
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test-coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
matrix:
php-version:
- '8.1'
- '8.2'
- '8.3'

steps:
- name: Checkout
Expand Down Expand Up @@ -60,8 +60,11 @@ jobs:
- name: Run lint on `app/`, `admin/`, `public/`
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.no-header.php --using-cache=no --diff

- name: Run lint on `system/`, `tests`, `utils/`, and root PHP files
- name: Run lint on `system/`, `utils/`, and root PHP files
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff

- name: Run lint on `tests`
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.tests.php --using-cache=no --diff

- name: Run lint on `user_guide_src/source/`
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.user-guide.php --using-cache=no --diff
24 changes: 24 additions & 0 deletions .github/workflows/test-file-permissions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Check File Permissions

on:
pull_request:
push:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
permission-check:
name: Check File Permission
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Detect unnecessary execution permissions
run: php utils/check_permission_x.php
2 changes: 2 additions & 0 deletions .github/workflows/test-phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
paths:
- 'app/**.php'
- 'system/**.php'
- 'tests/**.php'
- 'utils/**.php'
- composer.json
- phpstan.neon.dist
Expand All @@ -23,6 +24,7 @@ on:
paths:
- 'app/**.php'
- 'system/**.php'
- 'tests/**.php'
- 'utils/**.php'
- composer.json
- phpstan.neon.dist
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
enable-artifact-upload: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }}
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-extensions: mysqli, oci8, pgsql, sqlsrv, sqlite3
extra-composer-options: ${{ matrix.composer-option }}

separate-process-tests:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test-psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: phpstan, phpunit
extensions: intl, json, mbstring, xml, oci8
extensions: intl, json, mbstring, xml, mysqli, oci8, pgsql, sqlsrv, sqlite3
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
26 changes: 14 additions & 12 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,29 @@
__DIR__ . '/.php-cs-fixer.no-header.php',
__DIR__ . '/.php-cs-fixer.tests.php',
__DIR__ . '/.php-cs-fixer.user-guide.php',
__DIR__ . '/preload.php',
__DIR__ . '/rector.php',
__DIR__ . '/spark',
]);

$overrides = [];
$overrides = [
// for updating to coding-standard
'modernize_strpos' => true,
'ordered_attributes' => ['order' => [], 'sort_algorithm' => 'alpha'],
'php_unit_attributes' => true,
];

$options = [
'cacheFile' => 'build/.php-cs-fixer.cache',
'finder' => $finder,
'cacheFile' => 'build/.php-cs-fixer.cache',
'finder' => $finder,
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
'customRules' => [
NoCodeSeparatorCommentFixer::name() => true,
],
];

$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
return Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
'CodeIgniter 4 framework',
'CodeIgniter Foundation',
'[email protected]'
);

$config
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
->setRules(array_merge($config->getRules(), [
NoCodeSeparatorCommentFixer::name() => true,
]));

return $config;
25 changes: 13 additions & 12 deletions .php-cs-fixer.no-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,20 @@
__DIR__ . '/admin/starter/builds',
]);

$overrides = [];

$options = [
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
'finder' => $finder,
$overrides = [
// for updating to coding-standard
'modernize_strpos' => true,
'ordered_attributes' => ['order' => [], 'sort_algorithm' => 'alpha'],
'php_unit_attributes' => true,
];

$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();

$config
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
->setRules(array_merge($config->getRules(), [
$options = [
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
'finder' => $finder,
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
'customRules' => [
NoCodeSeparatorCommentFixer::name() => true,
]));
],
];

return $config;
return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
22 changes: 11 additions & 11 deletions .php-cs-fixer.tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@

$overrides = [
'void_return' => true,
// for updating to coding-standard
'modernize_strpos' => true,
'ordered_attributes' => ['order' => [], 'sort_algorithm' => 'alpha'],
'php_unit_attributes' => true,
];

$options = [
'cacheFile' => 'build/.php-cs-fixer.tests.cache',
'finder' => $finder,
'cacheFile' => 'build/.php-cs-fixer.tests.cache',
'finder' => $finder,
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
'customRules' => [
NoCodeSeparatorCommentFixer::name() => true,
],
];

$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
return Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
'CodeIgniter 4 framework',
'CodeIgniter Foundation',
'[email protected]'
);

$config
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
->setRules(array_merge($config->getRules(), [
NoCodeSeparatorCommentFixer::name() => true,
]));

return $config;
22 changes: 11 additions & 11 deletions .php-cs-fixer.user-guide.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@
'import_symbols' => false,
'leading_backslash_in_global_namespace' => true,
],
// for updating to coding-standard
'modernize_strpos' => true,
'ordered_attributes' => ['order' => [], 'sort_algorithm' => 'alpha'],
'php_unit_attributes' => true,
];

$options = [
'cacheFile' => 'build/.php-cs-fixer.user-guide.cache',
'finder' => $finder,
];

$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();

$config
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
->setRules(array_merge($config->getRules(), [
'cacheFile' => 'build/.php-cs-fixer.user-guide.cache',
'finder' => $finder,
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
'customRules' => [
NoCodeSeparatorCommentFixer::name() => true,
]));
],
];

return $config;
return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog

## [v4.5.2](https://github.com/codeigniter4/CodeIgniter4/tree/v4.5.2) (2024-06-10)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.5.1...v4.5.2)

### Fixed Bugs

* chore: fix phpunit.xml.dist for appstarter by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8785
* fix: update `preload.php` for 4.5 by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8805
* fix: [ErrorException] Undefined array key in `spark phpini:check` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8804
* fix: incorrect Security exception message by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8818
* fix: [QueryBuilder] TypeError in join() with BETWEEN by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8792
* fix: [SQLSRV] Query Builder always sets `"<database>"."<schema>".` to the table name. by @ping-yee in https://github.com/codeigniter4/CodeIgniter4/pull/8786
* fix: remove unused undefined param $raw in MockCache::save() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8847
* fix: FileCollection pseudo-regex by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8868
* fix: [Model] casting may throw InvalidArgumentException: Invalid parameter: nullable by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8870
* fix: [Model] casting causes TypeError when finding no record by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8871
* fix: correct property default values in Email by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8855
* fix: CLI::promptByMultipleKeys() and prompt() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8873
* fix: [Postgres] show missing error message by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8913
* fix: TypeError in number_to_amount() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8932
* fix: Model::find() returns incorrect data with casting by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8933

### Refactoring

* refactor: remove unused path parameter on PhpStreamWrapper::stream_open() by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/8926

## [v4.5.1](https://github.com/codeigniter4/CodeIgniter4/tree/v4.5.1) (2024-04-14)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.5.0...v4.5.1)

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ PHP version 8.1 or higher is required, with the following extensions installed:
- [mbstring](http://php.net/manual/en/mbstring.installation.php)

> [!WARNING]
> The end of life date for PHP 7.4 was November 28, 2022.
> The end of life date for PHP 8.0 was November 26, 2023.
> If you are still using PHP 7.4 or 8.0, you should upgrade immediately.
> The end of life date for PHP 8.1 will be November 25, 2024.
> - The end of life date for PHP 7.4 was November 28, 2022.
> - The end of life date for PHP 8.0 was November 26, 2023.
> - If you are still using PHP 7.4 or 8.0, you should upgrade immediately.
> - The end of life date for PHP 8.1 will be December 31, 2025.
Additionally, make sure that the following extensions are enabled in your PHP:

Expand Down
8 changes: 4 additions & 4 deletions admin/framework/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ PHP version 8.1 or higher is required, with the following extensions installed:
- [mbstring](http://php.net/manual/en/mbstring.installation.php)

> [!WARNING]
> The end of life date for PHP 7.4 was November 28, 2022.
> The end of life date for PHP 8.0 was November 26, 2023.
> If you are still using PHP 7.4 or 8.0, you should upgrade immediately.
> The end of life date for PHP 8.1 will be November 25, 2024.
> - The end of life date for PHP 7.4 was November 28, 2022.
> - The end of life date for PHP 8.0 was November 26, 2023.
> - If you are still using PHP 7.4 or 8.0, you should upgrade immediately.
> - The end of life date for PHP 8.1 will be December 31, 2025.
Additionally, make sure that the following extensions are enabled in your PHP:

Expand Down
5 changes: 3 additions & 2 deletions admin/next-upgrading-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ 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>`_.
.. note:: 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
===============
Expand Down
8 changes: 4 additions & 4 deletions admin/starter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ PHP version 8.1 or higher is required, with the following extensions installed:
- [mbstring](http://php.net/manual/en/mbstring.installation.php)

> [!WARNING]
> The end of life date for PHP 7.4 was November 28, 2022.
> The end of life date for PHP 8.0 was November 26, 2023.
> If you are still using PHP 7.4 or 8.0, you should upgrade immediately.
> The end of life date for PHP 8.1 will be November 25, 2024.
> - The end of life date for PHP 7.4 was November 28, 2022.
> - The end of life date for PHP 8.0 was November 26, 2023.
> - If you are still using PHP 7.4 or 8.0, you should upgrade immediately.
> - The end of life date for PHP 8.1 will be December 31, 2025.
Additionally, make sure that the following extensions are enabled in your PHP:

Expand Down
2 changes: 1 addition & 1 deletion admin/starter/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="system/Test/bootstrap.php"
bootstrap="vendor/codeigniter4/framework/system/Test/bootstrap.php"
backupGlobals="false"
beStrictAboutOutputDuringTests="true"
colors="true"
Expand Down
Empty file modified admin/starter/tests/.htaccess
100755 → 100644
Empty file.
Empty file modified admin/starter/tests/index.html
100755 → 100644
Empty file.
15 changes: 0 additions & 15 deletions admin/userguide/.github/scripts/deploy

This file was deleted.

23 changes: 23 additions & 0 deletions admin/userguide/.github/scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh -e

# Deploys the User Guide to the production
# website. Triggered by updates to the GitHub
# codeigniter4/userguide repo's master branch.
# See https://github.com/codeigniter4/userguide/blob/master/.github/workflows/deploy.yml

REPO="/opt/userguide"
SITE="/home/public_html/userguides/userguide4"

if [ "$(id -u)" = "0" ]; then
echo "Cannot be run as root. Please run as the user for deployment."
exit 1
fi

cd "$REPO"
git switch master
git pull

cp -R "$REPO/docs" "$SITE.new"
mv "$SITE" "$SITE.old"
mv "$SITE.new" "$SITE"
rm -rf "$SITE.old"
4 changes: 2 additions & 2 deletions admin/userguide/.github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Deploy Production

on:
push:
branches:
branches:
- master

jobs:
Expand All @@ -19,4 +19,4 @@ jobs:
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: /opt/userguide/.github/scripts/deploy
script: /opt/userguide/.github/scripts/deploy.sh
Empty file modified app/Config/DocTypes.php
100755 → 100644
Empty file.
Loading

0 comments on commit 9c2ba1f

Please sign in to comment.