diff --git a/.gitignore b/.gitignore
index 4b054e4..87e86b9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,126 @@
-/*
-!app/
-!public/
-!.gitignore
\ No newline at end of file
+#-------------------------
+# Operating Specific Junk Files
+#-------------------------
+
+# OS X
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# OS X Thumbnails
+._*
+
+# Windows image file caches
+Thumbs.db
+ehthumbs.db
+Desktop.ini
+
+# Recycle Bin used on file shares
+$RECYCLE.BIN/
+
+# Windows Installer files
+*.cab
+*.msi
+*.msm
+*.msp
+
+# Windows shortcuts
+*.lnk
+
+# Linux
+*~
+
+# KDE directory preferences
+.directory
+
+# Linux trash folder which might appear on any partition or disk
+.Trash-*
+
+#-------------------------
+# Environment Files
+#-------------------------
+# These should never be under version control,
+# as it poses a security risk.
+.env
+.vagrant
+Vagrantfile
+
+#-------------------------
+# Temporary Files
+#-------------------------
+writable/cache/*
+!writable/cache/index.html
+
+writable/logs/*
+!writable/logs/index.html
+
+writable/session/*
+!writable/session/index.html
+
+writable/uploads/*
+!writable/uploads/index.html
+
+writable/debugbar/*
+!writable/debugbar/index.html
+
+php_errors.log
+
+#-------------------------
+# User Guide Temp Files
+#-------------------------
+user_guide_src/build/*
+user_guide_src/cilexer/build/*
+user_guide_src/cilexer/dist/*
+user_guide_src/cilexer/pycilexer.egg-info/*
+
+#-------------------------
+# Test Files
+#-------------------------
+tests/coverage*
+
+# Don't save phpunit under version control.
+phpunit
+
+#-------------------------
+# Composer
+#-------------------------
+vendor/
+
+#-------------------------
+# IDE / Development Files
+#-------------------------
+
+# Modules Testing
+_modules/*
+
+# phpenv local config
+.php-version
+
+# Jetbrains editors (PHPStorm, etc)
+.idea/
+*.iml
+
+# NetBeans
+/nbproject/
+/build/
+/nbbuild/
+/dist/
+/nbdist/
+/nbactions.xml
+/nb-configuration.xml
+/.nb-gradle/
+
+# Sublime Text
+*.tmlanguage.cache
+*.tmPreferences.cache
+*.stTheme.cache
+*.sublime-workspace
+*.sublime-project
+.phpintel
+/api/
+
+# Visual Studio Code
+.vscode/
+
+/results/
+/phpunit*.xml
diff --git a/public/assets/tinymce/TinyMCE-version-6.6.2/license.txt b/LICENSE
similarity index 80%
rename from public/assets/tinymce/TinyMCE-version-6.6.2/license.txt
rename to LICENSE
index 3a49f66..24728f6 100644
--- a/public/assets/tinymce/TinyMCE-version-6.6.2/license.txt
+++ b/LICENSE
@@ -1,6 +1,7 @@
-MIT License
+The MIT License (MIT)
-Copyright (c) 2022 Ephox Corporation DBA Tiny Technologies, Inc.
+Copyright (c) 2014-2019 British Columbia Institute of Technology
+Copyright (c) 2019-present CodeIgniter Foundation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +10,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..d14b4c9
--- /dev/null
+++ b/README.md
@@ -0,0 +1,68 @@
+# CodeIgniter 4 Application Starter
+
+## What is CodeIgniter?
+
+CodeIgniter is a PHP full-stack web framework that is light, fast, flexible and secure.
+More information can be found at the [official site](https://codeigniter.com).
+
+This repository holds a composer-installable app starter.
+It has been built from the
+[development repository](https://github.com/codeigniter4/CodeIgniter4).
+
+More information about the plans for version 4 can be found in [CodeIgniter 4](https://forum.codeigniter.com/forumdisplay.php?fid=28) on the forums.
+
+You can read the [user guide](https://codeigniter.com/user_guide/)
+corresponding to the latest version of the framework.
+
+## Installation & updates
+
+`composer create-project codeigniter4/appstarter` then `composer update` whenever
+there is a new release of the framework.
+
+When updating, check the release notes to see if there are any changes you might need to apply
+to your `app` folder. The affected files can be copied or merged from
+`vendor/codeigniter4/framework/app`.
+
+## Setup
+
+Copy `env` to `.env` and tailor for your app, specifically the baseURL
+and any database settings.
+
+## Important Change with index.php
+
+`index.php` is no longer in the root of the project! It has been moved inside the *public* folder,
+for better security and separation of components.
+
+This means that you should configure your web server to "point" to your project's *public* folder, and
+not to the project root. A better practice would be to configure a virtual host to point there. A poor practice would be to point your web server to the project root and expect to enter *public/...*, as the rest of your logic and the
+framework are exposed.
+
+**Please** read the user guide for a better explanation of how CI4 works!
+
+## Repository Management
+
+We use GitHub issues, in our main repository, to track **BUGS** and to track approved **DEVELOPMENT** work packages.
+We use our [forum](http://forum.codeigniter.com) to provide SUPPORT and to discuss
+FEATURE REQUESTS.
+
+This repository is a "distribution" one, built by our release preparation script.
+Problems with it can be raised on our forum, or as issues in the main repository.
+
+## Server Requirements
+
+PHP version 8.1 or higher is required, with the following extensions installed:
+
+- [intl](http://php.net/manual/en/intl.requirements.php)
+- [mbstring](http://php.net/manual/en/mbstring.installation.php)
+
+> [!WARNING]
+> - The end of life date for PHP 7.4 was November 28, 2022.
+> - The end of life date for PHP 8.0 was November 26, 2023.
+> - If you are still using PHP 7.4 or 8.0, you should upgrade immediately.
+> - The end of life date for PHP 8.1 will be December 31, 2025.
+
+Additionally, make sure that the following extensions are enabled in your PHP:
+
+- json (enabled by default - don't turn it off)
+- [mysqlnd](http://php.net/manual/en/mysqlnd.install.php) if you plan to use MySQL
+- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\CURLRequest library
diff --git a/app/.htaccess b/app/.htaccess
index f24db0a..3462048 100644
--- a/app/.htaccess
+++ b/app/.htaccess
@@ -1,6 +1,6 @@
- Require all denied
+ Require all denied
- Deny from all
+ Deny from all
diff --git a/app/Common.php b/app/Common.php
index a74d46d..95f5544 100644
--- a/app/Common.php
+++ b/app/Common.php
@@ -4,12 +4,12 @@
* The goal of this file is to allow developers a location
* where they can overwrite core procedural functions and
* replace them with their own. This file is loaded during
- * the bootstrap process and is called during the frameworks
+ * the bootstrap process and is called during the framework's
* execution.
*
* This can be looked at as a `master helper` file that is
* loaded early on, and may also contain additional functions
* that you'd like to use throughout your entire application
*
- * @see: https://codeigniter4.github.io/CodeIgniter4/
+ * @see: https://codeigniter.com/user_guide/extending/common.html
*/
diff --git a/app/Config/App.php b/app/Config/App.php
index bb7efef..b761da7 100644
--- a/app/Config/App.php
+++ b/app/Config/App.php
@@ -3,7 +3,6 @@
namespace Config;
use CodeIgniter\Config\BaseConfig;
-use CodeIgniter\Session\Handlers\FileHandler;
class App extends BaseConfig
{
@@ -12,34 +11,36 @@ class App extends BaseConfig
* Base Site URL
* --------------------------------------------------------------------------
*
- * URL to your CodeIgniter root. Typically this will be your base URL,
+ * URL to your CodeIgniter root. Typically, this will be your base URL,
* WITH a trailing slash:
*
- * http://example.com/
- *
- * If this is not set then CodeIgniter will try guess the protocol, domain
- * and path to your installation. However, you should always configure this
- * explicitly and never rely on auto-guessing, especially in production
- * environments.
- *
- * @var string
+ * E.g., http://example.com/
*/
- //public $baseURL = 'http://localhost:8080/';
- public $baseURL = '';
+ public string $baseURL = 'http://localhost:8080/';
+
+ /**
+ * Allowed Hostnames in the Site URL other than the hostname in the baseURL.
+ * If you want to accept multiple Hostnames, set this.
+ *
+ * E.g.,
+ * When your site URL ($baseURL) is 'http://example.com/', and your site
+ * also accepts 'http://media.example.com/' and 'http://accounts.example.com/':
+ * ['media.example.com', 'accounts.example.com']
+ *
+ * @var list
+ */
+ public array $allowedHostnames = [];
/**
* --------------------------------------------------------------------------
* Index File
* --------------------------------------------------------------------------
*
- * Typically this will be your index.php file, unless you've renamed it to
- * something else. If you are using mod_rewrite to remove the page set this
- * variable so that it is blank.
- *
- * @var string
+ * Typically, this will be your `index.php` file, unless you've renamed it to
+ * something else. If you have configured your web server to remove this file
+ * from your site URIs, set this variable to an empty string.
*/
- //public $indexPage = 'index.php';
- public $indexPage = '';
+ public string $indexPage = 'index.php';
/**
* --------------------------------------------------------------------------
@@ -47,18 +48,40 @@ class App extends BaseConfig
* --------------------------------------------------------------------------
*
* This item determines which server global should be used to retrieve the
- * URI string. The default setting of 'REQUEST_URI' works for most servers.
+ * URI string. The default setting of 'REQUEST_URI' works for most servers.
* If your links do not seem to work, try one of the other delicious flavors:
*
- * 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
- * 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
- * 'PATH_INFO' Uses $_SERVER['PATH_INFO']
+ * 'REQUEST_URI': Uses $_SERVER['REQUEST_URI']
+ * 'QUERY_STRING': Uses $_SERVER['QUERY_STRING']
+ * 'PATH_INFO': Uses $_SERVER['PATH_INFO']
*
* WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
- *
- * @var string
*/
- public $uriProtocol = 'REQUEST_URI';
+ public string $uriProtocol = 'REQUEST_URI';
+
+ /*
+ |--------------------------------------------------------------------------
+ | Allowed URL Characters
+ |--------------------------------------------------------------------------
+ |
+ | This lets you specify which characters are permitted within your URLs.
+ | When someone tries to submit a URL with disallowed characters they will
+ | get a warning message.
+ |
+ | As a security measure you are STRONGLY encouraged to restrict URLs to
+ | as few characters as possible.
+ |
+ | By default, only these are allowed: `a-z 0-9~%.:_-`
+ |
+ | Set an empty string to allow all characters -- but only if you are insane.
+ |
+ | The configured value is actually a regular expression character group
+ | and it will be used as: '/\A[]+\z/iu'
+ |
+ | DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
+ |
+ */
+ public string $permittedURIChars = 'a-z 0-9~%.:_\-';
/**
* --------------------------------------------------------------------------
@@ -69,10 +92,8 @@ class App extends BaseConfig
* is viewing the site from. It affects the language strings and other
* strings (like currency markers, numbers, etc), that your program
* should run under for this request.
- *
- * @var string
*/
- public $defaultLocale = 'en';
+ public string $defaultLocale = 'en';
/**
* --------------------------------------------------------------------------
@@ -83,10 +104,8 @@ class App extends BaseConfig
* language to use based on the value of the Accept-Language header.
*
* If false, no automatic detection will be performed.
- *
- * @var bool
*/
- public $negotiateLocale = false;
+ public bool $negotiateLocale = false;
/**
* --------------------------------------------------------------------------
@@ -97,9 +116,11 @@ class App extends BaseConfig
* by the application in descending order of priority. If no match is
* found, the first locale will be used.
*
- * @var string[]
+ * IncomingRequest::setLocale() also uses this list.
+ *
+ * @var list
*/
- public $supportedLocales = ['en'];
+ public array $supportedLocales = ['en'];
/**
* --------------------------------------------------------------------------
@@ -109,9 +130,10 @@ class App extends BaseConfig
* The default timezone that will be used in your application to display
* dates with the date helper, and can be retrieved through app_timezone()
*
- * @var string
+ * @see https://www.php.net/manual/en/timezones.php for list of timezones
+ * supported by PHP.
*/
- public $appTimezone = 'Asia/Jakarta';
+ public string $appTimezone = 'UTC';
/**
* --------------------------------------------------------------------------
@@ -122,211 +144,20 @@ class App extends BaseConfig
* that require a character set to be provided.
*
* @see http://php.net/htmlspecialchars for a list of supported charsets.
- *
- * @var string
*/
- public $charset = 'UTF-8';
+ public string $charset = 'UTF-8';
/**
* --------------------------------------------------------------------------
- * URI PROTOCOL
+ * Force Global Secure Requests
* --------------------------------------------------------------------------
*
* If true, this will force every request made to this application to be
* made via a secure connection (HTTPS). If the incoming request is not
* secure, the user will be redirected to a secure version of the page
- * and the HTTP Strict Transport Security header will be set.
- *
- * @var bool
+ * and the HTTP Strict Transport Security (HSTS) header will be set.
*/
- public $forceGlobalSecureRequests = false;
-
- /**
- * --------------------------------------------------------------------------
- * Session Driver
- * --------------------------------------------------------------------------
- *
- * The session storage driver to use:
- * - `CodeIgniter\Session\Handlers\FileHandler`
- * - `CodeIgniter\Session\Handlers\DatabaseHandler`
- * - `CodeIgniter\Session\Handlers\MemcachedHandler`
- * - `CodeIgniter\Session\Handlers\RedisHandler`
- *
- * @var string
- */
- public $sessionDriver = FileHandler::class;
-
- /**
- * --------------------------------------------------------------------------
- * Session Cookie Name
- * --------------------------------------------------------------------------
- *
- * The session cookie name, must contain only [0-9a-z_-] characters
- *
- * @var string
- */
- public $sessionCookieName = 'ci_session';
-
- /**
- * --------------------------------------------------------------------------
- * Session Expiration
- * --------------------------------------------------------------------------
- *
- * The number of SECONDS you want the session to last.
- * Setting to 0 (zero) means expire when the browser is closed.
- *
- * @var int
- */
- //public $sessionExpiration = 7200;
- public $sessionExpiration = 7200;
-
- /**
- * --------------------------------------------------------------------------
- * Session Save Path
- * --------------------------------------------------------------------------
- *
- * The location to save sessions to and is driver dependent.
- *
- * For the 'files' driver, it's a path to a writable directory.
- * WARNING: Only absolute paths are supported!
- *
- * For the 'database' driver, it's a table name.
- * Please read up the manual for the format with other session drivers.
- *
- * IMPORTANT: You are REQUIRED to set a valid save path!
- *
- * @var string
- */
- public $sessionSavePath = WRITEPATH . 'session';
-
- /**
- * --------------------------------------------------------------------------
- * Session Match IP
- * --------------------------------------------------------------------------
- *
- * Whether to match the user's IP address when reading the session data.
- *
- * WARNING: If you're using the database driver, don't forget to update
- * your session table's PRIMARY KEY when changing this setting.
- *
- * @var bool
- */
- public $sessionMatchIP = false;
-
- /**
- * --------------------------------------------------------------------------
- * Session Time to Update
- * --------------------------------------------------------------------------
- *
- * How many seconds between CI regenerating the session ID.
- *
- * @var int
- */
- public $sessionTimeToUpdate = 300;
-
- /**
- * --------------------------------------------------------------------------
- * Session Regenerate Destroy
- * --------------------------------------------------------------------------
- *
- * Whether to destroy session data associated with the old session ID
- * when auto-regenerating the session ID. When set to FALSE, the data
- * will be later deleted by the garbage collector.
- *
- * @var bool
- */
- public $sessionRegenerateDestroy = false;
-
- /**
- * --------------------------------------------------------------------------
- * Cookie Prefix
- * --------------------------------------------------------------------------
- *
- * Set a cookie name prefix if you need to avoid collisions.
- *
- * @var string
- *
- * @deprecated use Config\Cookie::$prefix property instead.
- */
- public $cookiePrefix = '';
-
- /**
- * --------------------------------------------------------------------------
- * Cookie Domain
- * --------------------------------------------------------------------------
- *
- * Set to `.your-domain.com` for site-wide cookies.
- *
- * @var string
- *
- * @deprecated use Config\Cookie::$domain property instead.
- */
- public $cookieDomain = '';
-
- /**
- * --------------------------------------------------------------------------
- * Cookie Path
- * --------------------------------------------------------------------------
- *
- * Typically will be a forward slash.
- *
- * @var string
- *
- * @deprecated use Config\Cookie::$path property instead.
- */
- public $cookiePath = '/';
-
- /**
- * --------------------------------------------------------------------------
- * Cookie Secure
- * --------------------------------------------------------------------------
- *
- * Cookie will only be set if a secure HTTPS connection exists.
- *
- * @var bool
- *
- * @deprecated use Config\Cookie::$secure property instead.
- */
- public $cookieSecure = false;
-
- /**
- * --------------------------------------------------------------------------
- * Cookie HttpOnly
- * --------------------------------------------------------------------------
- *
- * Cookie will only be accessible via HTTP(S) (no JavaScript).
- *
- * @var bool
- *
- * @deprecated use Config\Cookie::$httponly property instead.
- */
- public $cookieHTTPOnly = true;
-
- /**
- * --------------------------------------------------------------------------
- * Cookie SameSite
- * --------------------------------------------------------------------------
- *
- * Configure cookie SameSite setting. Allowed values are:
- * - None
- * - Lax
- * - Strict
- * - ''
- *
- * Alternatively, you can use the constant names:
- * - `Cookie::SAMESITE_NONE`
- * - `Cookie::SAMESITE_LAX`
- * - `Cookie::SAMESITE_STRICT`
- *
- * Defaults to `Lax` for compatibility with modern browsers. Setting `''`
- * (empty string) means default SameSite attribute set by browsers (`Lax`)
- * will be set on cookies. If set to `None`, `$cookieSecure` must also be set.
- *
- * @var string|null
- *
- * @deprecated use Config\Cookie::$samesite property instead.
- */
- public $cookieSameSite = 'Lax';
+ public bool $forceGlobalSecureRequests = false;
/**
* --------------------------------------------------------------------------
@@ -335,117 +166,21 @@ class App extends BaseConfig
*
* If your server is behind a reverse proxy, you must whitelist the proxy
* IP addresses from which CodeIgniter should trust headers such as
- * HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify
+ * X-Forwarded-For or Client-IP in order to properly identify
* the visitor's IP address.
*
- * You can use both an array or a comma-separated list of proxy addresses,
- * as well as specifying whole subnets. Here are a few examples:
+ * You need to set a proxy IP address or IP address with subnets and
+ * the HTTP header for the client IP address.
*
- * Comma-separated: '10.0.1.200,192.168.5.0/24'
- * Array: ['10.0.1.200', '192.168.5.0/24']
+ * Here are some examples:
+ * [
+ * '10.0.1.200' => 'X-Forwarded-For',
+ * '192.168.5.0/24' => 'X-Real-IP',
+ * ]
*
- * @var string|string[]
+ * @var array
*/
- public $proxyIPs = '';
-
- /**
- * --------------------------------------------------------------------------
- * CSRF Token Name
- * --------------------------------------------------------------------------
- *
- * The token name.
- *
- * @deprecated Use `Config\Security` $tokenName property instead of using this property.
- *
- * @var string
- */
- public $CSRFTokenName = 'csrf_test_name';
-
- /**
- * --------------------------------------------------------------------------
- * CSRF Header Name
- * --------------------------------------------------------------------------
- *
- * The header name.
- *
- * @deprecated Use `Config\Security` $headerName property instead of using this property.
- *
- * @var string
- */
- public $CSRFHeaderName = 'X-CSRF-TOKEN';
-
- /**
- * --------------------------------------------------------------------------
- * CSRF Cookie Name
- * --------------------------------------------------------------------------
- *
- * The cookie name.
- *
- * @deprecated Use `Config\Security` $cookieName property instead of using this property.
- *
- * @var string
- */
- public $CSRFCookieName = 'csrf_cookie_name';
-
- /**
- * --------------------------------------------------------------------------
- * CSRF Expire
- * --------------------------------------------------------------------------
- *
- * The number in seconds the token should expire.
- *
- * @deprecated Use `Config\Security` $expire property instead of using this property.
- *
- * @var int
- */
- public $CSRFExpire = 7200;
-
- /**
- * --------------------------------------------------------------------------
- * CSRF Regenerate
- * --------------------------------------------------------------------------
- *
- * Regenerate token on every submission?
- *
- * @deprecated Use `Config\Security` $regenerate property instead of using this property.
- *
- * @var bool
- */
- public $CSRFRegenerate = true;
-
- /**
- * --------------------------------------------------------------------------
- * CSRF Redirect
- * --------------------------------------------------------------------------
- *
- * Redirect to previous page with error on failure?
- *
- * @deprecated Use `Config\Security` $redirect property instead of using this property.
- *
- * @var bool
- */
- public $CSRFRedirect = true;
-
- /**
- * --------------------------------------------------------------------------
- * CSRF SameSite
- * --------------------------------------------------------------------------
- *
- * Setting for CSRF SameSite cookie token. Allowed values are:
- * - None
- * - Lax
- * - Strict
- * - ''
- *
- * Defaults to `Lax` as recommended in this link:
- *
- * @see https://portswigger.net/web-security/csrf/samesite-cookies
- *
- * @deprecated `Config\Cookie` $samesite property is used.
- *
- * @var string
- */
- public $CSRFSameSite = 'Lax';
+ public array $proxyIPs = [];
/**
* --------------------------------------------------------------------------
@@ -462,8 +197,6 @@ class App extends BaseConfig
*
* @see http://www.html5rocks.com/en/tutorials/security/content-security-policy/
* @see http://www.w3.org/TR/CSP/
- *
- * @var bool
*/
- public $CSPEnabled = false;
+ public bool $CSPEnabled = false;
}
diff --git a/app/Config/Autoload.php b/app/Config/Autoload.php
index ee27e3b..9a92824 100644
--- a/app/Config/Autoload.php
+++ b/app/Config/Autoload.php
@@ -13,7 +13,10 @@ use CodeIgniter\Config\AutoloadConfig;
* can find the files as needed.
*
* NOTE: If you use an identical key in $psr4 or $classmap, then
- * the values in this file will overwrite the framework's values.
+ * the values in this file will overwrite the framework's values.
+ *
+ * NOTE: This class is required prior to Autoloader instantiation,
+ * and does not extend BaseConfig.
*/
class Autoload extends AutoloadConfig
{
@@ -25,24 +28,17 @@ class Autoload extends AutoloadConfig
* their location on the file system. These are used by the autoloader
* to locate files the first time they have been instantiated.
*
- * The '/app' and '/system' directories are already mapped for you.
- * you may change the name of the 'App' namespace if you wish,
+ * The 'Config' (APPPATH . 'Config') and 'CodeIgniter' (SYSTEMPATH) are
+ * already mapped for you.
+ *
+ * You may change the name of the 'App' namespace if you wish,
* but this should be done prior to creating any namespaced classes,
* else you will need to modify all of those classes for this to work.
*
- * Prototype:
- *```
- * $psr4 = [
- * 'CodeIgniter' => SYSTEMPATH,
- * 'App' => APPPATH
- * ];
- *```
- *
- * @var array
+ * @var array|string>
*/
public $psr4 = [
- APP_NAMESPACE => APPPATH, // For custom app namespace
- 'Config' => APPPATH . 'Config',
+ APP_NAMESPACE => APPPATH,
];
/**
@@ -56,11 +52,9 @@ class Autoload extends AutoloadConfig
* were being autoloaded through a namespace.
*
* Prototype:
- *```
* $classmap = [
* 'MyClass' => '/path/to/class/file.php'
* ];
- *```
*
* @var array
*/
@@ -75,13 +69,24 @@ class Autoload extends AutoloadConfig
* or for loading functions.
*
* Prototype:
- * ```
- * $files = [
- * '/path/to/my/file.php',
- * ];
- * ```
+ * $files = [
+ * '/path/to/my/file.php',
+ * ];
*
- * @var array
+ * @var list
*/
public $files = [];
+
+ /**
+ * -------------------------------------------------------------------
+ * Helpers
+ * -------------------------------------------------------------------
+ * Prototype:
+ * $helpers = [
+ * 'form',
+ * ];
+ *
+ * @var list
+ */
+ public $helpers = [];
}
diff --git a/app/Config/Boot/development.php b/app/Config/Boot/development.php
index 05a8612..a868447 100644
--- a/app/Config/Boot/development.php
+++ b/app/Config/Boot/development.php
@@ -7,8 +7,10 @@
| In development, we want to show as many errors as possible to help
| make sure they don't make it to production. And save us hours of
| painful debugging.
+ |
+ | If you set 'display_errors' to '1', CI4's detailed error report will show.
*/
-error_reporting(-1);
+error_reporting(E_ALL);
ini_set('display_errors', '1');
/*
diff --git a/app/Config/Boot/production.php b/app/Config/Boot/production.php
index 21d2580..1822cf5 100644
--- a/app/Config/Boot/production.php
+++ b/app/Config/Boot/production.php
@@ -6,9 +6,13 @@
|--------------------------------------------------------------------------
| Don't show ANY in production environments. Instead, let the system catch
| it and display a generic error message.
+ |
+ | If you set 'display_errors' to '1', CI4's detailed error report will show.
*/
+error_reporting(E_ALL & ~E_DEPRECATED);
+// If you want to suppress more types of errors.
+// error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
ini_set('display_errors', '0');
-error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
/*
|--------------------------------------------------------------------------
diff --git a/app/Config/Boot/testing.php b/app/Config/Boot/testing.php
index e07a1d4..40b6ca8 100644
--- a/app/Config/Boot/testing.php
+++ b/app/Config/Boot/testing.php
@@ -1,5 +1,11 @@
+ * @var array{storePath?: string, mode?: int}
*/
- public $file = [
+ public array $file = [
'storePath' => WRITEPATH . 'cache/',
'mode' => 0640,
];
@@ -129,14 +89,15 @@ class Cache extends BaseConfig
* -------------------------------------------------------------------------
* Memcached settings
* -------------------------------------------------------------------------
+ *
* Your Memcached servers can be specified below, if you are using
* the Memcached drivers.
*
* @see https://codeigniter.com/user_guide/libraries/caching.html#memcached
*
- * @var array
+ * @var array{host?: string, port?: int, weight?: int, raw?: bool}
*/
- public $memcached = [
+ public array $memcached = [
'host' => '127.0.0.1',
'port' => 11211,
'weight' => 1,
@@ -147,12 +108,13 @@ class Cache extends BaseConfig
* -------------------------------------------------------------------------
* Redis settings
* -------------------------------------------------------------------------
+ *
* 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, database?: int}
*/
- public $redis = [
+ public array $redis = [
'host' => '127.0.0.1',
'password' => null,
'port' => 6379,
@@ -168,9 +130,9 @@ class Cache extends BaseConfig
* This is an array of cache engine alias' and class names. Only engines
* that are listed here are allowed to be used.
*
- * @var array
+ * @var array>
*/
- public $validHandlers = [
+ public array $validHandlers = [
'dummy' => DummyHandler::class,
'file' => FileHandler::class,
'memcached' => MemcachedHandler::class,
@@ -178,4 +140,23 @@ class Cache extends BaseConfig
'redis' => RedisHandler::class,
'wincache' => WincacheHandler::class,
];
+
+ /**
+ * --------------------------------------------------------------------------
+ * Web Page Caching: Cache Include Query String
+ * --------------------------------------------------------------------------
+ *
+ * Whether to take the URL query string into consideration when generating
+ * output cache files. Valid options are:
+ *
+ * false = Disabled
+ * true = Enabled, take all query parameters into account.
+ * Please be aware that this may result in numerous cache
+ * files generated for the same page over and over again.
+ * ['q'] = Enabled, but only take into account the specified list
+ * of query parameters.
+ *
+ * @var bool|list
+ */
+ public $cacheQueryString = false;
}
diff --git a/app/Config/Constants.php b/app/Config/Constants.php
index 47b92f8..fb56bb1 100644
--- a/app/Config/Constants.php
+++ b/app/Config/Constants.php
@@ -77,18 +77,3 @@ defined('EXIT_USER_INPUT') || define('EXIT_USER_INPUT', 7); // invalid u
defined('EXIT_DATABASE') || define('EXIT_DATABASE', 8); // database error
defined('EXIT__AUTO_MIN') || define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
-
-/**
- * @deprecated Use \CodeIgniter\Events\Events::PRIORITY_LOW instead.
- */
-define('EVENT_PRIORITY_LOW', 200);
-
-/**
- * @deprecated Use \CodeIgniter\Events\Events::PRIORITY_NORMAL instead.
- */
-define('EVENT_PRIORITY_NORMAL', 100);
-
-/**
- * @deprecated Use \CodeIgniter\Events\Events::PRIORITY_HIGH instead.
- */
-define('EVENT_PRIORITY_HIGH', 10);
diff --git a/app/Config/ContentSecurityPolicy.php b/app/Config/ContentSecurityPolicy.php
index 0be6163..2ac41a7 100644
--- a/app/Config/ContentSecurityPolicy.php
+++ b/app/Config/ContentSecurityPolicy.php
@@ -21,58 +21,52 @@ class ContentSecurityPolicy extends BaseConfig
/**
* Default CSP report context
- *
- * @var bool
*/
- public $reportOnly = false;
+ public bool $reportOnly = false;
/**
* Specifies a URL where a browser will send reports
* when a content security policy is violated.
- *
- * @var string|null
*/
- public $reportURI;
+ public ?string $reportURI = null;
/**
* Instructs user agents to rewrite URL schemes, changing
* HTTP to HTTPS. This directive is for websites with
* large numbers of old URLs that need to be rewritten.
- *
- * @var bool
*/
- public $upgradeInsecureRequests = false;
+ public bool $upgradeInsecureRequests = false;
// -------------------------------------------------------------------------
// Sources allowed
- // Note: once you set a policy to 'none', it cannot be further restricted
+ // NOTE: once you set a policy to 'none', it cannot be further restricted
// -------------------------------------------------------------------------
/**
* Will default to self if not overridden
*
- * @var string|string[]|null
+ * @var list|string|null
*/
public $defaultSrc;
/**
* Lists allowed scripts' URLs.
*
- * @var string|string[]
+ * @var list|string
*/
public $scriptSrc = 'self';
/**
* Lists allowed stylesheets' URLs.
*
- * @var string|string[]
+ * @var list|string
*/
public $styleSrc = 'self';
/**
* Defines the origins from which images can be loaded.
*
- * @var string|string[]
+ * @var list|string
*/
public $imageSrc = 'self';
@@ -81,14 +75,14 @@ class ContentSecurityPolicy extends BaseConfig
*
* Will default to self if not overridden
*
- * @var string|string[]|null
+ * @var list|string|null
*/
public $baseURI;
/**
* Lists the URLs for workers and embedded frame contents
*
- * @var string|string[]
+ * @var list|string
*/
public $childSrc = 'self';
@@ -96,21 +90,21 @@ class ContentSecurityPolicy extends BaseConfig
* Limits the origins that you can connect to (via XHR,
* WebSockets, and EventSource).
*
- * @var string|string[]
+ * @var list|string
*/
public $connectSrc = 'self';
/**
* Specifies the origins that can serve web fonts.
*
- * @var string|string[]
+ * @var list|string
*/
public $fontSrc;
/**
* Lists valid endpoints for submission from `