Skip to content

Commit 51cdd7d

Browse files
authored
Merge pull request #9345 from codeigniter4/develop
4.5.6 Ready code
2 parents b0b7ecb + ebb5bd7 commit 51cdd7d

File tree

364 files changed

+17335
-20048
lines changed

Some content is hidden

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

364 files changed

+17335
-20048
lines changed

.github/workflows/deploy-distributables.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,15 @@ jobs:
159159
token: ${{ secrets.ACCESS_TOKEN }}
160160
path: userguide
161161

162+
- name: Setup Python
163+
uses: actions/setup-python@v5
164+
with:
165+
python-version: '3.12'
166+
162167
- name: Install Sphinx
163168
run: |
164-
sudo apt install python3-sphinx
165-
sudo pip3 install sphinxcontrib-phpdomain
166-
sudo pip3 install sphinx_rtd_theme
169+
python -m pip install --upgrade pip
170+
pip install -r ./source/user_guide_src/requirements.txt
167171
168172
- name: Chmod
169173
run: chmod +x ./source/.github/scripts/deploy-userguide

.github/workflows/deploy-userguide-latest.yml

+13-4
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,20 @@ jobs:
3333
php-version: '8.1'
3434
coverage: none
3535

36-
# Build the latest User Guide
37-
- name: Build with Sphinx
38-
uses: ammaraskar/[email protected]
36+
- name: Setup Python
37+
uses: actions/setup-python@v5
3938
with:
40-
docs-folder: user_guide_src/
39+
python-version: '3.12'
40+
41+
- name: Install Sphinx
42+
run: |
43+
python -m pip install --upgrade pip
44+
pip install -r user_guide_src/requirements.txt
45+
46+
# Build the latest User Guide
47+
- name: Build Docs with Sphinx
48+
run: make html
49+
working-directory: user_guide_src
4150

4251
- name: Add "Edit this page" links
4352
run: |

.github/workflows/reusable-coveralls.yml

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ jobs:
1313
runs-on: ubuntu-22.04
1414

1515
steps:
16+
- name: Checkout base branch for PR
17+
if: github.event_name == 'pull_request'
18+
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.base_ref }}
21+
1622
- name: Checkout
1723
uses: actions/checkout@v4
1824

.github/workflows/reusable-phpunit-test.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ jobs:
138138
steps:
139139
- name: Create database for MSSQL Server
140140
if: ${{ inputs.db-platform == 'SQLSRV' }}
141-
run: sqlcmd -S 127.0.0.1 -U sa -P 1Secure*Password1 -Q "CREATE DATABASE test"
141+
run: sqlcmd -S 127.0.0.1 -U sa -P 1Secure*Password1 -Q "CREATE DATABASE test COLLATE Latin1_General_100_CS_AS_SC_UTF8"
142142

143143
- name: Install latest ImageMagick
144144
if: ${{ contains(inputs.extra-extensions, 'imagick') }}
@@ -148,6 +148,12 @@ jobs:
148148
sudo apt-get install -y gsfonts libmagickwand-dev imagemagick
149149
sudo apt-get install --fix-broken
150150
151+
- name: Checkout base branch for PR
152+
if: github.event_name == 'pull_request'
153+
uses: actions/checkout@v4
154+
with:
155+
ref: ${{ github.base_ref }}
156+
151157
- name: Checkout
152158
uses: actions/checkout@v4
153159

.github/workflows/reusable-serviceless-phpunit-test.yml

+6
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ jobs:
6060
sudo apt-get install -y imagemagick
6161
sudo apt-get install --fix-broken
6262
63+
- name: Checkout base branch for PR
64+
if: github.event_name == 'pull_request'
65+
uses: actions/checkout@v4
66+
with:
67+
ref: ${{ github.base_ref }}
68+
6369
- name: Checkout
6470
uses: actions/checkout@v4
6571

.github/workflows/test-autoreview.yml

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ jobs:
3535
name: Check normalized composer.json
3636
runs-on: ubuntu-latest
3737
steps:
38+
- name: Checkout base branch for PR
39+
if: github.event_name == 'pull_request'
40+
uses: actions/checkout@v4
41+
with:
42+
ref: ${{ github.base_ref }}
43+
3844
- name: Checkout
3945
uses: actions/checkout@v4
4046

.github/workflows/test-coding-standards.yml

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ jobs:
3232
- '8.3'
3333

