Skip to content

Commit

Permalink
Merge pull request #7065 from codeigniter4/develop
Browse files Browse the repository at this point in the history
4.2.12 Ready code
  • Loading branch information
kenjis authored Jan 9, 2023
2 parents f04c67d + 96af785 commit 558db23
Show file tree
Hide file tree
Showing 92 changed files with 702 additions and 256 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ body:
description: Which PHP versions did you run your code?
multiple: true
options:
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
validations:
required: true

Expand Down
6 changes: 6 additions & 0 deletions .github/scripts/deploy-userguide
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ cd $TARGET
git checkout master
rm -rf docs

# Copy common files
cp -Rf ${SOURCE}/LICENSE ./

# Copy repo-specific files
cp -Rf ${SOURCE}/admin/userguide/. ./

# Copy files
cp -Rf ${SOURCE}/user_guide_src/build/html ./docs
cp -Rf ${SOURCE}/user_guide_src/build/epub/CodeIgniter.epub ./CodeIgniter${VERSION}.epub
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/deploy-apidocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ on:
- 'system/**'
- '.github/workflows/deploy-apidocs.yml'

permissions:
contents: read

jobs:
build:
name: Deploy to api
permissions:
contents: write
if: github.repository == 'codeigniter4/CodeIgniter4'
runs-on: ubuntu-22.04

Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/deploy-distributables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
release:
types: [published]

permissions:
contents: read

jobs:
check-version:
name: Check for updated version
Expand All @@ -31,6 +34,9 @@ jobs:
framework:
name: Deploy to framework
permissions:
# Allow actions/github-script to create release
contents: write
if: github.repository == 'codeigniter4/CodeIgniter4'
runs-on: ubuntu-22.04
needs: check-version
Expand Down Expand Up @@ -78,6 +84,9 @@ jobs:
appstarter:
name: Deploy to appstarter
permissions:
# Allow actions/github-script to create release
contents: write
if: github.repository == 'codeigniter4/CodeIgniter4'
runs-on: ubuntu-22.04
needs: check-version
Expand Down Expand Up @@ -125,6 +134,9 @@ jobs:
userguide:
name: Deploy to userguide
permissions:
# Allow actions/github-script to create release
contents: write
if: github.repository == 'codeigniter4/CodeIgniter4'
runs-on: ubuntu-22.04
needs: check-version
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/deploy-userguide-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ on:
paths:
- 'user_guide_src/**'

permissions:
contents: read

