From c0343f916347d6685a465f5a476bb4f277371678 Mon Sep 17 00:00:00 2001 From: Markus Date: Wed, 10 Jun 2026 10:51:37 +0200 Subject: [PATCH] update Codeigniter 4.7.3 --- app/Config/CURLRequest.php | 16 ++++ app/Config/Cache.php | 52 +++++++++-- app/Config/ContentSecurityPolicy.php | 50 +++++++++- app/Config/Cookie.php | 2 +- app/Config/Database.php | 109 +++++++++++++++++++++- app/Config/Email.php | 12 ++- app/Config/Encryption.php | 17 ++++ app/Config/Events.php | 4 +- app/Config/Filters.php | 5 +- app/Config/Format.php | 9 ++ app/Config/Hostnames.php | 40 ++++++++ app/Config/Images.php | 2 + app/Config/Logger.php | 3 +- app/Config/Migrations.php | 15 +++ app/Config/Optimize.php | 2 + app/Config/Paths.php | 14 ++- app/Config/Routes.php | 4 +- app/Config/Routing.php | 9 ++ app/Config/Session.php | 1 + app/Config/Toolbar.php | 25 +++++ app/Config/UserAgents.php | 10 ++ app/Config/View.php | 27 ++++-- app/Config/WorkerMode.php | 62 ++++++++++++ app/Controllers/BaseController.php | 39 +++----- app/Views/errors/html/error_exception.php | 2 +- phpunit.xml.dist | 63 ------------- preload.php | 14 ++- public/index.php | 2 +- spark | 11 ++- 29 files changed, 488 insertions(+), 133 deletions(-) create mode 100644 app/Config/Hostnames.php create mode 100644 app/Config/WorkerMode.php delete mode 100644 phpunit.xml.dist diff --git a/app/Config/CURLRequest.php b/app/Config/CURLRequest.php index 5a3d4e9..bc5947f 100644 --- a/app/Config/CURLRequest.php +++ b/app/Config/CURLRequest.php @@ -6,6 +6,22 @@ use CodeIgniter\Config\BaseConfig; class CURLRequest extends BaseConfig { + /** + * -------------------------------------------------------------------------- + * CURLRequest Share Connection Options + * -------------------------------------------------------------------------- + * + * Share connection options between requests. + * + * @var list + * + * @see https://www.php.net/manual/en/curl.constants.php#constant.curl-lock-data-connect + */ + public array $shareConnectionOptions = [ + CURL_LOCK_DATA_CONNECT, + CURL_LOCK_DATA_DNS, + ]; + /** * -------------------------------------------------------------------------- * CURLRequest Share Options diff --git a/app/Config/Cache.php b/app/Config/Cache.php index e6efa3a..38ac541 100644 --- a/app/Config/Cache.php +++ b/app/Config/Cache.php @@ -3,6 +3,7 @@ namespace Config; use CodeIgniter\Cache\CacheInterface; +use CodeIgniter\Cache\Handlers\ApcuHandler; use CodeIgniter\Cache\Handlers\DummyHandler; use CodeIgniter\Cache\Handlers\FileHandler; use CodeIgniter\Cache\Handlers\MemcachedHandler; @@ -78,7 +79,7 @@ class Cache extends BaseConfig * Your file storage preferences can be specified below, if you are using * the File driver. * - * @var array + * @var array{storePath?: string, mode?: int} */ public array $file = [ 'storePath' => WRITEPATH . 'cache/', @@ -95,7 +96,7 @@ class Cache extends BaseConfig * * @see https://codeigniter.com/user_guide/libraries/caching.html#memcached * - * @var array + * @var array{host?: string, port?: int, weight?: int, raw?: bool} */ public array $memcached = [ 'host' => '127.0.0.1', @@ -112,14 +113,24 @@ class Cache extends BaseConfig * Your Redis server can be specified below, if you are using * the Redis or Predis drivers. * - * @var array + * @var array{ + * host?: string, + * password?: string|null, + * port?: int, + * timeout?: int, + * async?: bool, + * persistent?: bool, + * database?: int + * } */ public array $redis = [ - 'host' => '127.0.0.1', - 'password' => null, - 'port' => 6379, - 'timeout' => 0, - 'database' => 0, + 'host' => '127.0.0.1', + 'password' => null, + 'port' => 6379, + 'timeout' => 0, + 'async' => false, // specific to Predis and ignored by the native Redis extension + 'persistent' => false, + 'database' => 0, ]; /** @@ -133,6 +144,7 @@ class Cache extends BaseConfig * @var array> */ public array $validHandlers = [ + 'apcu' => ApcuHandler::class, 'dummy' => DummyHandler::class, 'file' => FileHandler::class, 'memcached' => MemcachedHandler::class, @@ -159,4 +171,28 @@ class Cache extends BaseConfig * @var bool|list */ public $cacheQueryString = false; + + /** + * -------------------------------------------------------------------------- + * Web Page Caching: Cache Status Codes + * -------------------------------------------------------------------------- + * + * HTTP status codes that are allowed to be cached. Only responses with + * these status codes will be cached by the PageCache filter. + * + * Default: [] - Cache all status codes (backward compatible) + * + * Recommended: [200] - Only cache successful responses + * + * You can also use status codes like: + * [200, 404, 410] - Cache successful responses and specific error codes + * [200, 201, 202, 203, 204] - All 2xx successful responses + * + * WARNING: Using [] may cache temporary error pages (404, 500, etc). + * Consider restricting to [200] for production applications to avoid + * caching errors that should be temporary. + * + * @var list + */ + public array $cacheStatusCodes = []; } diff --git a/app/Config/ContentSecurityPolicy.php b/app/Config/ContentSecurityPolicy.php index 2ac41a7..f64a9af 100644 --- a/app/Config/ContentSecurityPolicy.php +++ b/app/Config/ContentSecurityPolicy.php @@ -30,6 +30,11 @@ class ContentSecurityPolicy extends BaseConfig */ public ?string $reportURI = null; + /** + * Specifies a reporting endpoint to which violation reports ought to be sent. + */ + public ?string $reportTo = null; + /** * Instructs user agents to rewrite URL schemes, changing * HTTP to HTTPS. This directive is for websites with @@ -38,12 +43,12 @@ class ContentSecurityPolicy extends BaseConfig public bool $upgradeInsecureRequests = false; // ------------------------------------------------------------------------- - // Sources allowed + // CSP DIRECTIVES SETTINGS // NOTE: once you set a policy to 'none', it cannot be further restricted // ------------------------------------------------------------------------- /** - * Will default to self if not overridden + * Will default to `'self'` if not overridden * * @var list|string|null */ @@ -56,6 +61,21 @@ class ContentSecurityPolicy extends BaseConfig */ public $scriptSrc = 'self'; + /** + * Specifies valid sources for JavaScript