Skip to content

Commit ae7630b

Browse files
authored
Merge pull request #7851 from codeigniter4/4.4
Merge 4.4 into develop
2 parents bda1f59 + d3b10e7 commit ae7630b

File tree

268 files changed

+11420
-2636
lines changed

Some content is hidden

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

268 files changed

+11420
-2636
lines changed

.github/workflows/test-phpcpd.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@ jobs:
5454
--exclude system/Database/MySQLi/Builder.php
5555
--exclude system/Database/OCI8/Builder.php
5656
--exclude system/Database/Postgre/Builder.php
57+
--exclude system/Debug/Exceptions.php
58+
--exclude system/HTTP/SiteURI.php
5759
-- app/ public/ system/

admin/css/debug-toolbar/toolbar.scss

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
overflow: hidden;
199199
overflow-y: auto;
200200
padding: 0 12px 0 12px;
201-
201+
202202
// Give room for OS X scrollbar
203203
white-space: nowrap;
204204
z-index: 10000;
@@ -501,3 +501,13 @@
501501
.debug-bar-noverflow {
502502
overflow: hidden;
503503
}
504+
505+
/* ENDLESS ROTATE */
506+
.rotate {
507+
animation: rotate 9s linear infinite;
508+
}
509+
@keyframes rotate {
510+
to {
511+
transform: rotate(360deg);
512+
}
513+
}

app/Config/App.php

Lines changed: 0 additions & 271 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Config;
44

55
use CodeIgniter\Config\BaseConfig;
6-
use CodeIgniter\Session\Handlers\FileHandler;
76

