Skip to content

Commit 558db23

Browse files
authored
Merge pull request #7065 from codeigniter4/develop
4.2.12 Ready code
2 parents f04c67d + 96af785 commit 558db23

File tree

92 files changed

+702
-256
lines changed

Some content is hidden

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

92 files changed

+702
-256
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ body:
2525
description: Which PHP versions did you run your code?
2626
multiple: true
2727
options:
28-
- '7.3'
2928
- '7.4'
3029
- '8.0'
3130
- '8.1'
31+
- '8.2'
3232
validations:
3333
required: true
3434

.github/scripts/deploy-userguide

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ cd $TARGET
2323
git checkout master
2424
rm -rf docs
2525

26+
# Copy common files
27+
cp -Rf ${SOURCE}/LICENSE ./
28+
29+
# Copy repo-specific files
30+
cp -Rf ${SOURCE}/admin/userguide/. ./
31+
2632
# Copy files
2733
cp -Rf ${SOURCE}/user_guide_src/build/html ./docs
2834
cp -Rf ${SOURCE}/user_guide_src/build/epub/CodeIgniter.epub ./CodeIgniter${VERSION}.epub

.github/workflows/deploy-apidocs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ on:
1111
- 'system/**'
1212
- '.github/workflows/deploy-apidocs.yml'
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
build:
1619
name: Deploy to api
20+
permissions:
21+
contents: write
1722
if: github.repository == 'codeigniter4/CodeIgniter4'
1823
runs-on: ubuntu-22.04
1924

.github/workflows/deploy-distributables.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
release:
77
types: [published]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
check-version:
1114
name: Check for updated version
@@ -31,6 +34,9 @@ jobs:
3134
3235
framework:
3336
name: Deploy to framework
37+
permissions:
38+
# Allow actions/github-script to create release
39+
contents: write
3440
if: github.repository == 'codeigniter4/CodeIgniter4'
3541
runs-on: ubuntu-22.04
3642
needs: check-version
@@ -78,6 +84,9 @@ jobs:
7884
7985
appstarter:
8086
name: Deploy to appstarter
87+
permissions:
88+
# Allow actions/github-script to create release
89+
contents: write
8190
if: github.repository == 'codeigniter4/CodeIgniter4'
8291
runs-on: ubuntu-22.04
8392
needs: check-version
@@ -125,6 +134,9 @@ jobs:
125134
126135
userguide:
127136
name: Deploy to userguide
137+
permissions:
138+
# Allow actions/github-script to create release
139+
contents: write
128140
if: github.repository == 'codeigniter4/CodeIgniter4'
129141
runs-on: ubuntu-22.04
130142
needs: check-version

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,15 @@ on:
1212
paths:
1313
- 'user_guide_src/**'
1414

15+
permissions:
16+
contents: read
17+
1518
jobs:
1619
build:
1720
name: Deploy to gh-pages
21+
permissions:
22+
# Allow ad-m/github-push-action to push commit to branch gh-pages
23+
contents: write
1824
if: (github.repository == 'codeigniter4/CodeIgniter4')
1925
runs-on: ubuntu-latest
2026
steps:

.github/workflows/test-autoreview.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ concurrency:
1818
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1919
cancel-in-progress: true
2020

21+
permissions:
22+
contents: read
23+
2124
jobs:
2225
auto-review-tests:
2326
uses: ./.github/workflows/reusable-serviceless-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ concurrency:
1616
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1717
cancel-in-progress: true
1818

19+
permissions:
20+
contents: read
21+
1922
jobs:
2023
lint:
2124
name: PHP ${{ matrix.php-version }} Lint with PHP CS Fixer

.github/workflows/test-deptrac.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ concurrency:
2828
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
2929
cancel-in-progress: true
3030

31+
permissions:
32+
contents: read
33+
3134
jobs:
3235
build:
3336
name: Architectural Inspection
@@ -73,3 +76,5 @@ jobs:
7376
run: |
7477
sudo phive --no-progress install --global qossmic/deptrac --trust-gpg-keys B8F640134AB1782E
7578
deptrac analyze --cache-file=build/deptrac.cache
79+
env:
80+
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-phpcpd.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ concurrency:
2727
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
2828
cancel-in-progress: true
2929

