Skip to content

Commit ec03620

Browse files
committed
Release v4.5.0
1 parent f4b08c2 commit ec03620

24 files changed

+532
-319
lines changed

.github/workflows/phpunit.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: PHPUnit
22

33
on:
44
pull_request:
5-
branches:
5+
branches:
66
- develop
77

88
jobs:
@@ -11,7 +11,7 @@ jobs:
1111

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

1616
runs-on: ubuntu-latest
1717

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Problems with it can be raised on our forum, or as issues in the main repository
5050

5151
## Server Requirements
5252

53-
PHP version 7.4 or higher is required, with the following extensions installed:
53+
PHP version 8.1 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)

app/Config/Autoload.php

+5-10
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,17 @@ class Autoload extends AutoloadConfig
3030
* their location on the file system. These are used by the autoloader
3131
* to locate files the first time they have been instantiated.
3232
*
33-
* The '/app' and '/system' directories are already mapped for you.
34-
* you may change the name of the 'App' namespace if you wish,
33+
* The 'Config' (APPPATH . 'Config') and 'CodeIgniter' (SYSTEMPATH) are
34+
* already mapped for you.
35+
*
36+
* You may change the name of the 'App' namespace if you wish,
3537
* but this should be done prior to creating any namespaced classes,
3638
* else you will need to modify all of those classes for this to work.
3739
*
38-
* Prototype:
39-
* $psr4 = [
40-
* 'CodeIgniter' => SYSTEMPATH,
41-
* 'App' => APPPATH
42-
* ];
43-
*
4440
* @var array<string, list<string>|string>
4541
*/
4642
public $psr4 = [
47-
APP_NAMESPACE => APPPATH, // For custom app namespace
48-
'Config' => APPPATH . 'Config',
43+
APP_NAMESPACE => APPPATH,
4944
];
5045

5146
/**

app/Config/Boot/production.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
|
1010
| If you set 'display_errors' to '1', CI4's detailed error report will show.
1111
*/
12+
error_reporting(E_ALL & ~E_DEPRECATED);
13+
// If you want to suppress more types of errors.
14+
// error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
1215
ini_set('display_errors', '0');
13-
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
1416

1517
/*
1618
|--------------------------------------------------------------------------

app/Config/Cache.php

+19-19
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,6 @@ class Cache extends BaseConfig
4646
*/
4747
public string $storePath = WRITEPATH . 'cache/';
4848

49-
/**
50-
* --------------------------------------------------------------------------
51-
* Cache Include Query String
52-
* --------------------------------------------------------------------------
53-
*
54-
* Whether to take the URL query string into consideration when generating
55-
* output cache files. Valid options are:
56-
*
57-
* false = Disabled
58-
* true = Enabled, take all query parameters into account.
59-
* Please be aware that this may result in numerous cache
60-
* files generated for the same page over and over again.
61-
* ['q'] = Enabled, but only take into account the specified list
62-
* of query parameters.
63-
*
64-
* @var bool|list<string>
65-
*/
66-
public $cacheQueryString = false;
67-
6849
/**
6950
* --------------------------------------------------------------------------
7051
* Key Prefix
@@ -168,4 +149,23 @@ class Cache extends BaseConfig
168149
'redis' => RedisHandler::class,
169150
'wincache' => WincacheHandler::class,
170151
];
152+
153+
/**
154+
* --------------------------------------------------------------------------
155+
* Web Page Caching: Cache Include Query String
156+
* --------------------------------------------------------------------------
157+
*
158+
* Whether to take the URL query string into consideration when generating
159+
* output cache files. Valid options are:
160+
*
161+
* false = Disabled
162+
* true = Enabled, take all query parameters into account.
163+
* Please be aware that this may result in numerous cache
164+
* files generated for the same page over and over again.
165+
* ['q'] = Enabled, but only take into account the specified list
166+
* of query parameters.
167+
*
168+
* @var bool|list<string>
169+
*/
170+
public $cacheQueryString = false;
171171
}

