Skip to content

Commit 4a27689

Browse files
authored
Merge pull request #223 from kenjis/update-ci451
Update to CI 4.5.1
2 parents 6423a94 + 71cdcc4 commit 4a27689

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+7540
-387
lines changed

.github/workflows/deptrac.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ on:
2020

2121
jobs:
2222
deptrac:
23-
uses: codeigniter4/.github/.github/workflows/deptrac.yml@main
23+
uses: codeigniter4/.github/.github/workflows/deptrac.yml@CI45

.github/workflows/infection.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ on:
1212

1313
jobs:
1414
infection:
15-
uses: codeigniter4/.github/.github/workflows/infection.yml@main
15+
uses: codeigniter4/.github/.github/workflows/infection.yml@CI45

.github/workflows/phpcpd.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ on:
1616

1717
jobs:
1818
phpcpd:
19-
uses: codeigniter4/.github/.github/workflows/phpcpd.yml@main
19+
uses: codeigniter4/.github/.github/workflows/phpcpd.yml@CI45
2020
with:
2121
dirs: "src/ tests/"

.github/workflows/phpcsfixer.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ on:
1616

1717
jobs:
1818
phpcsfixer:
19-
uses: codeigniter4/.github/.github/workflows/phpcsfixer.yml@main
19+
uses: codeigniter4/.github/.github/workflows/phpcsfixer.yml@CI45

.github/workflows/phpstan.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ on:
2020

2121
jobs:
2222
phpstan:
23-
uses: codeigniter4/.github/.github/workflows/phpstan.yml@main
23+
uses: codeigniter4/.github/.github/workflows/phpstan.yml@CI45

.github/workflows/phpunit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ on:
2020

2121
jobs:
2222
phpunit:
23-
uses: codeigniter4/.github/.github/workflows/phpunit.yml@main
23+
uses: codeigniter4/.github/.github/workflows/phpunit.yml@CI45

.github/workflows/psalm.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ on:
2020

2121
jobs:
2222
psalm:
23-
uses: codeigniter4/.github/.github/workflows/psalm.yml@main
23+
uses: codeigniter4/.github/.github/workflows/psalm.yml@CI45

.github/workflows/rector.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ on:
2020

2121
jobs:
2222
rector:
23-
uses: codeigniter4/.github/.github/workflows/rector.yml@main
23+
uses: codeigniter4/.github/.github/workflows/rector.yml@CI45

.github/workflows/unused.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ on:
1818

1919
jobs:
2020
unused:
21-
uses: codeigniter4/.github/.github/workflows/unused.yml@main
21+
uses: codeigniter4/.github/.github/workflows/unused.yml@CI45

app/.htaccess

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<IfModule authz_core_module>
2-
Require all denied
2+
Require all denied
33
</IfModule>
44
<IfModule !authz_core_module>
5-
Deny from all
5+
Deny from all
66
</IfModule>

app/Config/App.php

+40-15
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ class App extends BaseConfig
1414
* URL to your CodeIgniter root. Typically, this will be your base URL,
1515
* WITH a trailing slash:
1616
*
17-
* http://example.com/
17+
* E.g., http://example.com/
1818
*/
1919
public string $baseURL = 'http://localhost:8080/';
2020

2121
/**
2222
* Allowed Hostnames in the Site URL other than the hostname in the baseURL.
2323
* If you want to accept multiple Hostnames, set this.
2424
*
25-
* E.g. When your site URL ($baseURL) is 'http://example.com/', and your site
26-
* also accepts 'http://media.example.com/' and
27-
* 'http://accounts.example.com/':
28-
* ['media.example.com', 'accounts.example.com']
25+
* E.g.,
26+
* When your site URL ($baseURL) is 'http://example.com/', and your site
27+
* also accepts 'http://media.example.com/' and 'http://accounts.example.com/':
28+
* ['media.example.com', 'accounts.example.com']
2929
*
3030
* @var list<string>
3131
*/
@@ -36,9 +36,9 @@ class App extends BaseConfig
3636
* Index File
3737
* --------------------------------------------------------------------------
3838
*
39-
* Typically this will be your index.php file, unless you've renamed it to
40-
* something else. If you are using mod_rewrite to remove the page set this
41-
* variable so that it is blank.
39+
* Typically, this will be your `index.php` file, unless you've renamed it to
40+
* something else. If you have configured your web server to remove this file
41+
* from your site URIs, set this variable to an empty string.
4242
*/
4343
public string $indexPage = 'index.php';
4444

@@ -48,17 +48,41 @@ class App extends BaseConfig
4848
* --------------------------------------------------------------------------
4949
*
5050
* This item determines which server global should be used to retrieve the
51-
* URI string. The default setting of 'REQUEST_URI' works for most servers.
51+
* URI string. The default setting of 'REQUEST_URI' works for most servers.
5252
* If your links do not seem to work, try one of the other delicious flavors:
5353
*
54-
* 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
55-
* 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
56-
* 'PATH_INFO' Uses $_SERVER['PATH_INFO']
54+
* 'REQUEST_URI': Uses $_SERVER['REQUEST_URI']
55+
* 'QUERY_STRING': Uses $_SERVER['QUERY_STRING']
56+
* 'PATH_INFO': Uses $_SERVER['PATH_INFO']
5757
*
5858
* WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
5959
*/
6060
public string $uriProtocol = 'REQUEST_URI';
6161