jobs:
build:
name: Deploy to gh-pages
permissions:
# Allow ad-m/github-push-action to push commit to branch gh-pages
contents: write
if: (github.repository == 'codeigniter4/CodeIgniter4')
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-autoreview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
auto-review-tests:
uses: ./.github/workflows/reusable-serviceless-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
lint:
name: PHP ${{ matrix.php-version }} Lint with PHP CS Fixer
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test-deptrac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
name: Architectural Inspection
Expand Down Expand Up @@ -73,3 +76,5 @@ jobs:
run: |
sudo phive --no-progress install --global qossmic/deptrac --trust-gpg-keys B8F640134AB1782E
deptrac analyze --cache-file=build/deptrac.cache
env:
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/test-phpcpd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
name: Duplicate Code Detection
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
name: PHP ${{ matrix.php-versions }} Static Analysis
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
# Any environment variables set in an env context defined at the workflow level
# in the caller workflow are not propagated to the called workflow.
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
name: PHP ${{ matrix.php-versions }} Analyze code (Rector) on ${{ matrix.paths }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-scss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
name: Compilation of SCSS (Dart Sass)
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-userguide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
syntax_check:
name: Check User Guide syntax
Expand Down
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,31 @@
# Changelog

## [v4.2.11](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.10) (2022-12-21)
## [v4.2.12](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.12) (2023-01-09)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.2.11...v4.2.12)

### Fixed Bugs
* docs: fix request.rst by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7014
* fix: `link_tag()` missing `type="application/rss+xml"` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7022
* fix: Request::getIPaddress() causes error on CLI by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7030
* docs: fix upgrade_database.rst by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7036
* fix: `spark migrate:status` shows incorrect filename when format is `Y_m_d_His_` by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7038
* fix: Model::save() object when useAutoIncrement is disabled by @michalsn in https://github.com/codeigniter4/CodeIgniter4/pull/7042
* fix: define of STDOUT in CLI init() method by @jozefrebjak in https://github.com/codeigniter4/CodeIgniter4/pull/7052
* fix: change `getFile()` function of \CodeIgniter\Events\Events to static. by @ping-yee in https://github.com/codeigniter4/CodeIgniter4/pull/7046
* fix: [Email] add fallback to use gethostname() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7053
* Fixing bug with legacy autoRoute when testing by @baycik in https://github.com/codeigniter4/CodeIgniter4/pull/7060

### Refactoring
* refactor: RequestTrait by rector by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7006
* refactor: update sass output by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/7026

## [v4.2.11](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.11) (2022-12-21)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.2.10...v4.2.11)

### SECURITY
* *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.
* *Potential Session Handlers Vulnerability* was fixed. See the [Security advisory](https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-6cq5-8cj7-g558) for more information.

### Fixed Bugs
* fix: Request::getIPAddress() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6820
* fix: Model cannot insert when $useAutoIncrement is false by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6827
Expand Down Expand Up @@ -77,6 +100,9 @@
## [v4.2.7](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.7) (2022-10-06)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.2.6...v4.2.7)

### SECURITY
* *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.

### Breaking Changes
* fix: make Time::__toString() database-compatible on any locale by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6461
* fix: set_cookie() does not use Config\Cookie values by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6544
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The MIT License (MIT)

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

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
15 changes: 15 additions & 0 deletions admin/userguide/.github/scripts/deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh -e

# Deploys the User Guide to the production
# website. Triggered by updates to the GitHub
# repo's master branch.

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

cd "$REPO"
git switch master
git pull

rm -rf "$SITE"
cp -R "$REPO/docs" "$SITE"
22 changes: 22 additions & 0 deletions admin/userguide/.github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Deploys the User Guide to the production
# website whenever master branch is updated
name: Deploy Production

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: executing remote ssh commands using ssh key
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: /opt/userguide/.github/scripts/deploy
13 changes: 13 additions & 0 deletions admin/userguide/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
*/config/development
*/logs/log-*.php
!*/logs/index.html
*/cache/*
!*/cache/index.html
!*/cache/.htaccess

user_guide_src/build/*
user_guide_src/cilexer/build/*
user_guide_src/cilexer/dist/*
user_guide_src/cilexer/pycilexer.egg-info/*

/vendor/
23 changes: 9 additions & 14 deletions admin/userguide/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
# CodeIgniter 4 User Guide

## What is CodeIgniter?

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

This repository holds a composer-installable pre-built user guide for the framework.
It has been built from the
[development repository](https://github.com/codeigniter4/CodeIgniter4).

More information about the plans for version 4 can be found in [the announcement](http://forum.codeigniter.com/thread-62615.html) on the forums.

## Installation & updates
**This is a read-only repository used to publish the user guide for the current release.**
It is built automatically as part of the framework release workflow, and pull
requests are not accepted here.

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

If you feel that features are missing or unclear, please comment on our
[forum](https://forum.codeigniter.com/index.php),
in the appropriate CodeIgniter4 subforum.
16 changes: 0 additions & 16 deletions admin/userguide/composer.json

This file was deleted.

2 changes: 1 addition & 1 deletion app/Config/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class Cache extends BaseConfig
*
* @see https://codeigniter.com/user_guide/libraries/caching.html#memcached
*
* @var array<string, boolean|int|string>
* @var array<string, bool|int|string>
*/
public $memcached = [
'host' => '127.0.0.1',
Expand Down
7 changes: 5 additions & 2 deletions app/Config/Migrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ class Migrations extends BaseConfig
*
* This is the format that will be used when creating new migrations
* using the CLI command:
* > php spark migrate:create
* > php spark make:migration
*
* Typical formats:
* Note: if you set an unsupported format, migration runner will not find
* your migration files.
*
* Supported formats:
* - YmdHis_
* - Y-m-d-His_
* - Y_m_d_His_
Expand Down
6 changes: 6 additions & 0 deletions app/Controllers/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ abstract class BaseController extends Controller
*/
protected $helpers = [];

/**
* Be sure to declare properties for any property fetch you initialized.
* The creation of dynamic property is deprecated in PHP 8.2.
*/
// protected $session;

/**
* Constructor.
*/
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"phpunit/phpcov": "^8.2",
"phpunit/phpunit": "^9.1",
"predis/predis": "^1.1 || ^2.0",
"rector/rector": "0.15.1"
"rector/rector": "0.15.2"
},
"suggest": {
"ext-curl": "If you use CURLRequest class",
Expand Down
Loading

0 comments on commit 558db23

Please sign in to comment.