app/Config/Cors.php

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<?php
2+
3+
namespace Config;
4+
5+
use CodeIgniter\Config\BaseConfig;
6+
7+
/**
8+
* Cross-Origin Resource Sharing (CORS) Configuration
9+
*
10+
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
11+
*/
12+
class Cors extends BaseConfig
13+
{
14+
/**
15+
* The default CORS configuration.
16+
*
17+
* @var array{
18+
* allowedOrigins: list<string>,
19+
* allowedOriginsPatterns: list<string>,
20+
* supportsCredentials: bool,
21+
* allowedHeaders: list<string>,
22+
* exposedHeaders: list<string>,
23+
* allowedMethods: list<string>,
24+
* maxAge: int,
25+
* }
26+
*/
27+
public array $default = [
28+
/**
29+
* Origins for the `Access-Control-Allow-Origin` header.
30+
*
31+
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
32+
*
33+
* E.g.:
34+
* - ['http://localhost:8080']
35+
* - ['https://www.example.com']
36+
*/
37+
'allowedOrigins' => [],
38+
39+
/**
40+
* Origin regex patterns for the `Access-Control-Allow-Origin` header.
41+
*
42+
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
43+
*
44+
* NOTE: A pattern specified here is part of a regular expression. It will
45+
* be actually `#\A<pattern>\z#`.
46+
*
47+
* E.g.:
48+
* - ['https://\w+\.example\.com']
49+
*/
50+
'allowedOriginsPatterns' => [],
51+
52+
/**
53+
* Weather to send the `Access-Control-Allow-Credentials` header.
54+
*
55+
* The Access-Control-Allow-Credentials response header tells browsers whether
56+
* the server allows cross-origin HTTP requests to include credentials.
57+
*
58+
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials
59+
*/
60+
'supportsCredentials' => false,
61+
62+
/**
63+
* Set headers to allow.
64+
*
65+
* The Access-Control-Allow-Headers response header is used in response to
66+
* a preflight request which includes the Access-Control-Request-Headers to
67+
* indicate which HTTP headers can be used during the actual request.
68+
*
69+
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers
70+
*/
71+
'allowedHeaders' => [],
72+
73+
/**
74+
* Set headers to expose.
75+
*
76+
* The Access-Control-Expose-Headers response header allows a server to
77+
* indicate which response headers should be made available to scripts running
78+
* in the browser, in response to a cross-origin request.
79+
*
80+
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers
81+
*/
82+
'exposedHeaders' => [],
83+
84+
/**
85+
* Set methods to allow.
86+
*
87+
* The Access-Control-Allow-Methods response header specifies one or more
88+
* methods allowed when accessing a resource in response to a preflight
89+
* request.
90+
*
91+
* E.g.:
92+
* - ['GET', 'POST', 'PUT', 'DELETE']
93+
*
94+
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods
95+
*/
96+
'allowedMethods' => [],
97+
98+
/**
99+
* Set how many seconds the results of a preflight request can be cached.
100+
*
101+
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age
102+
*/
103+
'maxAge' => 7200,
104+
];
105+
}

app/Config/Database.php

+121-9
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@
1010
class Database extends Config
1111
{
1212
/**
13-
* The directory that holds the Migrations
14-
* and Seeds directories.
13+
* The directory that holds the Migrations and Seeds directories.
1514
*/
1615
public string $filesPath = APPPATH . 'Database' . DIRECTORY_SEPARATOR;
1716

1817
/**
19-
* Lets you choose which connection group to
20-
* use if no other is specified.
18+
* Lets you choose which connection group to use if no other is specified.
2119
*/
2220
public string $defaultGroup = 'default';
2321

@@ -36,20 +34,129 @@ class Database extends Config
3634
'DBPrefix' => '',
3735
'pConnect' => false,
3836
'DBDebug' => true,
39-
'charset' => 'utf8',
40-
'DBCollat' => 'utf8_general_ci',
37+
'charset' => 'utf8mb4',
38+
'DBCollat' => 'utf8mb4_general_ci',
4139
'swapPre' => '',
4240
'encrypt' => false,
4341
'compress' => false,
4442
'strictOn' => false,
4543
'failover' => [],
4644
'port' => 3306,
4745
'numberNative' => false,
46+
'dateFormat' => [
47+
'date' => 'Y-m-d',
48+
'datetime' => 'Y-m-d H:i:s',
49+
'time' => 'H:i:s',
50+
],
4851
];
4952

