From 08336b6a5da2f70bff9f9b3d0771072bf054e944 Mon Sep 17 00:00:00 2001 From: MGatner Date: Thu, 13 May 2021 21:07:18 +0000 Subject: [PATCH] Patch to framework latest --- app/Config/App.php | 686 ++++++++++++++-------- app/Config/Autoload.php | 34 +- app/Config/Cache.php | 16 + app/Config/ContentSecurityPolicy.php | 169 +++++- app/Config/Cookie.php | 119 ++++ app/Config/Events.php | 6 +- app/Config/Exceptions.php | 72 ++- app/Config/Generators.php | 39 ++ app/Config/Logger.php | 171 +++--- app/Config/Mimes.php | 30 +- app/Config/Modules.php | 60 +- app/Config/Security.php | 95 +++ app/Config/Services.php | 25 +- app/Controllers/BaseController.php | 15 +- app/Controllers/Home.php | 4 +- app/Views/errors/cli/error_404.php | 1 + app/Views/errors/cli/error_exception.php | 81 ++- app/Views/errors/html/debug.css | 210 ++++--- app/Views/errors/html/error_404.php | 126 ++-- app/Views/errors/html/error_exception.php | 99 ++-- composer.lock | 148 ++++- env | 50 +- public/index.php | 8 - spark | 21 +- 24 files changed, 1596 insertions(+), 689 deletions(-) create mode 100644 app/Config/Cookie.php create mode 100644 app/Config/Generators.php create mode 100644 app/Config/Security.php diff --git a/app/Config/App.php b/app/Config/App.php index 71aa2db..a179f6a 100644 --- a/app/Config/App.php +++ b/app/Config/App.php @@ -1,282 +1,480 @@ - SYSTEMPATH, * 'App' => APPPATH * ]; - * - * @var array + *``` + * @var array */ public $psr4 = [ APP_NAMESPACE => APPPATH, // For custom app namespace @@ -55,12 +55,30 @@ class Autoload extends AutoloadConfig * were being autoloaded through a namespace. * * Prototype: - * + *``` * $classmap = [ * 'MyClass' => '/path/to/class/file.php' * ]; - * - * @var array + *``` + * @var array */ public $classmap = []; + + /** + * ------------------------------------------------------------------- + * Files + * ------------------------------------------------------------------- + * The files array provides a list of paths to __non-class__ files + * that will be autoloaded. This can be useful for bootstrap operations + * or for loading functions. + * + * Prototype: + * ``` + * $files = [ + * '/path/to/my/file.php', + * ]; + * ``` + * @var array + */ + public $files = []; } diff --git a/app/Config/Cache.php b/app/Config/Cache.php index 8c7900a..a3b3bbc 100644 --- a/app/Config/Cache.php +++ b/app/Config/Cache.php @@ -46,6 +46,8 @@ class Cache extends BaseConfig * system. * * @var string + * + * @deprecated Use the driver-specific variant under $file */ public $storePath = WRITEPATH . 'cache/'; @@ -80,6 +82,20 @@ class Cache extends BaseConfig */ public $prefix = ''; + /** + * -------------------------------------------------------------------------- + * File settings + * -------------------------------------------------------------------------- + * Your file storage preferences can be specified below, if you are using + * the File driver. + * + * @var array + */ + public $file = [ + 'storePath' => WRITEPATH . 'cache/', + 'mode' => 0640, + ]; + /** * ------------------------------------------------------------------------- * Memcached settings diff --git a/app/Config/ContentSecurityPolicy.php b/app/Config/ContentSecurityPolicy.php index 0e6955a..a04e3d0 100644 --- a/app/Config/ContentSecurityPolicy.php +++ b/app/Config/ContentSecurityPolicy.php @@ -1,48 +1,167 @@ -` element. + * + * Will default to self if not overridden + * + * @var string|string[]|null + */ + public $baseURI = null; - public $defaultSrc = null; // will default to self if not over-ridden - public $scriptSrc = 'self'; - public $styleSrc = 'self'; - public $imageSrc = 'self'; - public $baseURI = null; // will default to self if not over-ridden - public $childSrc = 'self'; - public $connectSrc = 'self'; - public $fontSrc = null; - public $formAction = 'self'; + /** + * Lists the URLs for workers and embedded frame contents + * + * @var string|string[] + */ + public $childSrc = 'self'; + + /** + * Limits the origins that you can connect to (via XHR, + * WebSockets, and EventSource). + * + * @var string|string[] + */ + public $connectSrc = 'self'; + + /** + * Specifies the origins that can serve web fonts. + * + * @var string|string[] + */ + public $fontSrc = null; + + /** + * Lists valid endpoints for submission from `
` tags. + * + * @var string|string[] + */ + public $formAction = 'self'; + + /** + * Specifies the sources that can embed the current page. + * This directive applies to ``, `