30+
permissions:
31+
contents: read
32+
3033
jobs:
3134
build:
3235
name: Duplicate Code Detection

.github/workflows/test-phpstan.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ concurrency:
3131
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
3232
cancel-in-progress: true
3333

34+
permissions:
35+
contents: read
36+
3437
jobs:
3538
build:
3639
name: PHP ${{ matrix.php-versions }} Static Analysis

.github/workflows/test-phpunit.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ concurrency:
3131
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
3232
cancel-in-progress: true
3333

34+
permissions:
35+
contents: read
36+
3437
jobs:
3538
# Any environment variables set in an env context defined at the workflow level
3639
# in the caller workflow are not propagated to the called workflow.

.github/workflows/test-rector.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ concurrency:
3333
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
3434
cancel-in-progress: true
3535

36+
permissions:
37+
contents: read
38+
3639
jobs:
3740
build:
3841
name: PHP ${{ matrix.php-versions }} Analyze code (Rector) on ${{ matrix.paths }}

.github/workflows/test-scss.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ concurrency:
2323
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
2424
cancel-in-progress: true
2525

26+
permissions:
27+
contents: read
28+
2629
jobs:
2730
build:
2831
name: Compilation of SCSS (Dart Sass)

.github/workflows/test-userguide.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ concurrency:
1414
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1515
cancel-in-progress: true
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
syntax_check:
1922
name: Check User Guide syntax

CHANGELOG.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
11
# Changelog
22

3-
## [v4.2.11](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.10) (2022-12-21)
3+
## [v4.2.12](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.12) (2023-01-09)
4+
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.2.11...v4.2.12)
5+
6+
### Fixed Bugs
7+
* docs: fix request.rst by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7014
8+
* fix: `link_tag()` missing `type="application/rss+xml"` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7022
9+
* fix: Request::getIPaddress() causes error on CLI by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7030
10+
* docs: fix upgrade_database.rst by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7036
11+
* fix: `spark migrate:status` shows incorrect filename when format is `Y_m_d_His_` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7038
12+
* fix: Model::save() object when useAutoIncrement is disabled by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/7042
13+
* fix: define of STDOUT in CLI init() method by @jozefrebjak in https://github.com/codeigniter4/CodeIgniter4/pull/7052
14+
* fix: change `getFile()` function of \CodeIgniter\Events\Events to static. by @ping-yee in https://github.com/codeigniter4/CodeIgniter4/pull/7046
15+
* fix: [Email] add fallback to use gethostname() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7053
16+
* Fixing bug with legacy autoRoute when testing by @baycik in https://github.com/codeigniter4/CodeIgniter4/pull/7060
17+
18+
### Refactoring
19+
* refactor: RequestTrait by rector by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7006
20+
* refactor: update sass output by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7026
21+
22+
## [v4.2.11](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.11) (2022-12-21)
423
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.2.10...v4.2.11)
524

25+
### SECURITY
26+
* *Attackers may spoof IP address when using proxy* was fixed. See the [Security advisory](https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-ghw3-5qvm-3mqc) for more information.
27+
* *Potential Session Handlers Vulnerability* was fixed. See the [Security advisory](https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-6cq5-8cj7-g558) for more information.
28+
629
### Fixed Bugs
730
* fix: Request::getIPAddress() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6820
831
* fix: Model cannot insert when $useAutoIncrement is false by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6827
@@ -77,6 +100,9 @@
77100
## [v4.2.7](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.7) (2022-10-06)
78101
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.2.6...v4.2.7)
79102

103+
### SECURITY
104+
* *Secure or HttpOnly flag set in Config\Cookie is not reflected in Cookies issued* was fixed. See the [Security advisory](https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-745p-r637-7vvp) for more information.
105+
80106
### Breaking Changes
81107
* fix: make Time::__toString() database-compatible on any locale by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6461
82108
* fix: set_cookie() does not use Config\Cookie values by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6544

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The MIT License (MIT)
22

