Skip to content

Commit e0a848d

Browse files
committed
Release v4.7.0
1 parent 793a21b commit e0a848d

21 files changed

+314
-19
lines changed

.github/workflows/phpunit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
strategy:
1313
matrix:
14-
php-versions: ['8.1', '8.3']
14+
php-versions: ['8.2', '8.4']
1515

1616
runs-on: ubuntu-latest
1717

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,17 @@ Problems with it can be raised on our forum, or as issues in the main repository
5050

5151
## Server Requirements
5252

53-
PHP version 8.1 or higher is required, with the following extensions installed:
53+
PHP version 8.2 or higher is required, with the following extensions installed:
5454

5555
- [intl](http://php.net/manual/en/intl.requirements.php)
5656
- [mbstring](http://php.net/manual/en/mbstring.installation.php)
5757

5858
> [!WARNING]
5959
> - The end of life date for PHP 7.4 was November 28, 2022.
6060
> - The end of life date for PHP 8.0 was November 26, 2023.
61-
> - If you are still using PHP 7.4 or 8.0, you should upgrade immediately.
62-
> - The end of life date for PHP 8.1 will be December 31, 2025.
61+
> - The end of life date for PHP 8.1 was December 31, 2025.
62+
> - If you are still using below PHP 8.2, you should upgrade immediately.
63+
> - The end of life date for PHP 8.2 will be December 31, 2026.
6364
6465
Additionally, make sure that the following extensions are enabled in your PHP:
6566

app/Config/CURLRequest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@
66

77
class CURLRequest extends BaseConfig
88
{
9+
/**
10+
* --------------------------------------------------------------------------
11+
* CURLRequest Share Connection Options
12+
* --------------------------------------------------------------------------
13+
*
14+
* Share connection options between requests.
15+
*
16+
* @var list<int>
17+
*
18+
* @see https://www.php.net/manual/en/curl.constants.php#constant.curl-lock-data-connect
19+
*/
20+
public array $shareConnectionOptions = [
21+
CURL_LOCK_DATA_CONNECT,
22+
CURL_LOCK_DATA_DNS,
23+
];
24+
925
/**
1026
* --------------------------------------------------------------------------
1127
* CURLRequest Share Options

app/Config/Cache.php

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Config;
44

55
use CodeIgniter\Cache\CacheInterface;
6+
use CodeIgniter\Cache\Handlers\ApcuHandler;
67
use CodeIgniter\Cache\Handlers\DummyHandler;
78
use CodeIgniter\Cache\Handlers\FileHandler;
89
use CodeIgniter\Cache\Handlers\MemcachedHandler;
@@ -112,14 +113,24 @@ class Cache extends BaseConfig
112113
* Your Redis server can be specified below, if you are using
113114
* the Redis or Predis drivers.
114115
*
115-
* @var array{host?: string, password?: string|null, port?: int, timeout?: int, database?: int}
116+
* @var array{
117+
* host?: string,
118+
* password?: string|null,
119+
* port?: int,
120+
* timeout?: int,
121+
* async?: bool,
122+
* persistent?: bool,
123+
* database?: int
124+
* }
116125
*/
117126
public array $redis = [
118-
'host' => '127.0.0.1',
119-
'password' => null,
120-
'port' => 6379,
121-
'timeout' => 0,
122-
'database' => 0,
127+
'host' => '127.0.0.1',
128+
'password' => null,
129+
'port' => 6379,
130+
'timeout' => 0,
131+
'async' => false, // specific to Predis and ignored by the native Redis extension
132+
'persistent' => false,
133+
'database' => 0,
123134
];
124135

125136
/**
@@ -133,6 +144,7 @@ class Cache extends BaseConfig
133144
* @var array<string, class-string<CacheInterface>>
134145
*/
135146
public array $validHandlers = [
147+
'apcu' => ApcuHandler::class,
136148
'dummy' => DummyHandler::class,
137149
'file' => FileHandler::class,
138150
'memcached' => MemcachedHandler::class,
@@ -159,4 +171,28 @@ class Cache extends BaseConfig
159171
* @var bool|list<string>
160172
*/
161173
public $cacheQueryString = false;
174+
175+
/**
176+
* --------------------------------------------------------------------------
177+
* Web Page Caching: Cache Status Codes
178+
* --------------------------------------------------------------------------
179+
*
180+
* HTTP status codes that are allowed to be cached. Only responses with
181+
* these status codes will be cached by the PageCache filter.
182+
*
183+
* Default: [] - Cache all status codes (backward compatible)
184+
*
185+
* Recommended: [200] - Only cache successful responses
186+
*
187+
* You can also use status codes like:
188+
* [200, 404, 410] - Cache successful responses and specific error codes
189+
* [200, 201, 202, 203, 204] - All 2xx successful responses
190+
*
191+
* WARNING: Using [] may cache temporary error pages (404, 500, etc).
192+
* Consider restricting to [200] for production applications to avoid
193+
* caching errors that should be temporary.
194+
*
195+
* @var list<int>
196+
*/
197+
public array $cacheStatusCodes = [];
162198
}

app/Config/ContentSecurityPolicy.php

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ class ContentSecurityPolicy extends BaseConfig
3030
*/
3131
public ?string $reportURI = null;
3232

33+
/**
34+
* Specifies a reporting endpoint to which violation reports ought to be sent.
35+
*/
36+
public ?string $reportTo = null;
37+
3338
/**
3439
* Instructs user agents to rewrite URL schemes, changing
3540
* HTTP to HTTPS. This directive is for websites with
@@ -38,12 +43,12 @@ class ContentSecurityPolicy extends BaseConfig
3843
public bool $upgradeInsecureRequests = false;
3944

4045
// -------------------------------------------------------------------------
41-
// Sources allowed
46+
// CSP DIRECTIVES SETTINGS
4247
// NOTE: once you set a policy to 'none', it cannot be further restricted
4348
// -------------------------------------------------------------------------
4449

4550
/**
46-
* Will default to self if not overridden
51+
* Will default to `'self'` if not overridden
4752
*
4853
* @var list<string>|string|null
4954
*/
@@ -56,13 +61,43 @@ class ContentSecurityPolicy extends BaseConfig
5661
*/
5762
public $scriptSrc = 'self';
5863

64+
/**
65+
* Specifies valid sources for JavaScript <script> elements.
66+
*
67+
* @var list<string>|string
68+
*/
69+
public array|string $scriptSrcElem = 'self';
70+
71+
/**
72+
* Specifies valid sources for JavaScript inline event
73+
* handlers and JavaScript URLs.
74+
*
75+
* @var list<string>|string
76+
*/
77+
public array|string $scriptSrcAttr = 'self';
78+
5979
/**
6080
* Lists allowed stylesheets' URLs.
6181
*
6282
* @var list<string>|string
6383
*/
6484
public $styleSrc = 'self';
6585

86+
/**
87+
* Specifies valid sources for stylesheets <link> elements.
88+
*
89+
* @var list<string>|string
90+
*/
91+
public array|string $styleSrcElem = 'self';
92+
93+
/**
94+
* Specifies valid sources for stylesheets inline
95+
* style attributes and `<style>` elements.
96+
*
97+
* @var list<string>|string
98+
*/
99+
public array|string $styleSrcAttr = 'self';
100+
66101
/**
67102
* Defines the origins from which images can be loaded.
68103
*
@@ -145,6 +180,11 @@ class ContentSecurityPolicy extends BaseConfig
145180
*/
146181
public $manifestSrc;
147182

183+
/**
184+
* @var list<string>|string
185+
*/
186+
public array|string $workerSrc = [];
187+
148188
/**
149189
* Limits the kinds of plugins a page may invoke.
150190
*
@@ -160,17 +200,17 @@ class ContentSecurityPolicy extends BaseConfig
160200
public $sandbox;
161201

162202
/**
163-
* Nonce tag for style
203+
* Nonce placeholder for style tags.
164204
*/
165205
public string $styleNonceTag = '{csp-style-nonce}';
166206

167207
/**
168-
* Nonce tag for script
208+
* Nonce placeholder for script tags.
169209
*/
170210
public string $scriptNonceTag = '{csp-script-nonce}';
171211

172212
/**
173-
* Replace nonce tag automatically
213+
* Replace nonce tag automatically?
174214
*/
175215
public bool $autoNonce = true;
176216
}

app/Config/Email.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ class Email extends BaseConfig
3030
*/
3131
public string $SMTPHost = '';
3232

33+
/**
34+
* Which SMTP authentication method to use: login, plain
35+
*/
36+
public string $SMTPAuthMethod = 'login';
37+
3338
/**
3439
* SMTP Username
3540
*/

app/Config/Encryption.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,23 @@ class Encryption extends BaseConfig
2323
*/
2424
public string $key = '';
2525

26+
/**
27+
* --------------------------------------------------------------------------
28+
* Previous Encryption Keys
29+
* --------------------------------------------------------------------------
30+
*
31+
* When rotating encryption keys, add old keys here to maintain ability
32+
* to decrypt data encrypted with previous keys. Encryption always uses
33+
* the current $key. Decryption tries current key first, then falls back
34+
* to previous keys if decryption fails.
35+
*
36+
* In .env file, use comma-separated string:
37+
* encryption.previousKeys = hex2bin:9be8c64fcea509867...,hex2bin:3f5a1d8e9c2b7a4f6...
38+
*
39+
* @var list<string>|string
40+
*/
41+
public array|string $previousKeys = '';
42+
2643
/**
2744
* --------------------------------------------------------------------------
2845
* Encryption Driver to Use

app/Config/Format.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,13 @@ class Format extends BaseConfig
6161
'application/xml' => 0,
6262
'text/xml' => 0,
6363
];
64+
65+
/**
66+
* --------------------------------------------------------------------------
67+
* Maximum depth for JSON encoding.
68+
* --------------------------------------------------------------------------
69+
*
70+
* This value determines how deep the JSON encoder will traverse nested structures.
71+
*/
72+
public int $jsonEncodeDepth = 512;
6473
}

app/Config/Hostnames.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
namespace Config;
4+
5+
class Hostnames
6+
{
7+
// List of known two-part TLDs for subdomain extraction
8+
public const TWO_PART_TLDS = [
9+
'co.uk', 'org.uk', 'gov.uk', 'ac.uk', 'sch.uk', 'ltd.uk', 'plc.uk',
10+
'com.au', 'net.au', 'org.au', 'edu.au', 'gov.au', 'asn.au', 'id.au',
11+
'co.jp', 'ac.jp', 'go.jp', 'or.jp', 'ne.jp', 'gr.jp',
12+
'co.nz', 'org.nz', 'govt.nz', 'ac.nz', 'net.nz', 'geek.nz', 'maori.nz', 'school.nz',
13+
'co.in', 'net.in', 'org.in', 'ind.in', 'ac.in', 'gov.in', 'res.in',
14+
'com.cn', 'net.cn', 'org.cn', 'gov.cn', 'edu.cn',
15+
'com.sg', 'net.sg', 'org.sg', 'gov.sg', 'edu.sg', 'per.sg',
16+
'co.za', 'org.za', 'gov.za', 'ac.za', 'net.za',
17+
'co.kr', 'or.kr', 'go.kr', 'ac.kr', 'ne.kr', 'pe.kr',
18+
'co.th', 'or.th', 'go.th', 'ac.th', 'net.th', 'in.th',
19+
'com.my', 'net.my', 'org.my', 'edu.my', 'gov.my', 'mil.my', 'name.my',
20+
'com.mx', 'org.mx', 'net.mx', 'edu.mx', 'gob.mx',
21+
'com.br', 'net.br', 'org.br', 'gov.br', 'edu.br', 'art.br', 'eng.br',
22+
'co.il', 'org.il', 'ac.il', 'gov.il', 'net.il', 'muni.il',
23+
'co.id', 'or.id', 'ac.id', 'go.id', 'net.id', 'web.id', 'my.id',
24+
'com.hk', 'edu.hk', 'gov.hk', 'idv.hk', 'net.hk', 'org.hk',
25+
'com.tw', 'net.tw', 'org.tw', 'edu.tw', 'gov.tw', 'idv.tw',
26+
'com.sa', 'net.sa', 'org.sa', 'gov.sa', 'edu.sa', 'sch.sa', 'med.sa',
27+
'co.ae', 'net.ae', 'org.ae', 'gov.ae', 'ac.ae', 'sch.ae',
28+
'com.tr', 'net.tr', 'org.tr', 'gov.tr', 'edu.tr', 'av.tr', 'gen.tr',
29+
'co.ke', 'or.ke', 'go.ke', 'ac.ke', 'sc.ke', 'me.ke', 'mobi.ke', 'info.ke',
30+
'com.ng', 'org.ng', 'gov.ng', 'edu.ng', 'net.ng', 'sch.ng', 'name.ng',
31+
'com.pk', 'net.pk', 'org.pk', 'gov.pk', 'edu.pk', 'fam.pk',
32+
'com.eg', 'edu.eg', 'gov.eg', 'org.eg', 'net.eg',
33+
'com.cy', 'net.cy', 'org.cy', 'gov.cy', 'ac.cy',
34+
'com.lk', 'org.lk', 'edu.lk', 'gov.lk', 'net.lk', 'int.lk',
35+
'com.bd', 'net.bd', 'org.bd', 'ac.bd', 'gov.bd', 'mil.bd',
36+
'com.ar', 'net.ar', 'org.ar', 'gov.ar', 'edu.ar', 'mil.ar',
37+
'gob.cl', 'com.pl', 'net.pl', 'org.pl', 'gov.pl', 'edu.pl',
38+
'co.ir', 'ac.ir', 'org.ir', 'id.ir', 'gov.ir', 'sch.ir', 'net.ir',
39+
];
40+
}

app/Config/Images.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class Images extends BaseConfig
1616
/**
1717
* The path to the image library.
1818
* Required for ImageMagick, GraphicsMagick, or NetPBM.
19+
*
20+
* @deprecated 4.7.0 No longer used.
1921
*/
2022
public string $libraryPath = '/usr/local/bin/convert';
2123

0 commit comments

Comments
 (0)