Skip to content

Commit 394a6c6

Browse files
authored
Merge pull request #6069 from codeigniter4/develop
4.2.0 Ready code
2 parents 202f41a + b4ed2fc commit 394a6c6

File tree

2,120 files changed

+38896
-16803
lines changed

Some content is hidden

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

2,120 files changed

+38896
-16803
lines changed

.editorconfig

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
; top-most EditorConfig file
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at http://editorconfig.org
3+
24
root = true
35

4-
; Unix-style newlines
56
[*]
6-
end_of_line = lf
7-
8-
[*.php]
9-
indent_style = space
10-
indent_size = 4
117
charset = utf-8
12-
trim_trailing_whitespace = true
8+
indent_size = 4
9+
indent_style = space
10+
end_of_line = lf
1311
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2

.gitattributes

+7
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,24 @@ contributing/ export-ignore
1414
.editorconfig export-ignore
1515
.nojekyll export-ignore export-ignore
1616
CODE_OF_CONDUCT.md export-ignore
17+
CONTRIBUTING.md export-ignore
1718
PULL_REQUEST_TEMPLATE.md export-ignore
1819
stale.yml export-ignore
1920
Vagrantfile.dist export-ignore
2021

2122
# They don't want our test files
23+
tests/AutoReview/ export-ignore
2224
tests/system/ export-ignore
2325
utils/ export-ignore
26+
depfile.yaml export-ignore
2427
rector.php export-ignore
2528
phpunit.xml.dist export-ignore
29+
phpstan-baseline.neon.dist export-ignore
2630
phpstan.neon.dist export-ignore
31+
phpstan-bootstrap.php export-ignore
2732
.php-cs-fixer.dist.php export-ignore
33+
.php-cs-fixer.no-header.php export-ignore
34+
.php-cs-fixer.user-guide.php export-ignore
2835

2936
# The source user guide, either
3037
user_guide_src/ export-ignore

.github/scripts/deploy-userguide

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
## Deploy codeigniter4/userguide
4+
5+
# Setup variables
6+
SOURCE=$1
7+
TARGET=$2
8+
RELEASE=$3
9+
VERSION=`echo "$RELEASE" | cut -c 2-`
10+
11+
echo "Preparing for version $3"
12+
echo "Merging files from $1 to $2"
13+
14+
# Prepare the source
15+
cd $SOURCE
16+
git checkout master
17+
cd user_guide_src
18+
make html
19+
make epub
20+
21+
# Prepare the target
22+
cd $TARGET
23+
git checkout master
24+
rm -rf docs
25+
26+
# Copy files
27+
cp -Rf ${SOURCE}/user_guide_src/build/html ./docs
28+
cp -Rf ${SOURCE}/user_guide_src/build/epub/CodeIgniter.epub ./CodeIgniter${VERSION}.epub
29+
30+
# Ensure underscore prefixed files are published
31+
touch ${TARGET}/docs/.nojekyll
32+
33+
# Commit the changes
34+
git add .
35+
git commit -m "Release ${RELEASE}"
36+
git push

.github/workflows/deploy-apidocs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ jobs:
2424
git config --global user.name "${GITHUB_ACTOR}"
2525
2626
- name: Checkout source
27-
uses: actions/checkout@v2
27+
uses: actions/checkout@v3
2828
with:
2929
path: source
3030

3131
- name: Checkout target
32-
uses: actions/checkout@v2
32+
uses: actions/checkout@v3
3333
with:
3434
repository: codeigniter4/api
3535
token: ${{ secrets.ACCESS_TOKEN }}

.github/workflows/deploy-framework.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
git config --global user.name "${GITHUB_ACTOR}"
1919
2020
- name: Checkout source
21-
uses: actions/checkout@v2
21+
uses: actions/checkout@v3
2222
with:
2323
path: source
2424

