Skip to content

Commit 0bf6182

Browse files
committed
Release v4.1.2
1 parent ddc18eb commit 0bf6182

File tree

217 files changed

+9406
-4824
lines changed

Some content is hidden

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

217 files changed

+9406
-4824
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Problems with it can be raised on our forum, or as issues in the main repository
3939

4040
We welcome contributions from the community.
4141

42-
Please read the [*Contributing to CodeIgniter*](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing.md) section in the development repository.
42+
Please read the [*Contributing to CodeIgniter*](https://github.com/codeigniter4/CodeIgniter4/blob/develop/CONTRIBUTING.md) section in the development repository.
4343

4444
## Server Requirements
4545

app/Config/App.php

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ class App extends BaseConfig
241241
* Set a cookie name prefix if you need to avoid collisions.
242242
*
243243
* @var string
244+
*
245+
* @deprecated use Config\Cookie::$prefix property instead.
244246
*/
245247
public $cookiePrefix = '';
246248

@@ -252,6 +254,8 @@ class App extends BaseConfig
252254
* Set to `.your-domain.com` for site-wide cookies.
253255
*
254256
* @var string
257+
*
258+
* @deprecated use Config\Cookie::$domain property instead.
255259
*/
256260
public $cookieDomain = '';
257261

@@ -263,6 +267,8 @@ class App extends BaseConfig
263267
* Typically will be a forward slash.
264268
*
265269
* @var string
270+
*
271+
* @deprecated use Config\Cookie::$path property instead.
266272
*/
267273
public $cookiePath = '/';
268274

@@ -274,19 +280,23 @@ class App extends BaseConfig
274280
* Cookie will only be set if a secure HTTPS connection exists.
275281
*
276282
* @var boolean
283+
*
284+
* @deprecated use Config\Cookie::$secure property instead.
277285
*/
278286
public $cookieSecure = false;
279287

280288
/**
281289
* --------------------------------------------------------------------------
282-
* Cookie HTTP Only
290+
* Cookie HttpOnly
283291
* --------------------------------------------------------------------------
284292
*
285293
* Cookie will only be accessible via HTTP(S) (no JavaScript).
286294
*
287295
* @var boolean
296+
*
297+
* @deprecated use Config\Cookie::$httponly property instead.
288298
*/
289-
public $cookieHTTPOnly = false;
299+
public $cookieHTTPOnly = true;
290300

291301
/**
292302
* --------------------------------------------------------------------------
@@ -299,11 +309,18 @@ class App extends BaseConfig
299309
* - Strict
300310
* - ''
301311
*
312+
* Alternatively, you can use the constant names:
313+
* - `Cookie::SAMESITE_NONE`
314+
* - `Cookie::SAMESITE_LAX`
315+
* - `Cookie::SAMESITE_STRICT`
316+
*
302317
* Defaults to `Lax` for compatibility with modern browsers. Setting `''`
303-
* (empty string) means no SameSite attribute will be set on cookies. If
304-
* set to `None`, `$cookieSecure` must also be set.
318+
* (empty string) means default SameSite attribute set by browsers (`Lax`)
319+
* will be set on cookies. If set to `None`, `$cookieSecure` must also be set.
320+
*
321+
* @var string
305322
*
306-
* @var string 'Lax'|'None'|'Strict'
323+
* @deprecated use Config\Cookie::$samesite property instead.
307324
*/
308325
public $cookieSameSite = 'Lax';
309326

app/Config/Autoload.php

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
/**
88
* -------------------------------------------------------------------
9-
* AUTO-LOADER
9+
* AUTOLOADER CONFIGURATION
1010
* -------------------------------------------------------------------
1111
*
1212
* This file defines the namespaces and class maps so the Autoloader
@@ -31,12 +31,12 @@ class Autoload extends AutoloadConfig
3131
* else you will need to modify all of those classes for this to work.
3232
*
3333
* Prototype:
34-
*
34+
*```
3535
* $psr4 = [
3636
* 'CodeIgniter' => SYSTEMPATH,
3737
* 'App' => APPPATH
3838
* ];
39-
*
39+
*```
4040
* @var array<string, string>
4141
*/
4242
public $psr4 = [
@@ -55,12 +55,30 @@ class Autoload extends AutoloadConfig
5555
* were being autoloaded through a namespace.
5656
*
5757
* Prototype:
58-
*
58+
*```
5959
* $classmap = [
6060
* 'MyClass' => '/path/to/class/file.php'
6161
* ];
62-
*
62+
*```
6363
* @var array<string, string>
6464
*/
6565
public $classmap = [];
66+
67+
/**
68+
* -------------------------------------------------------------------
69+
* Files
70+
* -------------------------------------------------------------------
71+
* The files array provides a list of paths to __non-class__ files
72+
* that will be autoloaded. This can be useful for bootstrap operations
73+
* or for loading functions.
74+
*
75+
* Prototype:
76+
* ```
77+
* $files = [
78+
* '/path/to/my/file.php',
79+
* ];
80+
* ```
81+
* @var array<int, string>
82+
*/
83+
public $files = [];
6684
}

app/Config/ContentSecurityPolicy.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,14 @@ class ContentSecurityPolicy extends BaseConfig
124124
*/
125125
public $frameAncestors = null;
126126

127+
/**
128+
* The frame-src directive restricts the URLs which may
129+
* be loaded into nested browsing contexts.
130+
*
131+
* @var array|string|null
132+
*/
133+
public $frameSrc = null;
134+
127135
/**
128136
* Restricts the origins allowed to deliver video and audio.
129137
*

app/Config/Cookie.php

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
<?php
2+
3+
namespace Config;
4+
5+
use CodeIgniter\Config\BaseConfig;
6+
use DateTimeInterface;
7+
8+
class Cookie extends BaseConfig
9+
{
10+
/**
11+
* --------------------------------------------------------------------------
12+
* Cookie Prefix
13+
* --------------------------------------------------------------------------
14+
*
15+
* Set a cookie name prefix if you need to avoid collisions.
16+
*
17+
* @var string
18+
*/
19+
public $prefix = '';
20+
21+
/**
22+
* --------------------------------------------------------------------------
23+
* Cookie Expires Timestamp
24+
* --------------------------------------------------------------------------
25+
*
26+
* Default expires timestamp for cookies. Setting this to `0` will mean the
27+
* cookie will not have the `Expires` attribute and will behave as a session
28+
* cookie.
29+
*
30+
* @var DateTimeInterface|integer|string
31+
*/
32+
public $expires = 0;
33+
34+
/**
35+
* --------------------------------------------------------------------------
36+
* Cookie Path
37+
* --------------------------------------------------------------------------
38+
*
39+
* Typically will be a forward slash.
40+
*
41+
* @var string
42+
*/
43+
public $path = '/';
44+
45+
/**
46+
* --------------------------------------------------------------------------
47+
* Cookie Domain
48+
* --------------------------------------------------------------------------
49+
*
50+
* Set to `.your-domain.com` for site-wide cookies.
51+
*
52+
* @var string
53+
*/
54+
public $domain = '';
55+
56+
/**
57+
* --------------------------------------------------------------------------
58+
* Cookie Secure
59+
* --------------------------------------------------------------------------
60+
*
61+
* Cookie will only be set if a secure HTTPS connection exists.
62+
*
63+
* @var boolean
64+
*/
65+
public $secure = false;
66+
67+
/**
68+
* --------------------------------------------------------------------------
69+
* Cookie HTTPOnly
70+
* --------------------------------------------------------------------------
71+
*
72+
* Cookie will only be accessible via HTTP(S) (no JavaScript).
73+
*
74+
* @var boolean
75+
*/
76+
public $httponly = true;
77+
78+
/**
79+
* --------------------------------------------------------------------------
80+
* Cookie SameSite
81+
* --------------------------------------------------------------------------
82+
*
83+
* Configure cookie SameSite setting. Allowed values are:
84+
* - None
85+
* - Lax
86+
* - Strict
87+
* - ''
88+
*
89+
* Alternatively, you can use the constant names:
90+
* - `Cookie::SAMESITE_NONE`
91+
* - `Cookie::SAMESITE_LAX`
92+
* - `Cookie::SAMESITE_STRICT`
93+
*
94+
* Defaults to `Lax` for compatibility with modern browsers. Setting `''`
95+
* (empty string) means default SameSite attribute set by browsers (`Lax`)
96+
* will be set on cookies. If set to `None`, `$secure` must also be set.
97+
*
98+
* @var string
99+
*/
100+
public $samesite = 'Lax';
101+
102+
/**
103+
* --------------------------------------------------------------------------
104+
* Cookie Raw
105+
* --------------------------------------------------------------------------
106+
*
107+
* This flag allows setting a "raw" cookie, i.e., its name and value are
108+
* not URL encoded using `rawurlencode()`.
109+
*
110+
* If this is set to `true`, cookie names should be compliant of RFC 2616's
111+
* list of allowed characters.
112+
*
113+
* @var boolean
114+
*
115+
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#attributes
116+
* @see https://tools.ietf.org/html/rfc2616#section-2.2
117+
*/
118+
public $raw = false;
119+
}

