Skip to content

Commit 1ddafc4

Browse files
committed
Release v4.7.1
1 parent e0a848d commit 1ddafc4

7 files changed

Lines changed: 71 additions & 40 deletions

File tree

.github/workflows/close-pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ permissions:
99

1010
jobs:
1111
main:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-24.04
1313
steps:
1414
- name: Close PR with nice message
1515
run: gh pr close ${{ env.ISSUE }} -c "${{ env.COMMENT }}"

.github/workflows/phpunit.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,28 @@ on:
55
branches:
66
- develop
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
main:
1013
name: Build and test
1114

1215
strategy:
1316
matrix:
14-
php-versions: ['8.2', '8.4']
15-
16-
runs-on: ubuntu-latest
17+
php-versions: ['8.2', '8.5']
1718

18-
if: (! contains(github.event.head_commit.message, '[ci skip]'))
19+
runs-on: ubuntu-24.04
20+
if: (! contains(github.event.pull_request.title, '[ci skip]'))
1921

2022
steps:
2123
- name: Checkout
22-
uses: actions/checkout@v2
24+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25+
with:
26+
persist-credentials: false
2327

2428
- name: Setup PHP, with composer and extensions
25-
uses: shivammathur/setup-php@v2
29+
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
2630
with:
2731
php-version: ${{ matrix.php-versions }}
2832
tools: composer, pecl, phpunit
@@ -31,17 +35,17 @@ jobs:
3135

3236
- name: Get composer cache directory
3337
id: composer-cache
34-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
38+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
3539

3640
- name: Cache composer dependencies
37-
uses: actions/cache@v2
41+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
3842
with:
39-
path: ${{ steps.composer-cache.outputs.dir }}
43+
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_DIR }}
4044
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
4145
restore-keys: ${{ runner.os }}-composer-
4246

4347
- name: Install dependencies
44-
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
48+
run: composer install --no-progress --no-interaction
4549
# To prevent rate limiting you may need to supply an OAuth token in Settings > Secrets
4650
# env:
4751
# https://getcomposer.org/doc/articles/troubleshooting.md#api-rate-limit-and-oauth-tokens

.gitignore

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,38 +48,38 @@ Vagrantfile
4848
#-------------------------
4949
# Temporary Files
5050
#-------------------------
51-
writable/cache/*
52-
!writable/cache/index.html
51+
/writable/cache/*
52+
!/writable/cache/index.html
5353

54-
writable/logs/*
55-
!writable/logs/index.html
54+
/writable/logs/*
55+
!/writable/logs/index.html
5656

57-
writable/session/*
58-
!writable/session/index.html
57+
/writable/session/*
58+
!/writable/session/index.html
5959

60-
writable/uploads/*
61-
!writable/uploads/index.html
60+
/writable/uploads/*
61+
!/writable/uploads/index.html
6262

63-
writable/debugbar/*
64-
!writable/debugbar/index.html
63+
/writable/debugbar/*
64+
!/writable/debugbar/index.html
6565

6666
php_errors.log
6767

6868
#-------------------------
6969
# User Guide Temp Files
7070
#-------------------------
71-
user_guide_src/build/*
72-
user_guide_src/cilexer/build/*
73-
user_guide_src/cilexer/dist/*
74-
user_guide_src/cilexer/pycilexer.egg-info/*
71+
/user_guide_src/build/*
72+
/user_guide_src/cilexer/build/*
73+
/user_guide_src/cilexer/dist/*
74+
/user_guide_src/cilexer/pycilexer.egg-info/*
7575

7676
#-------------------------
7777
# Test Files
7878
#-------------------------
79-
tests/coverage*
79+
/tests/coverage*
8080

8181
# Don't save phpunit under version control.
82-
phpunit
82+
/phpunit
8383

8484
#-------------------------
8585
# Composer

app/Config/Database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class Database extends Config
177177
'swapPre' => '',
178178
'encrypt' => false,
179179
'compress' => false,
180-
'strictOn' => false,
180+
'strictOn' => true,
181181
'failover' => [],
182182
'port' => 3306,
183183
'foreignKeys' => true,

app/Config/Paths.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,16 @@ class Paths
7575
* is used when no value is provided to `Services::renderer()`.
7676
*/
7777
public string $viewDirectory = __DIR__ . '/../Views';
78+
79+
/**
80+
* ---------------------------------------------------------------
81+
* ENVIRONMENT DIRECTORY NAME
82+
* ---------------------------------------------------------------
83+
*
84+
* This variable must contain the name of the directory where
85+
* the .env file is located.
86+
* Please consider security implications when changing this
87+
* value - the directory should not be publicly accessible.
88+
*/
89+
public string $envDirectory = __DIR__ . '/../../';
7890
}