87
class App extends BaseConfig
98
{
@@ -136,191 +135,6 @@ class App extends BaseConfig
136135
*/
137136
public bool $forceGlobalSecureRequests = false;
138137

139-
/**
140-
* --------------------------------------------------------------------------
141-
* Session Driver
142-
* --------------------------------------------------------------------------
143-
*
144-
* The session storage driver to use:
145-
* - `CodeIgniter\Session\Handlers\FileHandler`
146-
* - `CodeIgniter\Session\Handlers\DatabaseHandler`
147-
* - `CodeIgniter\Session\Handlers\MemcachedHandler`
148-
* - `CodeIgniter\Session\Handlers\RedisHandler`
149-
*
150-
* @deprecated use Config\Session::$driver instead.
151-
*/
152-
public string $sessionDriver = FileHandler::class;
153-
154-
/**
155-
* --------------------------------------------------------------------------
156-
* Session Cookie Name
157-
* --------------------------------------------------------------------------
158-
*
159-
* The session cookie name, must contain only [0-9a-z_-] characters
160-
*
161-
* @deprecated use Config\Session::$cookieName instead.
162-
*/
163-
public string $sessionCookieName = 'ci_session';
164-
165-
/**
166-
* --------------------------------------------------------------------------
167-
* Session Expiration
168-
* --------------------------------------------------------------------------
169-
*
170-
* The number of SECONDS you want the session to last.
171-
* Setting to 0 (zero) means expire when the browser is closed.
172-
*
173-
* @deprecated use Config\Session::$expiration instead.
174-
*/
175-
public int $sessionExpiration = 7200;
176-
177-
/**
178-
* --------------------------------------------------------------------------
179-
* Session Save Path
180-
* --------------------------------------------------------------------------
181-
*
182-
* The location to save sessions to and is driver dependent.
183-
*
184-
* For the 'files' driver, it's a path to a writable directory.
185-
* WARNING: Only absolute paths are supported!
186-
*
187-
* For the 'database' driver, it's a table name.
188-
* Please read up the manual for the format with other session drivers.
189-
*
190-
* IMPORTANT: You are REQUIRED to set a valid save path!
191-
*
192-
* @deprecated use Config\Session::$savePath instead.
193-
*/
194-
public string $sessionSavePath = WRITEPATH . 'session';
195-
196-
/**
197-
* --------------------------------------------------------------------------
198-
* Session Match IP
199-
* --------------------------------------------------------------------------
200-
*
201-
* Whether to match the user's IP address when reading the session data.
202-
*
203-
* WARNING: If you're using the database driver, don't forget to update
204-
* your session table's PRIMARY KEY when changing this setting.
205-
*
206-
* @deprecated use Config\Session::$matchIP instead.
207-
*/
208-
public bool $sessionMatchIP = false;
209-
210-
/**
211-
* --------------------------------------------------------------------------
212-
* Session Time to Update
213-
* --------------------------------------------------------------------------
214-
*
215-
* How many seconds between CI regenerating the session ID.
216-
*
217-
* @deprecated use Config\Session::$timeToUpdate instead.
218-
*/
219-
public int $sessionTimeToUpdate = 300;
220-
221-
/**
222-
* --------------------------------------------------------------------------
223-
* Session Regenerate Destroy
224-
* --------------------------------------------------------------------------
225-
*
226-
* Whether to destroy session data associated with the old session ID
227-
* when auto-regenerating the session ID. When set to FALSE, the data
228-
* will be later deleted by the garbage collector.
229-
*
230-
* @deprecated use Config\Session::$regenerateDestroy instead.
231-
*/
232-
public bool $sessionRegenerateDestroy = false;
233-
234-
/**
235-
* --------------------------------------------------------------------------
236-
* Session Database Group
237-
* --------------------------------------------------------------------------
238-
*
239-
* DB Group for the database session.
240-
*
241-
* @deprecated use Config\Session::$DBGroup instead.
242-
*/
243-
public ?string $sessionDBGroup = null;
244-
245-
/**
246-
* --------------------------------------------------------------------------
247-
* Cookie Prefix
248-
* --------------------------------------------------------------------------
249-
*
250-
* Set a cookie name prefix if you need to avoid collisions.
251-
*
252-
* @deprecated use Config\Cookie::$prefix property instead.
253-
*/
254-
public string $cookiePrefix = '';
255-
256-
/**
257-
* --------------------------------------------------------------------------
258-
* Cookie Domain
259-
* --------------------------------------------------------------------------
260-
*
261-
* Set to `.your-domain.com` for site-wide cookies.
262-
*
263-
* @deprecated use Config\Cookie::$domain property instead.
264-
*/
265-
public string $cookieDomain = '';
266-
267-
/**
268-
* --------------------------------------------------------------------------
269-
* Cookie Path
270-
* --------------------------------------------------------------------------
271-
*
272-
* Typically will be a forward slash.
273-
*
274-
* @deprecated use Config\Cookie::$path property instead.
275-
*/
276-
public string $cookiePath = '/';
277-
278-
/**
279-
* --------------------------------------------------------------------------
280-
* Cookie Secure
281-
* --------------------------------------------------------------------------
282-
*
283-
* Cookie will only be set if a secure HTTPS connection exists.
284-
*
285-
* @deprecated use Config\Cookie::$secure property instead.
286-
*/
287-
public bool $cookieSecure = false;
288-
289-
/**
290-
* --------------------------------------------------------------------------
291-
* Cookie HttpOnly
292-
* --------------------------------------------------------------------------
293-
*
294-
* Cookie will only be accessible via HTTP(S) (no JavaScript).
295-
*
296-
* @deprecated use Config\Cookie::$httponly property instead.
297-
*/
298-
public bool $cookieHTTPOnly = true;
299-
300-
/**
301-
* --------------------------------------------------------------------------
302-
* Cookie SameSite
303-
* --------------------------------------------------------------------------
304-
*
305-
* Configure cookie SameSite setting. Allowed values are:
306-
* - None
307-
* - Lax
308-
* - Strict
309-
* - ''
310-
*
311-
* Alternatively, you can use the constant names:
312-
* - `Cookie::SAMESITE_NONE`
313-
* - `Cookie::SAMESITE_LAX`
314-
* - `Cookie::SAMESITE_STRICT`
315-
*
316-
* Defaults to `Lax` for compatibility with modern browsers. Setting `''`
317-
* (empty string) means default SameSite attribute set by browsers (`Lax`)
318-
* will be set on cookies. If set to `None`, `$cookieSecure` must also be set.
319-
*
320-
* @deprecated use Config\Cookie::$samesite property instead.
321-
*/
322-
public ?string $cookieSameSite = 'Lax';
323-
324138
/**
325139
* --------------------------------------------------------------------------
326140
* Reverse Proxy IPs
@@ -344,91 +158,6 @@ class App extends BaseConfig
344158
*/
345159
public array $proxyIPs = [];
346160

347-
/**
348-
* --------------------------------------------------------------------------
349-
* CSRF Token Name
350-
* --------------------------------------------------------------------------
351-
*
352-
* The token name.
353-
*
354-
* @deprecated Use `Config\Security` $tokenName property instead of using this property.
355-
*/
356-
public string $CSRFTokenName = 'csrf_test_name';
357-
358-
/**
359-
* --------------------------------------------------------------------------
360-
* CSRF Header Name
361-
* --------------------------------------------------------------------------
362-
*
363-
* The header name.
364-
*
365-
* @deprecated Use `Config\Security` $headerName property instead of using this property.
366-
*/
367-
public string $CSRFHeaderName = 'X-CSRF-TOKEN';
368-
369-
/**
370-
* --------------------------------------------------------------------------
371-
* CSRF Cookie Name
372-
* --------------------------------------------------------------------------
373-
*
374-
* The cookie name.
375-
*
376-
* @deprecated Use `Config\Security` $cookieName property instead of using this property.
377-
*/
378-
public string $CSRFCookieName = 'csrf_cookie_name';
379-
380-
/**
381-
* --------------------------------------------------------------------------
382-
* CSRF Expire
383-
* --------------------------------------------------------------------------
384-
*
385-
* The number in seconds the token should expire.
386-
*
387-
* @deprecated Use `Config\Security` $expire property instead of using this property.
388-
*/
389-
public int $CSRFExpire = 7200;
390-
391-
/**
392-
* --------------------------------------------------------------------------
393-
* CSRF Regenerate
394-
* --------------------------------------------------------------------------
395-
*
396-
* Regenerate token on every submission?
397-
*
398-
* @deprecated Use `Config\Security` $regenerate property instead of using this property.
399-
*/
400-
public bool $CSRFRegenerate = true;
401-
402-
/**
403-
* --------------------------------------------------------------------------
404-
* CSRF Redirect
405-
* --------------------------------------------------------------------------
406-
*
407-
* Redirect to previous page with error on failure?
408-
*
409-
* @deprecated Use `Config\Security` $redirect property instead of using this property.
410-
*/
411-
public bool $CSRFRedirect = false;
412-
413-
/**
414-
* --------------------------------------------------------------------------
415-
* CSRF SameSite
416-
* --------------------------------------------------------------------------
417-
*
418-
* Setting for CSRF SameSite cookie token. Allowed values are:
419-
* - None
420-
* - Lax
421-
* - Strict
422-
* - ''
423-
*
424-
* Defaults to `Lax` as recommended in this link:
425-
*
426-
* @see https://portswigger.net/web-security/csrf/samesite-cookies
427-
*
428-
* @deprecated `Config\Cookie` $samesite property is used.
429-
*/
430-
public string $CSRFSameSite = 'Lax';
431-
432161
/**
433162
* --------------------------------------------------------------------------
434163
* Content Security Policy

app/Config/CURLRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ class CURLRequest extends BaseConfig
1616
* If true, all the options won't be reset between requests.
1717
* It may cause an error request with unnecessary headers.
1818
*/
19-
public bool $shareOptions = true;
19+
public bool $shareOptions = false;
2020
}