3434
steps:
35+
- name: Checkout base branch for PR
36+
if: github.event_name == 'pull_request'
37+
uses: actions/checkout@v4
38+
with:
39+
ref: ${{ github.base_ref }}
40+
3541
- name: Checkout
3642
uses: actions/checkout@v4
3743

.github/workflows/test-deptrac.yml

+6
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ jobs:
3636
name: Architectural Inspection
3737
runs-on: ubuntu-22.04
3838
steps:
39+
- name: Checkout base branch for PR
40+
if: github.event_name == 'pull_request'
41+
uses: actions/checkout@v4
42+
with:
43+
ref: ${{ github.base_ref }}
44+
3945
- name: Checkout
4046
uses: actions/checkout@v4
4147

.github/workflows/test-phpstan.yml

+6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ jobs:
4545
strategy:
4646
fail-fast: false
4747
steps:
48+
- name: Checkout base branch for PR
49+
if: github.event_name == 'pull_request'
50+
uses: actions/checkout@v4
51+
with:
52+
ref: ${{ github.base_ref }}
53+
4854
- name: Checkout
4955
uses: actions/checkout@v4
5056

.github/workflows/test-psalm.yml

+6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ jobs:
2727
if: (! contains(github.event.head_commit.message, '[ci skip]'))
2828

2929
steps:
30+
- name: Checkout base branch for PR
31+
if: github.event_name == 'pull_request'
32+
uses: actions/checkout@v4
33+
with:
34+
ref: ${{ github.base_ref }}
35+
3036
- name: Checkout
3137
uses: actions/checkout@v4
3238

.github/workflows/test-rector.yml

+6
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ jobs:
4747
matrix:
4848
php-versions: ['8.1', '8.3']
4949
steps:
50+
- name: Checkout base branch for PR
51+
if: github.event_name == 'pull_request'
52+
uses: actions/checkout@v4
53+
with:
54+
ref: ${{ github.base_ref }}
55+
5056
- name: Checkout
5157
uses: actions/checkout@v4
5258

.github/workflows/test-userguide.yml

+13-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,19 @@ jobs:
2626
- name: Checkout
2727
uses: actions/checkout@v4
2828

29+
- name: Setup Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: '3.12'
33+
34+
- name: Install Sphinx
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install -r user_guide_src/requirements.txt
38+
2939
- name: Detect usage of tabs in RST files
3040
run: php utils/check_tabs_in_rst.php
3141

32-
- uses: ammaraskar/[email protected]
33-
with:
34-
docs-folder: user_guide_src
35-
build-command: 'make html SPHINXOPTS="-W --keep-going -w /tmp/sphinx-log"'
42+
- name: Build Docs with Sphinx
43+
run: make html SPHINXOPTS="-W --keep-going -w /tmp/sphinx-log"
44+
working-directory: user_guide_src

.php-cs-fixer.tests.php

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
'_support/View/Cells/multiplier.php',
2727
'_support/View/Cells/colors.php',
2828
'_support/View/Cells/addition.php',
29+
'system/Database/Live/PreparedQueryTest.php',
2930
])
3031
->notName('#Foobar.php$#');
3132

CHANGELOG.md

+57
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,62 @@
11
# Changelog
22

