Skip to content

Commit

Permalink
Merge pull request #5058 from codeigniter4/release-4.1.4
Browse files Browse the repository at this point in the history
4.1.4 Ready code
  • Loading branch information
MGatner authored Sep 7, 2021
2 parents 795e9c4 + 26b7a90 commit d686c86
Show file tree
Hide file tree
Showing 828 changed files with 125,750 additions and 138,262 deletions.
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ root = true
end_of_line = lf

[*.php]
indent_style = tab
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ utils/ export-ignore
rector.php export-ignore
phpunit.xml.dist export-ignore
phpstan.neon.dist export-ignore
.php-cs-fixer.dist.php export-ignore

# The source user guide, either
user_guide_src/ export-ignore
Expand Down
25 changes: 15 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
version: 2

updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: 'composer'
directory: '/'
schedule:
interval: 'daily'
open-pull-requests-limit: 10

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
ignore:
- dependency-name: '*'
update-types:
- 'version-update:semver-minor'
- 'version-update:semver-patch'
46 changes: 22 additions & 24 deletions .github/workflows/deploy-apidocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# When changes are pushed to the develop branch,
# build the current version of the API documentation
# with phpDocumentor and deploy it to the api branch.
# with phpDocumentor and deploy it to codeigniter4/api.
name: Deploy API Documentation

on:
Expand All @@ -9,13 +9,14 @@ on:
- 'develop'
paths:
- 'system/**'
- '.github/workflows/deploy-apidocs.yml'

jobs:

build:
name: Deploy to api
if: (github.repository == 'codeigniter4/CodeIgniter4')
runs-on: ubuntu-latest
if: github.repository == 'codeigniter4/CodeIgniter4'
runs-on: ubuntu-20.04

steps:
- name: Setup credentials
run: |
Expand All @@ -37,37 +38,34 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: intl
php-version: '8.0'
coverage: none

- name: Install GraphViz for phpDocumentor
run: |
sudo apt install -yq graphviz
- name: Download phpDocumentor
- name: Download phpDocumentor v3.1
run: |
cd ./source
curl \
-L https://github.com/phpDocumentor/phpDocumentor/releases/download/v2.9.1/phpDocumentor.phar \
-L https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.1.0/phpDocumentor.phar \
-o admin/phpDocumentor.phar
- name: Prepare
- name: Prepare API repo
working-directory: api
run: |
cd ./api
rm -rf ./api/docs*
mkdir -p ./api/docs
git reset --hard master
rm -rfv docs
mkdir --parents --verbose docs
- name: Build
- name: Build API in source repo
working-directory: source
run: |
cd ./source
chmod +x admin/phpDocumentor.phar
admin/phpDocumentor.phar
php admin/phpDocumentor.phar run --ansi --verbose
cp -R ${GITHUB_WORKSPACE}/source/api/build/* ${GITHUB_WORKSPACE}/api/docs
- name: Deploy
- name: Deploy to API repo
working-directory: api
run: |
cd ./api
git add .
git commit -m "API sync for ${GITHUB_SHA}"
git push
if ! git diff-index --quiet HEAD; then
git commit -m "Updated API for commit ${GITHUB_SHA}"
git push origin master
fi
8 changes: 4 additions & 4 deletions .github/workflows/deploy-framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
framework:
name: Deploy to framework
if: (github.repository == 'codeigniter4/CodeIgniter4')
if: github.repository == 'codeigniter4/CodeIgniter4'
runs-on: ubuntu-latest
steps:
- name: Identify
Expand All @@ -36,7 +36,7 @@ jobs:
run: ./source/.github/scripts/deploy-framework ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/framework ${GITHUB_REF##*/}

- name: Release
uses: actions/github-script@v4.0.2
uses: actions/github-script@v4
with:
github-token: ${{secrets.ACCESS_TOKEN}}
script: |
Expand All @@ -54,7 +54,7 @@ jobs:
appstarter:
name: Deploy to appstarter
if: (github.repository == 'codeigniter4/CodeIgniter4')
if: github.repository == 'codeigniter4/CodeIgniter4'
runs-on: ubuntu-latest
steps:
- name: Identify
Expand All @@ -81,7 +81,7 @@ jobs:
run: ./source/.github/scripts/deploy-appstarter ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/appstarter ${GITHUB_REF##*/}

- name: Release
uses: actions/github-script@v4.0.2
uses: actions/github-script@v4
with:
github-token: ${{secrets.ACCESS_TOKEN}}
script: |
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/test-coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Coding Standards

on:
push:
paths:
- '**.php'
- 'spark'
- '.github/workflows/test-coding-standards.yml'
pull_request:
paths:
- '**.php'
- 'spark'
- '.github/workflows/test-coding-standards.yml'

jobs:
lint:
name: PHP ${{ matrix.php-version }} Lint with PHP CS Fixer
runs-on: ubuntu-20.04

strategy:
fail-fast: false
matrix:
php-version:
- '7.3'
- '7.4'
- '8.0'

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: tokenizer
coverage: none

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php-version }}-
${{ runner.os }}-
- name: Install dependencies
run: composer update --ansi --no-interaction

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