62+
/*
63+
|--------------------------------------------------------------------------
64+
| Allowed URL Characters
65+
|--------------------------------------------------------------------------
66+
|
67+
| This lets you specify which characters are permitted within your URLs.
68+
| When someone tries to submit a URL with disallowed characters they will
69+
| get a warning message.
70+
|
71+
| As a security measure you are STRONGLY encouraged to restrict URLs to
72+
| as few characters as possible.
73+
|
74+
| By default, only these are allowed: `a-z 0-9~%.:_-`
75+
|
76+
| Set an empty string to allow all characters -- but only if you are insane.
77+
|
78+
| The configured value is actually a regular expression character group
79+
| and it will be used as: '/\A[<permittedURIChars>]+\z/iu'
80+
|
81+
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
82+
|
83+
*/
84+
public string $permittedURIChars = 'a-z 0-9~%.:_\-';
85+
6286
/**
6387
* --------------------------------------------------------------------------
6488
* Default Locale
@@ -94,7 +118,7 @@ class App extends BaseConfig
94118
*
95119
* IncomingRequest::setLocale() also uses this list.
96120
*
97-
* @var string[]
121+
* @var list<string>
98122
*/
99123
public array $supportedLocales = ['en'];
100124

@@ -106,7 +130,8 @@ class App extends BaseConfig
106130
* The default timezone that will be used in your application to display
107131
* dates with the date helper, and can be retrieved through app_timezone()
108132
*
109-
* @see https://www.php.net/manual/en/timezones.php for list of timezones supported by PHP.
133+
* @see https://www.php.net/manual/en/timezones.php for list of timezones
134+
* supported by PHP.
110135
*/
111136
public string $appTimezone = 'UTC';
112137

@@ -130,7 +155,7 @@ class App extends BaseConfig
130155
* If true, this will force every request made to this application to be
131156
* made via a secure connection (HTTPS). If the incoming request is not
132157
* secure, the user will be redirected to a secure version of the page
133-
* and the HTTP Strict Transport Security header will be set.
158+
* and the HTTP Strict Transport Security (HSTS) header will be set.
134159
*/
135160
public bool $forceGlobalSecureRequests = false;
136161

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|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/ContentSecurityPolicy.php

+16-16
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,28 @@ class ContentSecurityPolicy extends BaseConfig
4545
/**
4646
* Will default to self if not overridden
4747
*
48-
* @var string|string[]|null
48+
* @var list<string>|string|null
4949
*/
5050
public $defaultSrc;
5151

5252
/**
5353
* Lists allowed scripts' URLs.
5454
*
55-
* @var string|string[]
55+
* @var list<string>|string
5656
*/
5757
public $scriptSrc = 'self';
5858

5959
/**
6060
* Lists allowed stylesheets' URLs.
6161
*
62-
* @var string|string[]
62+
* @var list<string>|string
6363
*/
6464
public $styleSrc = 'self';
6565

6666
/**
6767
* Defines the origins from which images can be loaded.
6868
*
69-
* @var string|string[]
69+
* @var list<string>|string
7070
*/
7171
public $imageSrc = 'self';
7272

@@ -75,36 +75,36 @@ class ContentSecurityPolicy extends BaseConfig
7575
*
7676
* Will default to self if not overridden
7777
*
78-
* @var string|string[]|null
78+
* @var list<string>|string|null
7979
*/
8080
public $baseURI;
8181

8282
/**
8383
* Lists the URLs for workers and embedded frame contents
8484
*
85-
* @var string|string[]
85+
* @var list<string>|string
8686
*/
8787
public $childSrc = 'self';
8888

8989
/**
9090
* Limits the origins that you can connect to (via XHR,
9191
* WebSockets, and EventSource).
9292
*
93-
* @var string|string[]
93+
* @var list<string>|string
9494
*/
9595
public $connectSrc = 'self';
9696

9797
/**
9898
* Specifies the origins that can serve web fonts.
9999
*
100-
* @var string|string[]
100+
* @var list<string>|string
101101
*/
102102
public $fontSrc;
103103

104104
/**
105105
* Lists valid endpoints for submission from `<form>` tags.
106106
*
107-
* @var string|string[]
107+
* @var list<string>|string
108108
*/
109109
public $formAction = 'self';
110110

@@ -114,48 +114,48 @@ class ContentSecurityPolicy extends BaseConfig
114114
* and `<applet>` tags. This directive can't be used in
115115
* `<meta>` tags and applies only to non-HTML resources.
116116
*
117-
* @var string|string[]|null
117+
* @var list<string>|string|null
118118
*/
119119
public $frameAncestors;
120120

121121
/**
122122
* The frame-src directive restricts the URLs which may
123123
* be loaded into nested browsing contexts.
124124
*
125-
* @var array|string|null
125+
* @var list<string>|string|null
126126
*/
127127
public $frameSrc;
128128

129129
/**
130130
* Restricts the origins allowed to deliver video and audio.
131131
*
132-
* @var string|string[]|null
132+
* @var list<string>|string|null
133133
*/
134134
public $mediaSrc;
135135

136136
/**
137137
* Allows control over Flash and other plugins.
138138
*
139-
* @var string|string[]
139+
* @var list<string>|string
140140
*/
141141
public $objectSrc = 'self';
142142

143143
/**
144-
* @var string|string[]|null
144+
* @var list<string>|string|null
145145
*/
146146
public $manifestSrc;
147147

148148
/**
149149
* Limits the kinds of plugins a page may invoke.
150150
*
151-
* @var string|string[]|null
151+
* @var list<string>|string|null
152152
*/
153153
public $pluginTypes;
154154

155155
/**
156156
* List of actions allowed.
157157
*
158-
* @var string|string[]|null
158+
* @var list<string>|string|null
159159
*/
160160
public $sandbox;
161161

0 commit comments

Comments
 (0)