53+
// /**
54+
// * Sample database connection for SQLite3.
55+
// *
56+
// * @var array<string, mixed>
57+
// */
58+
// public array $default = [
59+
// 'database' => 'database.db',
60+
// 'DBDriver' => 'SQLite3',
61+
// 'DBPrefix' => '',
62+
// 'DBDebug' => true,
63+
// 'swapPre' => '',
64+
// 'failover' => [],
65+
// 'foreignKeys' => true,
66+
// 'busyTimeout' => 1000,
67+
// 'dateFormat' => [
68+
// 'date' => 'Y-m-d',
69+
// 'datetime' => 'Y-m-d H:i:s',
70+
// 'time' => 'H:i:s',
71+
// ],
72+
// ];
73+
74+
// /**
75+
// * Sample database connection for Postgre.
76+
// *
77+
// * @var array<string, mixed>
78+
// */
79+
// public array $default = [
80+
// 'DSN' => '',
81+
// 'hostname' => 'localhost',
82+
// 'username' => 'root',
83+
// 'password' => 'root',
84+
// 'database' => 'ci4',
85+
// 'schema' => 'public',
86+
// 'DBDriver' => 'Postgre',
87+
// 'DBPrefix' => '',
88+
// 'pConnect' => false,
89+
// 'DBDebug' => true,
90+
// 'charset' => 'utf8',
91+
// 'swapPre' => '',
92+
// 'failover' => [],
93+
// 'port' => 5432,
94+
// 'dateFormat' => [
95+
// 'date' => 'Y-m-d',
96+
// 'datetime' => 'Y-m-d H:i:s',
97+
// 'time' => 'H:i:s',
98+
// ],
99+
// ];
100+
101+
// /**
102+
// * Sample database connection for SQLSRV.
103+
// *
104+
// * @var array<string, mixed>
105+
// */
106+
// public array $default = [
107+
// 'DSN' => '',
108+
// 'hostname' => 'localhost',
109+
// 'username' => 'root',
110+
// 'password' => 'root',
111+
// 'database' => 'ci4',
112+
// 'schema' => 'dbo',
113+
// 'DBDriver' => 'SQLSRV',
114+
// 'DBPrefix' => '',
115+
// 'pConnect' => false,
116+
// 'DBDebug' => true,
117+
// 'charset' => 'utf8',
118+
// 'swapPre' => '',
119+
// 'encrypt' => false,
120+
// 'failover' => [],
121+
// 'port' => 1433,
122+
// 'dateFormat' => [
123+
// 'date' => 'Y-m-d',
124+
// 'datetime' => 'Y-m-d H:i:s',
125+
// 'time' => 'H:i:s',
126+
// ],
127+
// ];
128+
129+
// /**
130+
// * Sample database connection for OCI8.
131+
// *
132+
// * You may need the following environment variables:
133+
// * NLS_LANG = 'AMERICAN_AMERICA.UTF8'
134+
// * NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'
135+
// * NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS'
136+
// * NLS_TIMESTAMP_TZ_FORMAT = 'YYYY-MM-DD HH24:MI:SS'
137+
// *
138+
// * @var array<string, mixed>
139+
// */
140+
// public array $default = [
141+
// 'DSN' => 'localhost:1521/XEPDB1',
142+
// 'username' => 'root',
143+
// 'password' => 'root',
144+
// 'DBDriver' => 'OCI8',
145+
// 'DBPrefix' => '',
146+
// 'pConnect' => false,
147+
// 'DBDebug' => true,
148+
// 'charset' => 'AL32UTF8',
149+
// 'swapPre' => '',
150+
// 'failover' => [],
151+
// 'dateFormat' => [
152+
// 'date' => 'Y-m-d',
153+
// 'datetime' => 'Y-m-d H:i:s',
154+
// 'time' => 'H:i:s',
155+
// ],
156+
// ];
157+
50158
/**
51-
* This database connection is used when
52-
* running PHPUnit database tests.
159+
* This database connection is used when running PHPUnit database tests.
53160
*
54161
* @var array<string, mixed>
55162
*/
@@ -64,7 +171,7 @@ class Database extends Config
64171
'pConnect' => false,
65172
'DBDebug' => true,
66173
'charset' => 'utf8',
67-
'DBCollat' => 'utf8_general_ci',
174+
'DBCollat' => '',
68175
'swapPre' => '',
69176
'encrypt' => false,
70177
'compress' => false,
@@ -73,6 +180,11 @@ class Database extends Config
73180
'port' => 3306,
74181
'foreignKeys' => true,
75182
'busyTimeout' => 1000,
183+
'dateFormat' => [
184+
'date' => 'Y-m-d',
185+
'datetime' => 'Y-m-d H:i:s',
186+
'time' => 'H:i:s',
187+
],
76188
];
77189

78190
public function __construct()

0 commit comments

Comments
 (0)