app/Config/WorkerMode.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ class WorkerMode
4040
'cache',
4141
];
4242

43+
/**
44+
* Reset Event Listeners
45+
*
46+
* List of event names whose listeners should be removed between requests.
47+
* Use this if you register event listeners inside other event callbacks
48+
* (rather than at the top level of Config/Events.php), which would cause
49+
* them to accumulate across requests in worker mode.
50+
*
51+
* @var list<string>
52+
*/
53+
public array $resetEventListeners = [];
54+
4355
/**
4456
* Force Garbage Collection
4557
*

builds

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env php
22
<?php
33

4-
define('LATEST_RELEASE', '^4.0');
4+
define('LATEST_RELEASE', '^4.7');
5+
define('DEVELOP_BRANCH', 'dev-develop');
6+
define('NEXT_MINOR', '^4.8-dev');
57
define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');
68

79
/*
@@ -11,18 +13,18 @@ define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');
1113
* Use this script to toggle the CodeIgniter dependency between the
1214
* latest stable release and the most recent development update.
1315
*
14-
* Usage: php builds [release|development]
16+
* Usage: php builds [release|development|next]
1517
*/
1618

19+
$branch = $argv[1] ?? '';
20+
1721
// Determine the requested stability
18-
if (empty($argv[1]) || ! in_array($argv[1], ['release', 'development'], true)) {
19-
echo 'Usage: php builds [release|development]' . PHP_EOL;
22+
if ($branch === '' || ! in_array($branch, ['release', 'development', 'next'], true)) {
23+
echo 'Usage: php builds [release|development|next]' . PHP_EOL;
2024

2125
exit;
2226
}
2327

24-
$dev = $argv[1] === 'development';
25-
2628
$modified = [];
2729

2830
// Locate each file and update it for the requested stability
@@ -36,7 +38,7 @@ if (is_file($file)) {
3638
$array = json_decode($contents, true);
3739

3840
if (is_array($array)) {
39-
if ($dev) {
41+
if ($branch !== 'release') {
4042
$array['minimum-stability'] = 'dev';
4143
$array['prefer-stable'] = true;
4244
$array['repositories'] ??= [];
@@ -57,7 +59,7 @@ if (is_file($file)) {
5759
];
5860
}
5961

60-
$array['require']['codeigniter4/codeigniter4'] = 'dev-develop';
62+
$array['require']['codeigniter4/codeigniter4'] = $branch === 'next' ? NEXT_MINOR : DEVELOP_BRANCH;
6163
unset($array['require']['codeigniter4/framework']);
6264
} else {
6365
unset($array['minimum-stability']);
@@ -70,7 +72,7 @@ if (is_file($file)) {
7072
}
7173
}
7274

73-
if (empty($array['repositories'])) {
75+
if ($array['repositories'] === []) {
7476
unset($array['repositories']);
7577
}
7678
}
@@ -100,7 +102,7 @@ foreach ($files as $file) {
100102
if (is_file($file)) {
101103
$contents = file_get_contents($file);
102104

103-
if ($dev) {
105+
if ($branch !== 'release') {
104106
$contents = str_replace('vendor/codeigniter4/framework', 'vendor/codeigniter4/codeigniter4', $contents);
105107
} else {
106108
$contents = str_replace('vendor/codeigniter4/codeigniter4', 'vendor/codeigniter4/framework', $contents);
@@ -120,6 +122,7 @@ if ($modified === []) {
120122
foreach ($modified as $file) {
121123
echo " * {$file}" . PHP_EOL;
122124
}
123-
124-
echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL;
125125
}
126+
127+
echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL;
128+
echo 'Don\'t forget to update the project files in app folder from "vendor/codeigniter4/*/app/".' . PHP_EOL;

0 commit comments

Comments
 (0)