33
Copyright (c) 2014-2019 British Columbia Institute of Technology
4-
Copyright (c) 2019-2022 CodeIgniter Foundation
4+
Copyright (c) 2019-2023 CodeIgniter Foundation
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh -e
2+
3+
# Deploys the User Guide to the production
4+
# website. Triggered by updates to the GitHub
5+
# repo's master branch.
6+
7+
REPO=/opt/userguide
8+
SITE=/home/public_html/userguides/userguide4
9+
10+
cd "$REPO"
11+
git switch master
12+
git pull
13+
14+
rm -rf "$SITE"
15+
cp -R "$REPO/docs" "$SITE"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Deploys the User Guide to the production
2+
# website whenever master branch is updated
3+
name: Deploy Production
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: executing remote ssh commands using ssh key
16+
uses: appleboy/ssh-action@master
17+
with:
18+
host: ${{ secrets.HOST }}
19+
username: ${{ secrets.USERNAME }}
20+
key: ${{ secrets.KEY }}
21+
port: ${{ secrets.PORT }}
22+
script: /opt/userguide/.github/scripts/deploy

admin/userguide/.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*/config/development
2+
*/logs/log-*.php
3+
!*/logs/index.html
4+
*/cache/*
5+
!*/cache/index.html
6+
!*/cache/.htaccess
7+
8+
user_guide_src/build/*
9+
user_guide_src/cilexer/build/*
10+
user_guide_src/cilexer/dist/*
11+
user_guide_src/cilexer/pycilexer.egg-info/*
12+
13+
/vendor/

admin/userguide/README.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
# CodeIgniter 4 User Guide
22

3-
## What is CodeIgniter?
4-
5-
CodeIgniter is a PHP full-stack web framework that is light, fast, flexible and secure.
3+
CodeIgniter 4 is a PHP web framework that is light, fast, flexible, and secure.
64
More information can be found at the [official site](http://codeigniter.com).
75

8-
This repository holds a composer-installable pre-built user guide for the framework.
9-
It has been built from the
10-
[development repository](https://github.com/codeigniter4/CodeIgniter4).
11-
12-
More information about the plans for version 4 can be found in [the announcement](http://forum.codeigniter.com/thread-62615.html) on the forums.
13-
14-
## Installation & updates
6+
**This is a read-only repository used to publish the user guide for the current release.**
7+
It is built automatically as part of the framework release workflow, and pull
8+
requests are not accepted here.
159

16-
`composer require codeigniter4/userguide` will install a copy
17-
of the user guide inside your project, at
18-
`vendor/codeigniter4/userguide`. You can then `composer update` whenever
19-
there is a new release of the framework.
10+
Development is done in the [main repository](https://github.com/codeigniter4/codeigniter4).
11+
If you find problems with the user guide, please submit a correcting pull request there.
2012

13+
If you feel that features are missing or unclear, please comment on our
14+
[forum](https://forum.codeigniter.com/index.php),
15+
in the appropriate CodeIgniter4 subforum.

admin/userguide/composer.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

app/Config/Cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class Cache extends BaseConfig
134134
*
135135
* @see https://codeigniter.com/user_guide/libraries/caching.html#memcached
136136
*
137-
* @var array<string, boolean|int|string>
137+
* @var array<string, bool|int|string>
138138
*/
139139
public $memcached = [
140140
'host' => '127.0.0.1',

app/Config/Migrations.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ class Migrations extends BaseConfig
4242
*
4343
* This is the format that will be used when creating new migrations
4444
* using the CLI command:
45-
* > php spark migrate:create
45+
* > php spark make:migration
4646
*
47-
* Typical formats:
47+
* Note: if you set an unsupported format, migration runner will not find
48+
* your migration files.
49+
*
50+
* Supported formats:
4851
* - YmdHis_
4952
* - Y-m-d-His_
5053
* - Y_m_d_His_

app/Controllers/BaseController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ abstract class BaseController extends Controller
3737
*/
3838
protected $helpers = [];
3939

40+
/**
41+
* Be sure to declare properties for any property fetch you initialized.
42+
* The creation of dynamic property is deprecated in PHP 8.2.
43+
*/
44+
// protected $session;
45+
4046
/**
4147
* Constructor.
4248
*/

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"phpunit/phpcov": "^8.2",
2626
"phpunit/phpunit": "^9.1",
2727
"predis/predis": "^1.1 || ^2.0",
28-
"rector/rector": "0.15.1"
28+
"rector/rector": "0.15.2"
2929
},
3030
"suggest": {
3131
"ext-curl": "If you use CURLRequest class",

0 commit comments

Comments
 (0)