app/Config/Cookie.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ class Cookie extends BaseConfig
8484
* Defaults to `Lax` for compatibility with modern browsers. Setting `''`
8585
* (empty string) means default SameSite attribute set by browsers (`Lax`)
8686
* will be set on cookies. If set to `None`, `$secure` must also be set.
87+
*
88+
* @phpstan-var 'None'|'Lax'|'Strict'|''
8789
*/
8890
public string $samesite = 'Lax';
8991

app/Config/Database.php

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,24 @@ class Database extends Config
2525
* The default database connection.
2626
*/
2727
public array $default = [
28-
'DSN' => '',
29-
'hostname' => 'localhost',
30-
'username' => '',
31-
'password' => '',
32-
'database' => '',
33-
'DBDriver' => 'MySQLi',
34-
'DBPrefix' => '',
35-
'pConnect' => false,
36-
'DBDebug' => true,
37-
'charset' => 'utf8',
38-
'DBCollat' => 'utf8_general_ci',
39-
'swapPre' => '',
40-
'encrypt' => false,
41-
'compress' => false,
42-
'strictOn' => false,
43-
'failover' => [],
44-
'port' => 3306,
28+
'DSN' => '',
29+
'hostname' => 'localhost',
30+
'username' => '',
31+
'password' => '',
32+
'database' => '',
33+
'DBDriver' => 'MySQLi',
34+
'DBPrefix' => '',
35+
'pConnect' => false,
36+
'DBDebug' => true,
37+
'charset' => 'utf8',
38+
'DBCollat' => 'utf8_general_ci',
39+
'swapPre' => '',
40+
'encrypt' => false,
41+
'compress' => false,
42+
'strictOn' => false,
43+
'failover' => [],
44+
'port' => 3306,
45+
'numberNative' => false,
4546
];
4647

4748
/**

app/Config/Events.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use CodeIgniter\Events\Events;
66
use CodeIgniter\Exceptions\FrameworkException;
7+
use CodeIgniter\HotReloader\HotReloader;
78

89
/*
910
* --------------------------------------------------------------------
@@ -44,5 +45,11 @@
4445
if (CI_DEBUG && ! is_cli()) {
4546
Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect');
4647
Services::toolbar()->respond();
48+
// Hot Reload route - for framework use on the hot reloader.
49+
if (ENVIRONMENT === 'development') {
50+
Services::routes()->get('__hot-reload', static function () {
51+
(new HotReloader())->run();
52+
});
53+
}
4754
}
4855
});

0 commit comments

Comments
 (0)