2525
- name: Checkout target
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v3
2727
with:
2828
repository: codeigniter4/framework
2929
token: ${{ secrets.ACCESS_TOKEN }}
@@ -36,7 +36,7 @@ jobs:
3636
run: ./source/.github/scripts/deploy-framework ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/framework ${GITHUB_REF##*/}
3737

3838
- name: Release
39-
uses: actions/github-script@v5
39+
uses: actions/github-script@v6
4040
with:
4141
github-token: ${{secrets.ACCESS_TOKEN}}
4242
script: |
@@ -63,12 +63,12 @@ jobs:
6363
git config --global user.name "${GITHUB_ACTOR}"
6464
6565
- name: Checkout source
66-
uses: actions/checkout@v2
66+
uses: actions/checkout@v3
6767
with:
6868
path: source
6969

7070
- name: Checkout target
71-
uses: actions/checkout@v2
71+
uses: actions/checkout@v3
7272
with:
7373
repository: codeigniter4/appstarter
7474
token: ${{ secrets.ACCESS_TOKEN }}
@@ -81,7 +81,7 @@ jobs:
8181
run: ./source/.github/scripts/deploy-appstarter ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/appstarter ${GITHUB_REF##*/}
8282

8383
- name: Release
84-
uses: actions/github-script@v5
84+
uses: actions/github-script@v6
8585
with:
8686
github-token: ${{secrets.ACCESS_TOKEN}}
8787
script: |

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

+15-2
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,30 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: '8.0'
28+
coverage: none
2329

2430
# Build the latest User Guide
2531
- name: Build with Sphinx
2632
uses: ammaraskar/[email protected]
2733
with:
2834
docs-folder: user_guide_src/
2935

36+
- name: Add "Edit this page" links
37+
run: |
38+
cd user_guide_src
39+
# Fix permissions
40+
sudo chown -R runner:docker build/html/
41+
php add-edit-this-page build/html/
42+
3043
# Create an artifact of the html output
3144
- name: Upload artifact
32-
uses: actions/upload-artifact@v2
45+
uses: actions/upload-artifact@v3
3346
with:
3447
name: HTML Documentation
3548
path: user_guide_src/build/html/
+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# When a new Release is created, deploy relevant
2+
# files to each of the generated repos.
3+
name: Deploy User Guide
4+
5+
on:
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
framework:
11+
name: Deploy to userguide
12+
if: (github.repository == 'codeigniter4/CodeIgniter4')
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Identify
16+
run: |
17+
git config --global user.email "[email protected]"
18+
git config --global user.name "${GITHUB_ACTOR}"
19+
20+
- name: Checkout source
21+
uses: actions/checkout@v3
22+
with:
23+
path: source
24+
25+
- name: Checkout target
26+
uses: actions/checkout@v3
27+
with:
28+
repository: codeigniter4/userguide
29+
token: ${{ secrets.ACCESS_TOKEN }}
30+
path: userguide
31+
32+
- name: Install Sphinx
33+
run: |
34+
sudo apt install python3-sphinx
35+
sudo pip3 install sphinxcontrib-phpdomain
36+
sudo pip3 install sphinx_rtd_theme
37+
38+
- name: Chmod
39+
run: chmod +x ./source/.github/scripts/deploy-userguide
40+
41+
- name: Deploy
42+
run: ./source/.github/scripts/deploy-userguide ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/userguide ${GITHUB_REF##*/}
43+
44+
- name: Release
45+
uses: actions/github-script@v6
46+
with:
47+
github-token: ${{secrets.ACCESS_TOKEN}}
48+
script: |
49+
const release = await github.rest.repos.getLatestRelease({
50+
owner: context.repo.owner,
51+
repo: context.repo.repo
52+
})
53+
github.rest.repos.createRelease({
54+
owner: context.repo.owner,
55+
repo: 'userguide',
56+
tag_name: release.data.tag_name,
57+
name: release.data.name,
58+
body: release.data.body
59+
})

.github/workflows/test-autoreview.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Automatic Code Review
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- composer.json
7+
- spark
8+
- '**.php'
9+
- .github/workflows/test-autoreview.yml
10+
push:
11+
paths:
12+
- composer.json
13+
- spark
14+
- '**.php'
15+
- .github/workflows/test-autoreview.yml
16+
17+
jobs:
18+
auto-review-tests:
19+
name: Automatic Code Review
20+
runs-on: ubuntu-20.04
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v3
25+
26+
- name: Setup PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: '8.0'
30+
coverage: none
31+
32+
- name: Get composer cache directory
33+
id: composercache
34+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
35+
36+
- name: Cache dependencies
37+
uses: actions/cache@v3
38+
with:
39+
path: ${{ steps.composercache.outputs.dir }}
40+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
41+
restore-keys: ${{ runner.os }}-composer-
42+
43+
- name: Install dependencies
44+
run: composer update --ansi
45+
env:
46+
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
47+
48+
- name: Run AutoReview Tests
49+
run: vendor/bin/phpunit --color=always --group=auto-review --no-coverage

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

+6-4
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
php-version:
24-
- '7.3'
2524
- '7.4'
2625
- '8.0'
2726

2827
steps:
2928
- name: Checkout
30-
uses: actions/checkout@v2
29+
uses: actions/checkout@v3
3130

3231
- name: Setup PHP
3332
uses: shivammathur/setup-php@v2
@@ -41,7 +40,7 @@ jobs:
4140
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
4241

4342
- name: Cache dependencies
44-
uses: actions/cache@v2
43+
uses: actions/cache@v3
4544
with:
4645
path: ${{ steps.composer-cache.outputs.dir }}
4746
key: ${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
@@ -53,7 +52,10 @@ jobs:
5352
run: composer update --ansi --no-interaction
5453

5554
- name: Run lint on `app/`, `admin/`, `public/`
56-
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.no-header.php-cs-fixer.dist.php --using-cache=no --diff
55+
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.no-header.php --using-cache=no --diff
5756

5857
- name: Run lint on `system/`, `tests`, `utils/`, and root PHP files
5958
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff
59+
60+
- name: Run lint on `user_guide_src/source/`
61+
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.user-guide.php --using-cache=no --diff

.github/workflows/test-deptrac.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ on:
66
pull_request:
77
branches:
88
- 'develop'
9-
- '4.*'
9+
- 'v4.*'
1010
paths:
11-
- 'app/**'
12-
- 'system/**'
11+
- 'app/**.php'
12+
- 'system/**.php'
1313
- 'composer.json'
1414
- 'depfile.yaml'
1515
- '.github/workflows/test-deptrac.yml'
1616
push:
1717
branches:
1818
- 'develop'
19-
- '4.*'
19+
- 'v4.*'
2020
paths:
21-
- 'app/**'
22-
- 'system/**'
21+
- 'app/**.php'
22+
- 'system/**.php'
2323
- 'composer.json'
2424
- 'depfile.yaml'
2525
- '.github/workflows/test-deptrac.yml'
@@ -30,7 +30,7 @@ jobs:
3030
runs-on: ubuntu-20.04
3131
steps:
3232
- name: Checkout
33-
uses: actions/checkout@v2
33+
uses: actions/checkout@v3
3434

3535
- name: Setup PHP
3636
uses: shivammathur/setup-php@v2
@@ -50,7 +50,7 @@ jobs:
5050
run: mkdir -p ${{ steps.composer-cache.outputs.dir }}
5151

5252
- name: Cache composer dependencies
53-
uses: actions/cache@v2
53+
uses: actions/cache@v3
5454
with:
5555
path: ${{ steps.composer-cache.outputs.dir }}
5656
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
@@ -60,7 +60,7 @@ jobs:
6060
run: mkdir -p build/
6161

6262
- name: Cache Deptrac results
63-
uses: actions/cache@v2
63+
uses: actions/cache@v3
6464
with:
6565
path: build
6666
key: ${{ runner.os }}-deptrac-${{ github.sha }}

0 commit comments

Comments
 (0)