app/Config/Events.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
* --------------------------------------------------------------------
4747
* If you delete, they will no longer be collected.
4848
*/
49-
if (CI_DEBUG)
49+
if (CI_DEBUG && ! is_cli())
5050
{
5151
Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect');
5252
Services::toolbar()->respond();

app/Config/Exceptions.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,16 @@ class Exceptions extends BaseConfig
4545
* @var string
4646
*/
4747
public $errorViewPath = APPPATH . 'Views/errors';
48+
49+
/**
50+
* --------------------------------------------------------------------------
51+
* HIDE FROM DEBUG TRACE
52+
* --------------------------------------------------------------------------
53+
* Any data that you would like to hide from the debug trace.
54+
* In order to specify 2 levels, use "/" to separate.
55+
* ex. ['server', 'setup/password', 'secret_token']
56+
*
57+
* @var array
58+
*/
59+
public $sensitiveDataInTrace = [];
4860
}

app/Config/Logger.php

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,27 @@ class Logger extends BaseConfig
129129
* The ChromeLoggerHandler requires the use of the Chrome web browser
130130
* and the ChromeLogger extension. Uncomment this block to use it.
131131
*/
132-
// 'CodeIgniter\Log\Handlers\ChromeLoggerHandler' => [
133-
// /*
134-
// * The log levels that this handler will handle.
135-
// */
136-
// 'handles' => ['critical', 'alert', 'emergency', 'debug',
137-
// 'error', 'info', 'notice', 'warning'],
138-
// ]
132+
// 'CodeIgniter\Log\Handlers\ChromeLoggerHandler' => [
133+
// /*
134+
// * The log levels that this handler will handle.
135+
// */
136+
// 'handles' => ['critical', 'alert', 'emergency', 'debug',
137+
// 'error', 'info', 'notice', 'warning'],
138+
// ],
139+
140+
/**
141+
* The ErrorlogHandler writes the logs to PHP's native `error_log()` function.
142+
* Uncomment this block to use it.
143+
*/
144+
// 'CodeIgniter\Log\Handlers\ErrorlogHandler' => [
145+
// /* The log levels this handler can handle. */
146+
// 'handles' => ['critical', 'alert', 'emergency', 'debug', 'error', 'info', 'notice', 'warning'],
147+
//
148+
// /*
149+
// * The message type where the error should go. Can be 0 or 4, or use the
150+
// * class constants: `ErrorlogHandler::TYPE_OS` (0) or `ErrorlogHandler::TYPE_SAPI` (4)
151+
// */
152+
// 'messageType' => 0,
153+
// ],
139154
];
140155
}

app/Config/Mimes.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ class Mimes
335335
'application/msword',
336336
'application/x-zip',
337337
],
338+
'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
339+
'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
338340
'word' => [
339341
'application/msword',
340342
'application/octet-stream',

app/Config/Modules.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Modules extends BaseModules
1212
* --------------------------------------------------------------------------
1313
*
1414
* If true, then auto-discovery will happen across all elements listed in
15-
* $activeExplorers below. If false, no auto-discovery will happen at all,
15+
* $aliases below. If false, no auto-discovery will happen at all,
1616
* giving a slight performance boost.
1717
*
1818
* @var boolean

0 commit comments

Comments
 (0)