3+
## [v4.5.6](https://github.com/codeigniter4/CodeIgniter4/tree/v4.5.6) (2024-12-28)
4+
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.5.5...v4.5.6)
5+
6+
### Fixed Bugs
7+
8+
* fix: auto_link() converts invalid strings like `://codeigniter.com` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/9180
9+
* fix: change session start log level by @element-code in https://github.com/codeigniter4/CodeIgniter4/pull/9221
10+
* fix: `getValidated()` when validation multiple asterisk by @ddevsr in https://github.com/codeigniter4/CodeIgniter4/pull/9220
11+
* fix: Parser - Equal key name replace conflict by @CosDiabos in https://github.com/codeigniter4/CodeIgniter4/pull/9246
12+
* fix: case-insensitivity in the `like()` method when in use with accented characters by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9238
13+
* fix: TypeError for routes when translateURIDashes is enabled by @maniaba in https://github.com/codeigniter4/CodeIgniter4/pull/9209
14+
* fix: `fetchGlobal()` with numeric key by @neznaika0 in https://github.com/codeigniter4/CodeIgniter4/pull/9251
15+
* fix: curl request crashes with params that give an int once hexed. by @ping-yee in https://github.com/codeigniter4/CodeIgniter4/pull/9198
16+
* docs: allow boolean values in the model for PHPStan by @ping-yee in https://github.com/codeigniter4/CodeIgniter4/pull/9276
17+
* fix: respect complex language strings when using validation by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9201
18+
* fix: `DownloadResponse` cache headers by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9237
19+
* docs: fix `@param` `ResponseInterface::setJSON()` also accepts objects by @JulianAtkins in https://github.com/codeigniter4/CodeIgniter4/pull/9287
20+
* fix: [CURLRequest] body contains "HTTP/1.0 200 Connection established" by @ping-yee in https://github.com/codeigniter4/CodeIgniter4/pull/9285
21+
* fix: `Postgre\Connection::reconnect()` `TypeError` in `pg_ping()` by @ping-yee in https://github.com/codeigniter4/CodeIgniter4/pull/9279
22+
* fix: primary key mapping in the model for the entity by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9307
23+
* fix: check if defined `WRITEPATH` exists by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9317
24+
* fix: handling binary data for prepared statement by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/9337
25+
26+
### Refactoring
27+
28+
* refactor: enable TypedPropertyFromAssignsRector by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/9184
29+
* refactor: enable ClosureReturnTypeRector by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/9187
30+
* refactor: remove unnecessary `is_countable()` check in `getMethodParams()` by @datamweb in https://github.com/codeigniter4/CodeIgniter4/pull/9206
31+
* refactor: add more readonly property definitions on AutoRouteCollector and SiteURI by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/9210
32+
* refactor: starter key handling in SodiumHandler by @datamweb in https://github.com/codeigniter4/CodeIgniter4/pull/9207
33+
* refactor: enable rector code quality level 14 by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/9232
34+
* refactor: cleanup `DatabaseHandler::gc()` for session by @grimpirate in https://github.com/codeigniter4/CodeIgniter4/pull/9230
35+
* refactor: enable rector code quality level 15 by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/9243
36+
* refactor: enable SimplifyBoolIdenticalTrueRector by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/9244
37+
* refactor: enable FlipTypeControlToUseExclusiveTypeRector by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/9253
38+
* refactor: flip assert and actual value position on tests by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/9260
39+
* perf: Improve call as `service()` by @neznaika0 in https://github.com/codeigniter4/CodeIgniter4/pull/9248
40+
* refactor: use compare empty array on Forge on keys property by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/9267
41+
* refactor: Fix `phpstan` errors related to `Autoloader` by @neznaika0 in https://github.com/codeigniter4/CodeIgniter4/pull/9249
42+
* refactor: use `Superglobals` in setting 'REQUEST_METHOD' in `FeatureT… by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9294
43+
* refactor: use `baseURI` instead of `base_uri` by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9296
44+
* refactor: Apply code quality level 31 for rector by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/9303
45+
* refactor: rename `stdclass` to `stdClass` by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9312
46+
* refactor: fix `phpDoc.parseError` errors by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9313
47+
* refactor: fix `method.nameCase` errors by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9315
48+
* refactor: rename `controller` to `Controller` by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9314
49+
* refactor: fix implicit array creation by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9316
50+
* refactor: follow up implicit variable array by @ddevsr in https://github.com/codeigniter4/CodeIgniter4/pull/9319
51+
* refactor: split phpstan-baseline into smaller files by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9299
52+
* refactor: upgrade to use phpstan 2 and rector 2 by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/9322
53+
* refactor: fix `Forge::processIndexes()` for empty `$this->fields` by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9330
54+
* refactor: `Reflection*::setAccessible()` is now no-op in PHP 8.1 by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9331
55+
* refactor: add `@throws RedirectException` in `Controller::initController` by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9327
56+
* refactor: fix warning on new static usage by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9342
57+
* refactor: fix used void return type by @paulbalandan in https://github.com/codeigniter4/CodeIgniter4/pull/9341
58+
* refactor: enable instanceof and strictBooleans rector set by @samsonasik in https://github.com/codeigniter4/CodeIgniter4/pull/9339
59+
360
## [v4.5.5](https://github.com/codeigniter4/CodeIgniter4/tree/v4.5.5) (2024-09-07)
461
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.5.4...v4.5.5)
562

admin/RELEASE.md

+26-22
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
- `4.y`: The next minor version. (e.g., `4.6`)
1313
- `4.z`: The next next minor version. (e.g., `4.7`)
1414

15+
> [!NOTE]
16+
> Copy this file, and replace the versions above with the actual versions.
17+
1518
## Merge `develop` branch into next minor version branch `4.y`
1619

1720
Before starting release process, if there are commits in `develop` branch that
@@ -35,6 +38,26 @@ If you release a new minor version.
3538
"Branch protection rules" to the next minor version. E.g. `4.5``4.6`
3639
* [ ] Delete the merged `4.y` branch (This closes all PRs to the branch)
3740

41+
## Preparation
42+
43+
Work off direct clones of the repos so the release branches persist for a time.
44+
45+
* [ ] Clone both **codeigniter4/CodeIgniter4** and **codeigniter4/userguide** and
46+
resolve any necessary PRs
47+
```console
48+
rm -rf CodeIgniter4.bk userguide.bk
49+
mv CodeIgniter4 CodeIgniter4.bk
50+
mv userguide userguide.bk
51+
git clone [email protected]:codeigniter4/CodeIgniter4.git
52+
git clone [email protected]:codeigniter4/userguide.git
53+
```
54+
* [ ] Vet the **admin/** folders for any removed hidden files (Action deploy scripts
55+
*do not remove these*)
56+
```console
57+
cd CodeIgniter4
58+
git diff --name-status origin/master admin/
59+
```
60+
3861
## Changelog
3962

4063
When generating the changelog each Pull Request to be included must have one of
@@ -65,33 +88,14 @@ the changelog.
6588
Copy the resulting content into **CHANGELOG.md** and adjust the format to match
6689
the existing content.
6790

68-
## Preparation
69-
70-
Work off direct clones of the repos so the release branches persist for a time.
71-
72-
* [ ] Clone both **codeigniter4/CodeIgniter4** and **codeigniter4/userguide** and
73-
resolve any necessary PRs
74-
```console
75-
rm -rf CodeIgniter4.bk userguide.bk
76-
mv CodeIgniter4 CodeIgniter4.bk
77-
mv userguide userguide.bk
78-
git clone [email protected]:codeigniter4/CodeIgniter4.git
79-
git clone [email protected]:codeigniter4/userguide.git
80-
```
81-
* [ ] Vet the **admin/** folders for any removed hidden files (Action deploy scripts
82-
*do not remove these*)
83-
```console
84-
cd CodeIgniter4
85-
git diff --name-status origin/master admin/
86-
```
87-
* [ ] Merge any Security Advisory PRs in private forks
88-
8991
## Process
9092

91-
> **Note** Most changes that need noting in the User Guide and docs should have
93+
> [!NOTE]
94+
> Most changes that need noting in the User Guide and docs should have
9295
> been included with their PR, so this process assumes you will not be
9396
> generating much new content.
9497
98+
* [ ] Merge any Security Advisory PRs in private forks
9599
* [ ] Replace **CHANGELOG.md** with the new version generated above
96100
* [ ] Update **user_guide_src/source/changelogs/v4.x.x.rst**
97101
* Remove the section titles that have no items

admin/starter/tests/session/ExampleSessionTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

33
use CodeIgniter\Test\CIUnitTestCase;
4-
use Config\Services;
54

65
/**
76
* @internal
@@ -10,7 +9,7 @@ final class ExampleSessionTest extends CIUnitTestCase
109
{
1110
public function testSessionSimple(): void
1211
{
13-
$session = Services::session();
12+
$session = service('session');
1413

1514
$session->set('logged_in', 123);
1615
$this->assertSame(123, $session->get('logged_in'));

admin/starter/tests/unit/HealthTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
use CodeIgniter\Test\CIUnitTestCase;
44
use Config\App;
5-
use Config\Services;
65
use Tests\Support\Libraries\ConfigReader;
76

87
/**
@@ -17,7 +16,7 @@ public function testIsDefinedAppPath(): void
1716

1817
public function testBaseUrlHasBeenSet(): void
1918
{
20-
$validation = Services::validation();
19+
$validation = service('validation');
2120

2221
$env = false;
2322

app/Config/Events.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
*/
4545
if (CI_DEBUG && ! is_cli()) {
4646
Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect');
47-
Services::toolbar()->respond();
47+
service('toolbar')->respond();
4848
// Hot Reload route - for framework use on the hot reloader.
4949
if (ENVIRONMENT === 'development') {
50-
Services::routes()->get('__hot-reload', static function (): void {
50+
service('routes')->get('__hot-reload', static function (): void {
5151
(new HotReloader())->run();
5252
});
5353
}

app/Config/Format.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ class Format extends BaseConfig
7272
*/
7373
public function getFormatter(string $mime)
7474
{
75-
return Services::format()->getFormatter($mime);
75+
return service('format')->getFormatter($mime);
7676
}
7777
}

0 commit comments

Comments
 (0)