Skip to content

Commit 715c91c

Browse files
authored
Merge pull request #164 from Extendy/mohd
feat: Upgrade ci from 4.4.8 to 4.6.3
2 parents 4c948dc + 96b3086 commit 715c91c

36 files changed

Lines changed: 6256 additions & 913 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ phpunit
8484
# Composer
8585
#-------------------------
8686
vendor/
87-
composer.lock
87+
8888

8989
#-------------------------
9090
# IDE / Development Files

app/Config/Autoload.php

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,17 @@ class Autoload extends AutoloadConfig
2828
* their location on the file system. These are used by the autoloader
2929
* to locate files the first time they have been instantiated.
3030
*
31-
* The '/app' and '/system' directories are already mapped for you.
32-
* you may change the name of the 'App' namespace if you wish,
31+
* The 'Config' (APPPATH . 'Config') and 'CodeIgniter' (SYSTEMPATH) are
32+
* already mapped for you.
33+
*
34+
* You may change the name of the 'App' namespace if you wish,
3335
* but this should be done prior to creating any namespaced classes,
3436
* else you will need to modify all of those classes for this to work.
3537
*
36-
* Prototype:
37-
* $psr4 = [
38-
* 'CodeIgniter' => SYSTEMPATH,
39-
* 'App' => APPPATH
40-
* ];
41-
*
42-
* @var array<string, array<int, string>|string>
43-
* @phpstan-var array<string, string|list<string>>
38+
* @var array<string, list<string>|string>
4439
*/
4540
public $psr4 = [
46-
APP_NAMESPACE => APPPATH, // For custom app namespace
47-
'Config' => APPPATH . 'Config',
41+
APP_NAMESPACE => APPPATH,
4842
];
4943

5044
/**
@@ -79,8 +73,7 @@ class Autoload extends AutoloadConfig
7973
* '/path/to/my/file.php',
8074
* ];
8175
*
82-
* @var list<string>
83-
* @phpstan-var list<string>
76+
* @var list<string>
8477
*/
8578
public $files = [];
8679

@@ -93,8 +86,7 @@ class Autoload extends AutoloadConfig
9386
* 'form',
9487
* ];
9588
*
96-
* @var list<string>
97-
* @phpstan-var list<string>
89+
* @var list<string>
9890
*/
9991
public $helpers = ['smarty', 'cookie', 'auth', 'setting'];
10092
}

app/Config/Boot/production.php

Lines changed: 3 additions & 1 deletion
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

Lines changed: 26 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -34,37 +34,6 @@ class Cache extends BaseConfig
3434
*/
3535
public string $backupHandler = 'dummy';
3636

37-
/**
38-
* --------------------------------------------------------------------------
39-
* Cache Directory Path
40-
* --------------------------------------------------------------------------
41-
*
42-
* The path to where cache files should be stored, if using a file-based
43-
* system.
44-
*
45-
* @deprecated Use the driver-specific variant under $file
46-
*/
47-
public string $storePath = WRITEPATH . 'cache/';
48-
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-
6837
/**
6938
* --------------------------------------------------------------------------
7039
* Key Prefix
@@ -105,10 +74,11 @@ class Cache extends BaseConfig
10574
* --------------------------------------------------------------------------
10675
* File settings
10776
* --------------------------------------------------------------------------
77+
*
10878
* Your file storage preferences can be specified below, if you are using
10979
* the File driver.
11080
*
111-
* @var array<string, int|string|null>
81+
* @var array{storePath?: string, mode?: int}
11282
*/
11383
public array $file = [
11484
'storePath' => WRITEPATH . 'cache/',
@@ -119,12 +89,13 @@ class Cache extends BaseConfig
11989
* -------------------------------------------------------------------------
12090
* Memcached settings
12191
* -------------------------------------------------------------------------
92+
*
12293
* Your Memcached servers can be specified below, if you are using
12394
* the Memcached drivers.
12495
*
12596
* @see https://codeigniter.com/user_guide/libraries/caching.html#memcached
12697
*
127-
* @var array<string, bool|int|string>
98+
* @var array{host?: string, port?: int, weight?: int, raw?: bool}
12899
*/
129100
public array $memcached = [
130101
'host' => '127.0.0.1',
@@ -137,10 +108,11 @@ class Cache extends BaseConfig
137108
* -------------------------------------------------------------------------
138109
* Redis settings
139110
* -------------------------------------------------------------------------
111+
*
140112
* Your Redis server can be specified below, if you are using
141113
* the Redis or Predis drivers.
142114
*
143-
* @var array<string, int|string|null>
115+
* @var array{host?: string, password?: string|null, port?: int, timeout?: int, database?: int}
144116
*/
145117
public array $redis = [
146118
'host' => '127.0.0.1',
@@ -158,8 +130,7 @@ class Cache extends BaseConfig
158130
* This is an array of cache engine alias' and class names. Only engines
159131
* that are listed here are allowed to be used.
160132
*
161-
* @var array<string, string>
162-
* @phpstan-var array<string, class-string<CacheInterface>>
133+
* @var array<string, class-string<CacheInterface>>
163134
*/
164135
public array $validHandlers = [
165136
'dummy' => DummyHandler::class,
@@ -169,4 +140,23 @@ class Cache extends BaseConfig
169140
'redis' => RedisHandler::class,
170141
'wincache' => WincacheHandler::class,
171142
];
143+
144+
/**
145+
* --------------------------------------------------------------------------
146+
* Web Page Caching: Cache Include Query String
147+
* --------------------------------------------------------------------------
148+
*
149+
* Whether to take the URL query string into consideration when generating
150+
* output cache files. Valid options are:
151+
*
152+
* false = Disabled
153+
* true = Enabled, take all query parameters into account.
154+
* Please be aware that this may result in numerous cache
155+
* files generated for the same page over and over again.
156+
* ['q'] = Enabled, but only take into account the specified list
157+
* of query parameters.
158+
*
159+
* @var bool|list<string>
160+
*/
161+
public $cacheQueryString = false;
172162
}

app/Config/Cors.php

Lines changed: 105 additions & 0 deletions
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+
}

0 commit comments

Comments
 (0)