@@ -21,10 +21,22 @@ class App extends BaseConfig
21
21
* and path to your installation. However, you should always configure this
22
22
* explicitly and never rely on auto-guessing, especially in production
23
23
* environments.
24
+ */
25
+ public string $ baseURL = 'http://localhost:8080/ ' ;
26
+
27
+ /**
28
+ * Allowed Hostnames in the Site URL other than the hostname in the baseURL.
29
+ * If you want to accept multiple Hostnames, set this.
24
30
*
25
- * @var string
31
+ * E.g. When your site URL ($baseURL) is 'http://example.com/', and your site
32
+ * also accepts 'http://media.example.com/' and
33
+ * 'http://accounts.example.com/':
34
+ * ['media.example.com', 'accounts.example.com']
35
+ *
36
+ * @var string[]
37
+ * @phpstan-var list<string>
26
38
*/
27
- public $ baseURL = ' http://localhost:8080/ ' ;
39
+ public array $ allowedHostnames = [] ;
28
40
29
41
/**
30
42
* --------------------------------------------------------------------------
@@ -34,10 +46,8 @@ class App extends BaseConfig
34
46
* Typically this will be your index.php file, unless you've renamed it to
35
47
* something else. If you are using mod_rewrite to remove the page set this
36
48
* variable so that it is blank.
37
- *
38
- * @var string
39
49
*/
40
- public $ indexPage = 'index.php ' ;
50
+ public string $ indexPage = 'index.php ' ;
41
51
42
52
/**
43
53
* --------------------------------------------------------------------------
@@ -53,10 +63,8 @@ class App extends BaseConfig
53
63
* 'PATH_INFO' Uses $_SERVER['PATH_INFO']
54
64
*
55
65
* WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
56
- *
57
- * @var string
58
66
*/
59
- public $ uriProtocol = 'REQUEST_URI ' ;
67
+ public string $ uriProtocol = 'REQUEST_URI ' ;
60
68
61
69
/**
62
70
* --------------------------------------------------------------------------
@@ -67,10 +75,8 @@ class App extends BaseConfig
67
75
* is viewing the site from. It affects the language strings and other
68
76
* strings (like currency markers, numbers, etc), that your program
69
77
* should run under for this request.
70
- *
71
- * @var string
72
78
*/
73
- public $ defaultLocale = 'en ' ;
79
+ public string $ defaultLocale = 'en ' ;
74
80
75
81
/**
76
82
* --------------------------------------------------------------------------
@@ -81,10 +87,8 @@ class App extends BaseConfig
81
87
* language to use based on the value of the Accept-Language header.
82
88
*
83
89
* If false, no automatic detection will be performed.
84
- *
85
- * @var bool
86
90
*/
87
- public $ negotiateLocale = false ;
91
+ public bool $ negotiateLocale = false ;
88
92
89
93
/**
90
94
* --------------------------------------------------------------------------
@@ -97,7 +101,7 @@ class App extends BaseConfig
97
101
*
98
102
* @var string[]
99
103
*/
100
- public $ supportedLocales = ['en ' ];
104
+ public array $ supportedLocales = ['en ' ];
101
105
102
106
/**
103
107
* --------------------------------------------------------------------------
@@ -106,10 +110,8 @@ class App extends BaseConfig
106
110
*
107
111
* The default timezone that will be used in your application to display
108
112
* dates with the date helper, and can be retrieved through app_timezone()
109
- *
110
- * @var string
111
113
*/
112
- public $ appTimezone = 'America/Chicago ' ;
114
+ public string $ appTimezone = 'UTC ' ;
113
115
114
116
/**
115
117
* --------------------------------------------------------------------------
@@ -120,10 +122,8 @@ class App extends BaseConfig
120
122
* that require a character set to be provided.
121
123
*
122
124
* @see http://php.net/htmlspecialchars for a list of supported charsets.
123
- *
124
- * @var string
125
125
*/
126
- public $ charset = 'UTF-8 ' ;
126
+ public string $ charset = 'UTF-8 ' ;
127
127
128
128
/**
129
129
* --------------------------------------------------------------------------
@@ -134,10 +134,8 @@ class App extends BaseConfig
134
134
* made via a secure connection (HTTPS). If the incoming request is not
135
135
* secure, the user will be redirected to a secure version of the page
136
136
* and the HTTP Strict Transport Security header will be set.
137
- *
138
- * @var bool
139
137
*/
140
- public $ forceGlobalSecureRequests = false ;
138
+ public bool $ forceGlobalSecureRequests = false ;
141
139
142
140
/**
143
141
* --------------------------------------------------------------------------
@@ -150,9 +148,9 @@ class App extends BaseConfig
150
148
* - `CodeIgniter\Session\Handlers\MemcachedHandler`
151
149
* - `CodeIgniter\Session\Handlers\RedisHandler`
152
150
*
153
- * @var string
151
+ * @deprecated use Config\Session::$driver instead.
154
152
*/
155
- public $ sessionDriver = FileHandler::class;
153
+ public string $ sessionDriver = FileHandler::class;
156
154
157
155
/**
158
156
* --------------------------------------------------------------------------
@@ -161,9 +159,9 @@ class App extends BaseConfig
161
159
*
162
160
* The session cookie name, must contain only [0-9a-z_-] characters
163
161
*
164
- * @var string
162
+ * @deprecated use Config\Session::$cookieName instead.
165
163
*/
166
- public $ sessionCookieName = 'ci_session ' ;
164
+ public string $ sessionCookieName = 'ci_session ' ;
167
165
168
166
/**
169
167
* --------------------------------------------------------------------------
@@ -173,9 +171,9 @@ class App extends BaseConfig
173
171
* The number of SECONDS you want the session to last.
174
172
* Setting to 0 (zero) means expire when the browser is closed.
175
173
*
176
- * @var int
174
+ * @deprecated use Config\Session::$expiration instead.
177
175
*/
178
- public $ sessionExpiration = 7200 ;
176
+ public int $ sessionExpiration = 7200 ;
179
177
180
178
/**
181
179
* --------------------------------------------------------------------------
@@ -192,9 +190,9 @@ class App extends BaseConfig
192
190
*
193
191
* IMPORTANT: You are REQUIRED to set a valid save path!
194
192
*
195
- * @var string
193
+ * @deprecated use Config\Session::$savePath instead.
196
194
*/
197
- public $ sessionSavePath = WRITEPATH . 'session ' ;
195
+ public string $ sessionSavePath = WRITEPATH . 'session ' ;
198
196
199
197
/**
200
198
* --------------------------------------------------------------------------
@@ -206,9 +204,9 @@ class App extends BaseConfig
206
204
* WARNING: If you're using the database driver, don't forget to update
207
205
* your session table's PRIMARY KEY when changing this setting.
208
206
*
209
- * @var bool
207
+ * @deprecated use Config\Session::$matchIP instead.
210
208
*/
211
- public $ sessionMatchIP = false ;
209
+ public bool $ sessionMatchIP = false ;
212
210
213
211
/**
214
212
* --------------------------------------------------------------------------
@@ -217,9 +215,9 @@ class App extends BaseConfig
217
215
*
218
216
* How many seconds between CI regenerating the session ID.
219
217
*
220
- * @var int
218
+ * @deprecated use Config\Session::$timeToUpdate instead.
221
219
*/
222
- public $ sessionTimeToUpdate = 300 ;
220
+ public int $ sessionTimeToUpdate = 300 ;
223
221
224
222
/**
225
223
* --------------------------------------------------------------------------
@@ -230,9 +228,20 @@ class App extends BaseConfig
230
228
* when auto-regenerating the session ID. When set to FALSE, the data
231
229
* will be later deleted by the garbage collector.
232
230
*
233
- * @var bool
231
+ * @deprecated use Config\Session::$regenerateDestroy instead.
234
232
*/
235
- public $ sessionRegenerateDestroy = false ;
233
+ public bool $ sessionRegenerateDestroy = false ;
234
+
235
+ /**
236
+ * --------------------------------------------------------------------------
237
+ * Session Database Group
238
+ * --------------------------------------------------------------------------
239
+ *
240
+ * DB Group for the database session.
241
+ *
242
+ * @deprecated use Config\Session::$DBGroup instead.
243
+ */
244
+ public ?string $ sessionDBGroup = null ;
236
245
237
246
/**
238
247
* --------------------------------------------------------------------------
@@ -241,11 +250,9 @@ class App extends BaseConfig
241
250
*
242
251
* Set a cookie name prefix if you need to avoid collisions.
243
252
*
244
- * @var string
245
- *
246
253
* @deprecated use Config\Cookie::$prefix property instead.
247
254
*/
248
- public $ cookiePrefix = '' ;
255
+ public string $ cookiePrefix = '' ;
249
256
250
257
/**
251
258
* --------------------------------------------------------------------------
@@ -254,11 +261,9 @@ class App extends BaseConfig
254
261
*
255
262
* Set to `.your-domain.com` for site-wide cookies.
256
263
*
257
- * @var string
258
- *
259
264
* @deprecated use Config\Cookie::$domain property instead.
260
265
*/
261
- public $ cookieDomain = '' ;
266
+ public string $ cookieDomain = '' ;
262
267
263
268
/**
264
269
* --------------------------------------------------------------------------
@@ -267,11 +272,9 @@ class App extends BaseConfig
267
272
*
268
273
* Typically will be a forward slash.
269
274
*
270
- * @var string
271
- *
272
275
* @deprecated use Config\Cookie::$path property instead.
273
276
*/
274
- public $ cookiePath = '/ ' ;
277
+ public string $ cookiePath = '/ ' ;
275
278
276
279
/**
277
280
* --------------------------------------------------------------------------
@@ -280,11 +283,9 @@ class App extends BaseConfig
280
283
*
281
284
* Cookie will only be set if a secure HTTPS connection exists.
282
285
*
283
- * @var bool
284
- *
285
286
* @deprecated use Config\Cookie::$secure property instead.
286
287
*/
287
- public $ cookieSecure = false ;
288
+ public bool $ cookieSecure = false ;
288
289
289
290
/**
290
291
* --------------------------------------------------------------------------
@@ -293,11 +294,9 @@ class App extends BaseConfig
293
294
*
294
295
* Cookie will only be accessible via HTTP(S) (no JavaScript).
295
296
*
296
- * @var bool
297
- *
298
297
* @deprecated use Config\Cookie::$httponly property instead.
299
298
*/
300
- public $ cookieHTTPOnly = true ;
299
+ public bool $ cookieHTTPOnly = true ;
301
300
302
301
/**
303
302
* --------------------------------------------------------------------------
@@ -319,11 +318,9 @@ class App extends BaseConfig
319
318
* (empty string) means default SameSite attribute set by browsers (`Lax`)
320
319
* will be set on cookies. If set to `None`, `$cookieSecure` must also be set.
321
320
*
322
- * @var string|null
323
- *
324
321
* @deprecated use Config\Cookie::$samesite property instead.
325
322
*/
326
- public $ cookieSameSite = 'Lax ' ;
323
+ public ? string $ cookieSameSite = 'Lax ' ;
327
324
328
325
/**
329
326
* --------------------------------------------------------------------------
@@ -346,7 +343,7 @@ class App extends BaseConfig
346
343
*
347
344
* @var array<string, string>
348
345
*/
349
- public $ proxyIPs = [];
346
+ public array $ proxyIPs = [];
350
347
351
348
/**
352
349
* --------------------------------------------------------------------------
@@ -356,10 +353,8 @@ class App extends BaseConfig
356
353
* The token name.
357
354
*
358
355
* @deprecated Use `Config\Security` $tokenName property instead of using this property.
359
- *
360
- * @var string
361
356
*/
362
- public $ CSRFTokenName = 'csrf_test_name ' ;
357
+ public string $ CSRFTokenName = 'csrf_test_name ' ;
363
358
364
359
/**
365
360
* --------------------------------------------------------------------------
@@ -369,10 +364,8 @@ class App extends BaseConfig
369
364
* The header name.
370
365
*
371
366
* @deprecated Use `Config\Security` $headerName property instead of using this property.
372
- *
373
- * @var string
374
367
*/
375
- public $ CSRFHeaderName = 'X-CSRF-TOKEN ' ;
368
+ public string $ CSRFHeaderName = 'X-CSRF-TOKEN ' ;
376
369
377
370
/**
378
371
* --------------------------------------------------------------------------
@@ -382,10 +375,8 @@ class App extends BaseConfig
382
375
* The cookie name.
383
376
*
384
377
* @deprecated Use `Config\Security` $cookieName property instead of using this property.
385
- *
386
- * @var string
387
378
*/
388
- public $ CSRFCookieName = 'csrf_cookie_name ' ;
379
+ public string $ CSRFCookieName = 'csrf_cookie_name ' ;
389
380
390
381
/**
391
382
* --------------------------------------------------------------------------
@@ -395,10 +386,8 @@ class App extends BaseConfig
395
386
* The number in seconds the token should expire.
396
387
*
397
388
* @deprecated Use `Config\Security` $expire property instead of using this property.
398
- *
399
- * @var int
400
389
*/
401
- public $ CSRFExpire = 7200 ;
390
+ public int $ CSRFExpire = 7200 ;
402
391
403
392
/**
404
393
* --------------------------------------------------------------------------
@@ -408,10 +397,8 @@ class App extends BaseConfig
408
397
* Regenerate token on every submission?
409
398
*
410
399
* @deprecated Use `Config\Security` $regenerate property instead of using this property.
411
- *
412
- * @var bool
413
400
*/
414
- public $ CSRFRegenerate = true ;
401
+ public bool $ CSRFRegenerate = true ;
415
402
416
403
/**
417
404
* --------------------------------------------------------------------------
@@ -421,10 +408,8 @@ class App extends BaseConfig
421
408
* Redirect to previous page with error on failure?
422
409
*
423
410
* @deprecated Use `Config\Security` $redirect property instead of using this property.
424
- *
425
- * @var bool
426
411
*/
427
- public $ CSRFRedirect = true ;
412
+ public bool $ CSRFRedirect = false ;
428
413
429
414
/**
430
415
* --------------------------------------------------------------------------
@@ -442,10 +427,8 @@ class App extends BaseConfig
442
427
* @see https://portswigger.net/web-security/csrf/samesite-cookies
443
428
*
444
429
* @deprecated `Config\Cookie` $samesite property is used.
445
- *
446
- * @var string
447
430
*/
448
- public $ CSRFSameSite = 'Lax ' ;
431
+ public string $ CSRFSameSite = 'Lax ' ;
449
432
450
433
/**
451
434
* --------------------------------------------------------------------------
@@ -462,8 +445,6 @@ class App extends BaseConfig
462
445
*
463
446
* @see http://www.html5rocks.com/en/tutorials/security/content-security-policy/
464
447
* @see http://www.w3.org/TR/CSP/
465
- *
466
- * @var bool
467
448
*/
468
- public $ CSPEnabled = false ;
449
+ public bool $ CSPEnabled = false ;
469
450
}
0 commit comments