- name: Run lint on `system/`, `tests`, `utils/`, and root PHP files
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff
43 changes: 43 additions & 0 deletions .github/workflows/test-phpcpd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# When a PR is opened or a push is made, check code
# for duplication with PHP Copy/Paste Detector.
name: PHPCPD

on:
pull_request:
branches:
- 'develop'
- '4.*'
paths:
- 'app/**'
- 'public/**'
- 'system/**'
- '.github/workflows/test-phpcpd.yml'
push:
branches:
- 'develop'
- '4.*'
paths:
- 'app/**'
- 'public/**'
- 'system/**'
- '.github/workflows/test-phpcpd.yml'

jobs:
build:
name: Duplicate Code Detection
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
tools: phive
extensions: intl, json, mbstring, xml

- name: Detect code duplication
run: |
sudo phive --no-progress install --global --trust-gpg-keys 4AA394086372C20A phpcpd
phpcpd --exclude system/Test --exclude system/ThirdParty --exclude system/Database/SQLSRV/Builder.php app/ public/ system/
4 changes: 2 additions & 2 deletions .github/workflows/test-phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
run: mkdir -p ${{ steps.composer-cache.outputs.dir }}

- name: Cache composer dependencies
uses: actions/cache@v2.1.5
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand All @@ -64,7 +64,7 @@ jobs:
run: mkdir -p build/phpstan

- name: Cache PHPStan result cache directory
uses: actions/cache@v2.1.5
uses: actions/cache@v2
with:
path: build/phpstan
key: ${{ runner.os }}-phpstan-${{ github.sha }}
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/test-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:
db-platforms: ['MySQLi', 'Postgre', 'SQLite3', 'SQLSRV']
mysql-versions: ['5.7']
include:
- php-versions: 7.4
- php-versions: '7.4'
db-platforms: MySQLi
mysql-versions: 8.0
mysql-versions: '8.0'

services:
mysql:
Expand Down Expand Up @@ -107,13 +107,14 @@ jobs:
run: |
sudo apt-get install --reinstall libgs9-common fonts-noto-mono libgs9:amd64 libijs-0.35:amd64 fonts-urw-base35 ghostscript poppler-data libjbig2dec0:amd64 gsfonts libopenjp2-7:amd64 fonts-droid-fallback ttf-dejavu-core
sudo apt-get install -y imagemagick
sudo apt-get install --fix-broken
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2.1.5
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand All @@ -122,7 +123,7 @@ jobs:
- name: Install dependencies
run: |
composer update --ansi --no-interaction
composer remove --ansi --dev --unused -W rector/rector phpstan/phpstan codeigniter4/codeigniter4-standard squizlabs/php_codesniffer
composer remove --ansi --dev --unused -W rector/rector phpstan/phpstan friendsofphp/php-cs-fixer nexusphp/cs-config codeigniter/coding-standard
php -r 'file_put_contents("vendor/laminas/laminas-zendframework-bridge/src/autoload.php", "");'
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
Expand All @@ -140,7 +141,7 @@ jobs:
- if: github.repository_owner == 'codeigniter4' && matrix.php-versions == '7.4'
name: Run Coveralls
run: |
composer global require php-coveralls/php-coveralls:^2.4
composer global require --ansi php-coveralls/php-coveralls:^2.4
php-coveralls --coverage_clover=build/logs/clover.xml -v
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: mkdir -p ${{ steps.composer-cache.outputs.dir }}

- name: Cache composer dependencies
uses: actions/cache@v2.1.5
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,5 @@ nb-configuration.xml
/results/
/phpunit*.xml
/.phpunit.*.cache

/.php-cs-fixer.php
42 changes: 42 additions & 0 deletions .no-header.php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

declare(strict_types=1);

/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

use CodeIgniter\CodingStandard\CodeIgniter4;
use Nexus\CsConfig\Factory;
use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer;
use Nexus\CsConfig\Fixer\Comment\SpaceAfterCommentStartFixer;
use Nexus\CsConfig\FixerGenerator;
use PhpCsFixer\Finder;

$finder = Finder::create()
->files()
->in([
__DIR__ . '/admin',
__DIR__ . '/app',
__DIR__ . '/public',
])
->notName('#Logger\.php$#');

$overrides = [];

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

return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
Loading

0 comments on commit d686c86

Please sign in to comment.