From 6ba12682549c95c6b68cdc43f725e0a72b46ccb8 Mon Sep 17 00:00:00 2001 From: Sergey K Date: Tue, 16 Dec 2025 03:20:35 +0500 Subject: [PATCH 1/2] [php] Update to CodeIgniter 4.6.4 with optimizations and fixes --- frameworks/PHP/codeigniter/app/.htaccess | 4 +- frameworks/PHP/codeigniter/app/Config/App.php | 60 +- .../PHP/codeigniter/app/Config/Autoload.php | 26 +- .../app/Config/Boot/development.php | 4 +- .../app/Config/Boot/production.php | 6 +- .../codeigniter/app/Config/Boot/testing.php | 8 +- .../PHP/codeigniter/app/Config/Cache.php | 62 +- .../PHP/codeigniter/app/Config/Constants.php | 15 - .../app/Config/ContentSecurityPolicy.php | 32 +- .../PHP/codeigniter/app/Config/Cookie.php | 2 +- .../PHP/codeigniter/app/Config/Cors.php | 105 ++ .../PHP/codeigniter/app/Config/Database.php | 133 ++- .../PHP/codeigniter/app/Config/DocTypes.php | 3 - .../PHP/codeigniter/app/Config/Email.php | 2 +- .../PHP/codeigniter/app/Config/Events.php | 6 +- .../PHP/codeigniter/app/Config/Exceptions.php | 12 +- .../PHP/codeigniter/app/Config/Feature.php | 31 +- .../PHP/codeigniter/app/Config/Filters.php | 56 +- .../PHP/codeigniter/app/Config/Format.php | 15 +- .../PHP/codeigniter/app/Config/Generators.php | 8 +- .../PHP/codeigniter/app/Config/Kint.php | 14 +- .../PHP/codeigniter/app/Config/Logger.php | 5 +- .../PHP/codeigniter/app/Config/Migrations.php | 4 +- .../PHP/codeigniter/app/Config/Mimes.php | 8 +- .../PHP/codeigniter/app/Config/Modules.php | 6 +- .../PHP/codeigniter/app/Config/Optimize.php | 30 + .../PHP/codeigniter/app/Config/Paths.php | 3 + .../PHP/codeigniter/app/Config/Publisher.php | 2 +- .../PHP/codeigniter/app/Config/Routes.php | 8 +- .../PHP/codeigniter/app/Config/Routing.php | 39 +- .../PHP/codeigniter/app/Config/Security.php | 19 +- .../PHP/codeigniter/app/Config/Session.php | 27 +- .../PHP/codeigniter/app/Config/Toolbar.php | 8 +- .../PHP/codeigniter/app/Config/Validation.php | 2 +- .../PHP/codeigniter/app/Config/View.php | 12 +- .../app/Controllers/BaseController.php | 58 -- .../PHP/codeigniter/app/Controllers/Bench.php | 24 +- .../PHP/codeigniter/app/Controllers/Home.php | 11 - .../PHP/codeigniter/app/Libraries/DbRaw.php | 15 - .../codeigniter/app/Models/WorldsModel.php | 10 - .../app/Views/errors/cli/error_exception.php | 38 +- .../app/Views/errors/html/debug.css | 25 +- .../app/Views/errors/html/error_400.php | 84 ++ .../app/Views/errors/html/error_404.php | 2 +- .../app/Views/errors/html/error_exception.php | 87 +- .../codeigniter/app/Views/welcome_message.php | 325 ------ .../PHP/codeigniter/codeigniter.dockerfile | 19 +- frameworks/PHP/codeigniter/composer.json | 22 +- .../PHP/codeigniter/deploy/conf/php-fpm.conf | 448 +------- .../PHP/codeigniter/deploy/conf/php.ini | 977 +++++++++--------- .../codeigniter/deploy/conf/pool.d/www.conf | 489 +++++++++ frameworks/PHP/codeigniter/preload.php | 112 ++ frameworks/PHP/codeigniter/public/.htaccess | 4 +- frameworks/PHP/codeigniter/public/index.php | 44 +- frameworks/PHP/codeigniter/spark | 87 ++ frameworks/PHP/codeigniter/writable/.htaccess | 4 +- .../PHP/codeigniter/writable/cache/index.html | 0 .../codeigniter/writable/debugbar/.gitkeep | 0 .../codeigniter/writable/debugbar/index.html | 11 + .../PHP/codeigniter/writable/index.html | 11 + .../PHP/codeigniter/writable/logs/index.html | 0 .../codeigniter/writable/session/index.html | 0 .../codeigniter/writable/uploads/index.html | 0 63 files changed, 2005 insertions(+), 1679 deletions(-) create mode 100644 frameworks/PHP/codeigniter/app/Config/Cors.php mode change 100755 => 100644 frameworks/PHP/codeigniter/app/Config/DocTypes.php create mode 100644 frameworks/PHP/codeigniter/app/Config/Optimize.php delete mode 100644 frameworks/PHP/codeigniter/app/Controllers/BaseController.php delete mode 100644 frameworks/PHP/codeigniter/app/Controllers/Home.php delete mode 100644 frameworks/PHP/codeigniter/app/Libraries/DbRaw.php delete mode 100644 frameworks/PHP/codeigniter/app/Models/WorldsModel.php create mode 100644 frameworks/PHP/codeigniter/app/Views/errors/html/error_400.php delete mode 100644 frameworks/PHP/codeigniter/app/Views/welcome_message.php mode change 100755 => 100644 frameworks/PHP/codeigniter/composer.json create mode 100644 frameworks/PHP/codeigniter/deploy/conf/pool.d/www.conf create mode 100644 frameworks/PHP/codeigniter/preload.php create mode 100755 frameworks/PHP/codeigniter/spark mode change 100755 => 100644 frameworks/PHP/codeigniter/writable/.htaccess mode change 100755 => 100644 frameworks/PHP/codeigniter/writable/cache/index.html delete mode 100755 frameworks/PHP/codeigniter/writable/debugbar/.gitkeep create mode 100644 frameworks/PHP/codeigniter/writable/debugbar/index.html create mode 100644 frameworks/PHP/codeigniter/writable/index.html mode change 100755 => 100644 frameworks/PHP/codeigniter/writable/logs/index.html mode change 100755 => 100644 frameworks/PHP/codeigniter/writable/session/index.html mode change 100755 => 100644 frameworks/PHP/codeigniter/writable/uploads/index.html diff --git a/frameworks/PHP/codeigniter/app/.htaccess b/frameworks/PHP/codeigniter/app/.htaccess index f24db0accc7..3462048add7 100644 --- a/frameworks/PHP/codeigniter/app/.htaccess +++ b/frameworks/PHP/codeigniter/app/.htaccess @@ -1,6 +1,6 @@ - Require all denied + Require all denied - Deny from all + Deny from all diff --git a/frameworks/PHP/codeigniter/app/Config/App.php b/frameworks/PHP/codeigniter/app/Config/App.php index 7beb46646f1..b761da772ad 100644 --- a/frameworks/PHP/codeigniter/app/Config/App.php +++ b/frameworks/PHP/codeigniter/app/Config/App.php @@ -14,7 +14,7 @@ class App extends BaseConfig * URL to your CodeIgniter root. Typically, this will be your base URL, * WITH a trailing slash: * - * http://example.com/ + * E.g., http://example.com/ */ public string $baseURL = 'http://localhost:8080/'; @@ -22,13 +22,12 @@ class App extends BaseConfig * 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'] + * 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 string[] - * @phpstan-var list + * @var list */ public array $allowedHostnames = []; @@ -37,9 +36,9 @@ class App extends BaseConfig * 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. + * 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 string $indexPage = 'index.php'; @@ -49,17 +48,41 @@ 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! */ 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~%.:_\-'; + /** * -------------------------------------------------------------------------- * Default Locale @@ -95,7 +118,7 @@ class App extends BaseConfig * * IncomingRequest::setLocale() also uses this list. * - * @var string[] + * @var list */ public array $supportedLocales = ['en']; @@ -107,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() * - * @see https://www.php.net/manual/en/timezones.php for list of timezones supported by PHP. + * @see https://www.php.net/manual/en/timezones.php for list of timezones + * supported by PHP. */ - public string $appTimezone = 'America/Chicago'; + public string $appTimezone = 'UTC'; /** * -------------------------------------------------------------------------- @@ -131,7 +155,7 @@ class App extends BaseConfig * 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. + * and the HTTP Strict Transport Security (HSTS) header will be set. */ public bool $forceGlobalSecureRequests = false; diff --git a/frameworks/PHP/codeigniter/app/Config/Autoload.php b/frameworks/PHP/codeigniter/app/Config/Autoload.php index 22f05ecdab2..9a928241a0e 100644 --- a/frameworks/PHP/codeigniter/app/Config/Autoload.php +++ b/frameworks/PHP/codeigniter/app/Config/Autoload.php @@ -17,8 +17,6 @@ * * NOTE: This class is required prior to Autoloader instantiation, * and does not extend BaseConfig. - * - * @immutable */ class Autoload extends AutoloadConfig { @@ -30,23 +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|string> - * @phpstan-var array> + * @var array|string> */ public $psr4 = [ - APP_NAMESPACE => APPPATH, // For custom app namespace - 'Config' => APPPATH . 'Config', + APP_NAMESPACE => APPPATH, ]; /** @@ -81,8 +73,7 @@ class Autoload extends AutoloadConfig * '/path/to/my/file.php', * ]; * - * @var string[] - * @phpstan-var list + * @var list */ public $files = []; @@ -95,8 +86,7 @@ class Autoload extends AutoloadConfig * 'form', * ]; * - * @var string[] - * @phpstan-var list + * @var list */ public $helpers = []; } diff --git a/frameworks/PHP/codeigniter/app/Config/Boot/development.php b/frameworks/PHP/codeigniter/app/Config/Boot/development.php index 05a861258fc..a868447a8e3 100644 --- a/frameworks/PHP/codeigniter/app/Config/Boot/development.php +++ b/frameworks/PHP/codeigniter/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/frameworks/PHP/codeigniter/app/Config/Boot/production.php b/frameworks/PHP/codeigniter/app/Config/Boot/production.php index 21d25805674..1822cf583f8 100644 --- a/frameworks/PHP/codeigniter/app/Config/Boot/production.php +++ b/frameworks/PHP/codeigniter/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/frameworks/PHP/codeigniter/app/Config/Boot/testing.php b/frameworks/PHP/codeigniter/app/Config/Boot/testing.php index e07a1d43f43..40b6ca83cf3 100644 --- a/frameworks/PHP/codeigniter/app/Config/Boot/testing.php +++ b/frameworks/PHP/codeigniter/app/Config/Boot/testing.php @@ -1,5 +1,11 @@ + * @var array{storePath?: string, mode?: int} */ public array $file = [ 'storePath' => WRITEPATH . 'cache/', @@ -119,12 +89,13 @@ 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 array $memcached = [ 'host' => '127.0.0.1', @@ -137,10 +108,11 @@ 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 array $redis = [ 'host' => '127.0.0.1', @@ -158,8 +130,7 @@ 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 - * @phpstan-var array> + * @var array> */ public array $validHandlers = [ 'dummy' => DummyHandler::class, @@ -169,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/frameworks/PHP/codeigniter/app/Config/Constants.php b/frameworks/PHP/codeigniter/app/Config/Constants.php index 47b92f83293..fb56bb1c5b0 100644 --- a/frameworks/PHP/codeigniter/app/Config/Constants.php +++ b/frameworks/PHP/codeigniter/app/Config/Constants.php @@ -77,18 +77,3 @@ 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/frameworks/PHP/codeigniter/app/Config/ContentSecurityPolicy.php b/frameworks/PHP/codeigniter/app/Config/ContentSecurityPolicy.php index 7799c476f07..2ac41a70dad 100644 --- a/frameworks/PHP/codeigniter/app/Config/ContentSecurityPolicy.php +++ b/frameworks/PHP/codeigniter/app/Config/ContentSecurityPolicy.php @@ -45,28 +45,28 @@ class ContentSecurityPolicy extends BaseConfig /** * 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'; @@ -75,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'; @@ -90,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 `
` tags. * - * @var string|string[] + * @var list|string */ public $formAction = 'self'; @@ -114,7 +114,7 @@ class ContentSecurityPolicy extends BaseConfig * and `` tags. This directive can't be used in * `` tags and applies only to non-HTML resources. * - * @var string|string[]|null + * @var list|string|null */ public $frameAncestors; @@ -122,40 +122,40 @@ class ContentSecurityPolicy extends BaseConfig * The frame-src directive restricts the URLs which may * be loaded into nested browsing contexts. * - * @var array|string|null + * @var list|string|null */ public $frameSrc; /** * Restricts the origins allowed to deliver video and audio. * - * @var string|string[]|null + * @var list|string|null */ public $mediaSrc; /** * Allows control over Flash and other plugins. * - * @var string|string[] + * @var list|string */ public $objectSrc = 'self'; /** - * @var string|string[]|null + * @var list|string|null */ public $manifestSrc; /** * Limits the kinds of plugins a page may invoke. * - * @var string|string[]|null + * @var list|string|null */ public $pluginTypes; /** * List of actions allowed. * - * @var string|string[]|null + * @var list|string|null */ public $sandbox; diff --git a/frameworks/PHP/codeigniter/app/Config/Cookie.php b/frameworks/PHP/codeigniter/app/Config/Cookie.php index 84ccc0e99d8..3bad184797c 100644 --- a/frameworks/PHP/codeigniter/app/Config/Cookie.php +++ b/frameworks/PHP/codeigniter/app/Config/Cookie.php @@ -85,7 +85,7 @@ class Cookie extends BaseConfig * (empty string) means default SameSite attribute set by browsers (`Lax`) * will be set on cookies. If set to `None`, `$secure` must also be set. * - * @phpstan-var 'None'|'Lax'|'Strict'|'' + * @var ''|'Lax'|'None'|'Strict' */ public string $samesite = 'Lax'; diff --git a/frameworks/PHP/codeigniter/app/Config/Cors.php b/frameworks/PHP/codeigniter/app/Config/Cors.php new file mode 100644 index 00000000000..2b4edf6bf60 --- /dev/null +++ b/frameworks/PHP/codeigniter/app/Config/Cors.php @@ -0,0 +1,105 @@ +, + * allowedOriginsPatterns: list, + * supportsCredentials: bool, + * allowedHeaders: list, + * exposedHeaders: list, + * allowedMethods: list, + * maxAge: int, + * } + */ + public array $default = [ + /** + * Origins for the `Access-Control-Allow-Origin` header. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin + * + * E.g.: + * - ['http://localhost:8080'] + * - ['https://www.example.com'] + */ + 'allowedOrigins' => [], + + /** + * Origin regex patterns for the `Access-Control-Allow-Origin` header. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin + * + * NOTE: A pattern specified here is part of a regular expression. It will + * be actually `#\A\z#`. + * + * E.g.: + * - ['https://\w+\.example\.com'] + */ + 'allowedOriginsPatterns' => [], + + /** + * Weather to send the `Access-Control-Allow-Credentials` header. + * + * The Access-Control-Allow-Credentials response header tells browsers whether + * the server allows cross-origin HTTP requests to include credentials. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials + */ + 'supportsCredentials' => false, + + /** + * Set headers to allow. + * + * The Access-Control-Allow-Headers response header is used in response to + * a preflight request which includes the Access-Control-Request-Headers to + * indicate which HTTP headers can be used during the actual request. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers + */ + 'allowedHeaders' => [], + + /** + * Set headers to expose. + * + * The Access-Control-Expose-Headers response header allows a server to + * indicate which response headers should be made available to scripts running + * in the browser, in response to a cross-origin request. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers + */ + 'exposedHeaders' => [], + + /** + * Set methods to allow. + * + * The Access-Control-Allow-Methods response header specifies one or more + * methods allowed when accessing a resource in response to a preflight + * request. + * + * E.g.: + * - ['GET', 'POST', 'PUT', 'DELETE'] + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods + */ + 'allowedMethods' => [], + + /** + * Set how many seconds the results of a preflight request can be cached. + * + * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age + */ + 'maxAge' => 7200, + ]; +} diff --git a/frameworks/PHP/codeigniter/app/Config/Database.php b/frameworks/PHP/codeigniter/app/Config/Database.php index ed199c24eed..df1b1cf15d5 100644 --- a/frameworks/PHP/codeigniter/app/Config/Database.php +++ b/frameworks/PHP/codeigniter/app/Config/Database.php @@ -10,19 +10,19 @@ class Database extends Config { /** - * The directory that holds the Migrations - * and Seeds directories. + * The directory that holds the Migrations and Seeds directories. */ public string $filesPath = APPPATH . 'Database' . DIRECTORY_SEPARATOR; /** - * Lets you choose which connection group to - * use if no other is specified. + * Lets you choose which connection group to use if no other is specified. */ public string $defaultGroup = 'default'; /** * The default database connection. + * + * @var array */ public array $default = [ 'DSN' => '', @@ -43,11 +43,124 @@ class Database extends Config 'failover' => [], 'port' => 3306, 'numberNative' => false, + 'foundRows' => false, + 'dateFormat' => [ + 'date' => 'Y-m-d', + 'datetime' => 'Y-m-d H:i:s', + 'time' => 'H:i:s', + ], ]; + // /** + // * Sample database connection for SQLite3. + // * + // * @var array + // */ + // public array $default = [ + // 'database' => 'database.db', + // 'DBDriver' => 'SQLite3', + // 'DBPrefix' => '', + // 'DBDebug' => true, + // 'swapPre' => '', + // 'failover' => [], + // 'foreignKeys' => true, + // 'busyTimeout' => 1000, + // 'synchronous' => null, + // 'dateFormat' => [ + // 'date' => 'Y-m-d', + // 'datetime' => 'Y-m-d H:i:s', + // 'time' => 'H:i:s', + // ], + // ]; + + // /** + // * Sample database connection for Postgre. + // * + // * @var array + // */ + // public array $default = [ + // 'DSN' => '', + // 'hostname' => 'localhost', + // 'username' => 'root', + // 'password' => 'root', + // 'database' => 'ci4', + // 'schema' => 'public', + // 'DBDriver' => 'Postgre', + // 'DBPrefix' => '', + // 'pConnect' => false, + // 'DBDebug' => true, + // 'charset' => 'utf8', + // 'swapPre' => '', + // 'failover' => [], + // 'port' => 5432, + // 'dateFormat' => [ + // 'date' => 'Y-m-d', + // 'datetime' => 'Y-m-d H:i:s', + // 'time' => 'H:i:s', + // ], + // ]; + + // /** + // * Sample database connection for SQLSRV. + // * + // * @var array + // */ + // public array $default = [ + // 'DSN' => '', + // 'hostname' => 'localhost', + // 'username' => 'root', + // 'password' => 'root', + // 'database' => 'ci4', + // 'schema' => 'dbo', + // 'DBDriver' => 'SQLSRV', + // 'DBPrefix' => '', + // 'pConnect' => false, + // 'DBDebug' => true, + // 'charset' => 'utf8', + // 'swapPre' => '', + // 'encrypt' => false, + // 'failover' => [], + // 'port' => 1433, + // 'dateFormat' => [ + // 'date' => 'Y-m-d', + // 'datetime' => 'Y-m-d H:i:s', + // 'time' => 'H:i:s', + // ], + // ]; + + // /** + // * Sample database connection for OCI8. + // * + // * You may need the following environment variables: + // * NLS_LANG = 'AMERICAN_AMERICA.UTF8' + // * NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS' + // * NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS' + // * NLS_TIMESTAMP_TZ_FORMAT = 'YYYY-MM-DD HH24:MI:SS' + // * + // * @var array + // */ + // public array $default = [ + // 'DSN' => 'localhost:1521/XEPDB1', + // 'username' => 'root', + // 'password' => 'root', + // 'DBDriver' => 'OCI8', + // 'DBPrefix' => '', + // 'pConnect' => false, + // 'DBDebug' => true, + // 'charset' => 'AL32UTF8', + // 'swapPre' => '', + // 'failover' => [], + // 'dateFormat' => [ + // 'date' => 'Y-m-d', + // 'datetime' => 'Y-m-d H:i:s', + // 'time' => 'H:i:s', + // ], + // ]; + /** - * This database connection is used when - * running PHPUnit database tests. + * This database connection is used when running PHPUnit database tests. + * + * @var array */ public array $tests = [ 'DSN' => '', @@ -60,7 +173,7 @@ class Database extends Config 'pConnect' => false, 'DBDebug' => true, 'charset' => 'utf8', - 'DBCollat' => 'utf8_general_ci', + 'DBCollat' => '', 'swapPre' => '', 'encrypt' => false, 'compress' => false, @@ -69,6 +182,12 @@ class Database extends Config 'port' => 3306, 'foreignKeys' => true, 'busyTimeout' => 1000, + 'synchronous' => null, + 'dateFormat' => [ + 'date' => 'Y-m-d', + 'datetime' => 'Y-m-d H:i:s', + 'time' => 'H:i:s', + ], ]; public function __construct() diff --git a/frameworks/PHP/codeigniter/app/Config/DocTypes.php b/frameworks/PHP/codeigniter/app/Config/DocTypes.php old mode 100755 new mode 100644 index 7e8aaacf09d..788d68fdc11 --- a/frameworks/PHP/codeigniter/app/Config/DocTypes.php +++ b/frameworks/PHP/codeigniter/app/Config/DocTypes.php @@ -2,9 +2,6 @@ namespace Config; -/** - * @immutable - */ class DocTypes { /** diff --git a/frameworks/PHP/codeigniter/app/Config/Email.php b/frameworks/PHP/codeigniter/app/Config/Email.php index 01b805a5c1f..4dce650b32e 100644 --- a/frameworks/PHP/codeigniter/app/Config/Email.php +++ b/frameworks/PHP/codeigniter/app/Config/Email.php @@ -26,7 +26,7 @@ class Email extends BaseConfig public string $mailPath = '/usr/sbin/sendmail'; /** - * SMTP Server Address + * SMTP Server Hostname */ public string $SMTPHost = ''; diff --git a/frameworks/PHP/codeigniter/app/Config/Events.php b/frameworks/PHP/codeigniter/app/Config/Events.php index 993abd24ebc..946285b8951 100644 --- a/frameworks/PHP/codeigniter/app/Config/Events.php +++ b/frameworks/PHP/codeigniter/app/Config/Events.php @@ -23,7 +23,7 @@ * Events::on('create', [$myInstance, 'myMethod']); */ -Events::on('pre_system', static function () { +Events::on('pre_system', static function (): void { if (ENVIRONMENT !== 'testing') { if (ini_get('zlib.output_compression')) { throw FrameworkException::forEnabledZlibOutputCompression(); @@ -44,10 +44,10 @@ */ if (CI_DEBUG && ! is_cli()) { Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect'); - Services::toolbar()->respond(); + service('toolbar')->respond(); // Hot Reload route - for framework use on the hot reloader. if (ENVIRONMENT === 'development') { - Services::routes()->get('__hot-reload', static function () { + service('routes')->get('__hot-reload', static function (): void { (new HotReloader())->run(); }); } diff --git a/frameworks/PHP/codeigniter/app/Config/Exceptions.php b/frameworks/PHP/codeigniter/app/Config/Exceptions.php index 4173dcdd1c7..4e3396346b8 100644 --- a/frameworks/PHP/codeigniter/app/Config/Exceptions.php +++ b/frameworks/PHP/codeigniter/app/Config/Exceptions.php @@ -30,6 +30,8 @@ class Exceptions extends BaseConfig * -------------------------------------------------------------------------- * Any status codes here will NOT be logged if logging is turned on. * By default, only 404 (Page Not Found) exceptions are ignored. + * + * @var list */ public array $ignoreCodes = [404]; @@ -51,17 +53,17 @@ class Exceptions extends BaseConfig * Any data that you would like to hide from the debug trace. * In order to specify 2 levels, use "/" to separate. * ex. ['server', 'setup/password', 'secret_token'] + * + * @var list */ public array $sensitiveDataInTrace = []; /** * -------------------------------------------------------------------------- - * LOG DEPRECATIONS INSTEAD OF THROWING? + * WHETHER TO THROW AN EXCEPTION ON DEPRECATED ERRORS * -------------------------------------------------------------------------- - * By default, CodeIgniter converts deprecations into exceptions. Also, - * starting in PHP 8.1 will cause a lot of deprecated usage warnings. - * Use this option to temporarily cease the warnings and instead log those. - * This option also works for user deprecations. + * If set to `true`, DEPRECATED errors are only logged and no exceptions are + * thrown. This option also works for user deprecations. */ public bool $logDeprecations = true; diff --git a/frameworks/PHP/codeigniter/app/Config/Feature.php b/frameworks/PHP/codeigniter/app/Config/Feature.php index 0bc45c6f46c..ec1435af413 100644 --- a/frameworks/PHP/codeigniter/app/Config/Feature.php +++ b/frameworks/PHP/codeigniter/app/Config/Feature.php @@ -10,21 +10,28 @@ class Feature extends BaseConfig { /** - * Enable multiple filters for a route or not. + * Use improved new auto routing instead of the legacy version. + */ + public bool $autoRoutesImproved = true; + + /** + * Use filter execution order in 4.4 or before. + */ + public bool $oldFilterOrder = false; + + /** + * The behavior of `limit(0)` in Query Builder. * - * If you enable this: - * - CodeIgniter\CodeIgniter::handleRequest() uses: - * - CodeIgniter\Filters\Filters::enableFilters(), instead of enableFilter() - * - CodeIgniter\CodeIgniter::tryToRouteIt() uses: - * - CodeIgniter\Router\Router::getFilters(), instead of getFilter() - * - CodeIgniter\Router\Router::handle() uses: - * - property $filtersInfo, instead of $filterInfo - * - CodeIgniter\Router\RouteCollection::getFiltersForRoute(), instead of getFilterForRoute() + * If true, `limit(0)` returns all records. (the behavior of 4.4.x or before in version 4.x.) + * If false, `limit(0)` returns no records. (the behavior of 3.1.9 or later in version 3.x.) */ - public bool $multipleFilters = false; + public bool $limitZeroAsAll = true; /** - * Use improved new auto routing instead of the default legacy version. + * Use strict location negotiation. + * + * By default, the locale is selected based on a loose comparison of the language code (ISO 639-1) + * Enabling strict comparison will also consider the region code (ISO 3166-1 alpha-2). */ - public bool $autoRoutesImproved = false; + public bool $strictLocaleNegotiation = false; } diff --git a/frameworks/PHP/codeigniter/app/Config/Filters.php b/frameworks/PHP/codeigniter/app/Config/Filters.php index 8c02a4acd33..9c83ae94e55 100644 --- a/frameworks/PHP/codeigniter/app/Config/Filters.php +++ b/frameworks/PHP/codeigniter/app/Config/Filters.php @@ -2,21 +2,27 @@ namespace Config; -use CodeIgniter\Config\BaseConfig; +use CodeIgniter\Config\Filters as BaseFilters; +use CodeIgniter\Filters\Cors; use CodeIgniter\Filters\CSRF; use CodeIgniter\Filters\DebugToolbar; +use CodeIgniter\Filters\ForceHTTPS; use CodeIgniter\Filters\Honeypot; use CodeIgniter\Filters\InvalidChars; +use CodeIgniter\Filters\PageCache; +use CodeIgniter\Filters\PerformanceMetrics; use CodeIgniter\Filters\SecureHeaders; -class Filters extends BaseConfig +class Filters extends BaseFilters { /** * Configures aliases for Filter classes to * make reading things nicer and simpler. * - * @var array - * @phpstan-var array + * @var array> + * + * [filter_name => classname] + * or [filter_name => [classname1, classname2, ...]] */ public array $aliases = [ 'csrf' => CSRF::class, @@ -24,14 +30,45 @@ class Filters extends BaseConfig 'honeypot' => Honeypot::class, 'invalidchars' => InvalidChars::class, 'secureheaders' => SecureHeaders::class, + 'cors' => Cors::class, + 'forcehttps' => ForceHTTPS::class, + 'pagecache' => PageCache::class, + 'performance' => PerformanceMetrics::class, + ]; + + /** + * List of special required filters. + * + * The filters listed here are special. They are applied before and after + * other kinds of filters, and always applied even if a route does not exist. + * + * Filters set by default provide framework functionality. If removed, + * those functions will no longer work. + * + * @see https://codeigniter.com/user_guide/incoming/filters.html#provided-filters + * + * @var array{before: list, after: list} + */ + public array $required = [ + 'before' => [ + 'forcehttps', // Force Global Secure Requests + 'pagecache', // Web Page Caching + ], + 'after' => [ + 'pagecache', // Web Page Caching + 'performance', // Performance Metrics + 'toolbar', // Debug Toolbar + ], ]; /** * List of filter aliases that are always * applied before and after every request. * - * @var array>>|array> - * @phpstan-var array>|array>> + * @var array{ + * before: array|string}>|list, + * after: array|string}>|list + * } */ public array $globals = [ 'before' => [ @@ -40,7 +77,6 @@ class Filters extends BaseConfig // 'invalidchars', ], 'after' => [ - 'toolbar', // 'honeypot', // 'secureheaders', ], @@ -51,11 +87,13 @@ class Filters extends BaseConfig * particular HTTP method (GET, POST, etc.). * * Example: - * 'post' => ['foo', 'bar'] + * 'POST' => ['foo', 'bar'] * * If you use this, you should disable auto-routing because auto-routing * permits any HTTP method to access a controller. Accessing the controller * with a method you don't expect could bypass the filter. + * + * @var array> */ public array $methods = []; @@ -65,6 +103,8 @@ class Filters extends BaseConfig * * Example: * 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']] + * + * @var array>> */ public array $filters = []; } diff --git a/frameworks/PHP/codeigniter/app/Config/Format.php b/frameworks/PHP/codeigniter/app/Config/Format.php index 749da3e5fde..0d334d72b3f 100644 --- a/frameworks/PHP/codeigniter/app/Config/Format.php +++ b/frameworks/PHP/codeigniter/app/Config/Format.php @@ -3,7 +3,6 @@ namespace Config; use CodeIgniter\Config\BaseConfig; -use CodeIgniter\Format\FormatterInterface; use CodeIgniter\Format\JSONFormatter; use CodeIgniter\Format\XMLFormatter; @@ -22,7 +21,7 @@ class Format extends BaseConfig * These formats are only checked when the data passed to the respond() * method is an array. * - * @var string[] + * @var list */ public array $supportedResponseFormats = [ 'application/json', @@ -62,16 +61,4 @@ class Format extends BaseConfig 'application/xml' => 0, 'text/xml' => 0, ]; - - /** - * A Factory method to return the appropriate formatter for the given mime type. - * - * @return FormatterInterface - * - * @deprecated This is an alias of `\CodeIgniter\Format\Format::getFormatter`. Use that instead. - */ - public function getFormatter(string $mime) - { - return Services::format()->getFormatter($mime); - } } diff --git a/frameworks/PHP/codeigniter/app/Config/Generators.php b/frameworks/PHP/codeigniter/app/Config/Generators.php index 6566a31e851..cc92c7aa432 100644 --- a/frameworks/PHP/codeigniter/app/Config/Generators.php +++ b/frameworks/PHP/codeigniter/app/Config/Generators.php @@ -23,11 +23,13 @@ class Generators extends BaseConfig * * YOU HAVE BEEN WARNED! * - * @var array + * @var array|string> */ public array $views = [ - 'make:cell' => 'CodeIgniter\Commands\Generators\Views\cell.tpl.php', - 'make:cell_view' => 'CodeIgniter\Commands\Generators\Views\cell_view.tpl.php', + 'make:cell' => [ + 'class' => 'CodeIgniter\Commands\Generators\Views\cell.tpl.php', + 'view' => 'CodeIgniter\Commands\Generators\Views\cell_view.tpl.php', + ], 'make:command' => 'CodeIgniter\Commands\Generators\Views\command.tpl.php', 'make:config' => 'CodeIgniter\Commands\Generators\Views\config.tpl.php', 'make:controller' => 'CodeIgniter\Commands\Generators\Views\controller.tpl.php', diff --git a/frameworks/PHP/codeigniter/app/Config/Kint.php b/frameworks/PHP/codeigniter/app/Config/Kint.php index cc8b54592b6..931ad47f5fe 100644 --- a/frameworks/PHP/codeigniter/app/Config/Kint.php +++ b/frameworks/PHP/codeigniter/app/Config/Kint.php @@ -2,9 +2,7 @@ namespace Config; -use CodeIgniter\Config\BaseConfig; use Kint\Parser\ConstructablePluginInterface; -use Kint\Renderer\AbstractRenderer; use Kint\Renderer\Rich\TabPluginInterface; use Kint\Renderer\Rich\ValuePluginInterface; @@ -18,7 +16,7 @@ * * @see https://kint-php.github.io/kint/ for details on these settings. */ -class Kint extends BaseConfig +class Kint { /* |-------------------------------------------------------------------------- @@ -27,8 +25,7 @@ class Kint extends BaseConfig */ /** - * @var array - * @phpstan-var list|ConstructablePluginInterface> + * @var list|ConstructablePluginInterface>|null */ public $plugins; @@ -43,17 +40,14 @@ class Kint extends BaseConfig */ public string $richTheme = 'aante-light.css'; public bool $richFolder = false; - public int $richSort = AbstractRenderer::SORT_FULL; /** - * @var array - * @phpstan-var array> + * @var array>|null */ public $richObjectPlugins; /** - * @var array - * @phpstan-var array> + * @var array>|null */ public $richTabPlugins; diff --git a/frameworks/PHP/codeigniter/app/Config/Logger.php b/frameworks/PHP/codeigniter/app/Config/Logger.php index 568c5da658b..799dc2c3908 100644 --- a/frameworks/PHP/codeigniter/app/Config/Logger.php +++ b/frameworks/PHP/codeigniter/app/Config/Logger.php @@ -4,6 +4,7 @@ use CodeIgniter\Config\BaseConfig; use CodeIgniter\Log\Handlers\FileHandler; +use CodeIgniter\Log\Handlers\HandlerInterface; class Logger extends BaseConfig { @@ -36,7 +37,7 @@ class Logger extends BaseConfig * For a live site you'll usually enable Critical or higher (3) to be logged otherwise * your log files will fill up very fast. * - * @var array|int + * @var int|list */ public $threshold = (ENVIRONMENT === 'production') ? 4 : 9; @@ -72,6 +73,8 @@ class Logger extends BaseConfig * * Handlers are executed in the order defined in this array, starting with * the handler on top and continuing down. + * + * @var array, array|string>> */ public array $handlers = [ /* diff --git a/frameworks/PHP/codeigniter/app/Config/Migrations.php b/frameworks/PHP/codeigniter/app/Config/Migrations.php index 3c825667cf6..1dec8b9b3a4 100644 --- a/frameworks/PHP/codeigniter/app/Config/Migrations.php +++ b/frameworks/PHP/codeigniter/app/Config/Migrations.php @@ -25,9 +25,7 @@ class Migrations extends BaseConfig * * This is the name of the table that will store the current migrations state. * When migrations runs it will store in a database table which migration - * level the system is at. It then compares the migration level in this - * table to the $config['migration_version'] if they are not the same it - * will migrate up. This must be set. + * files have already been run. */ public string $table = 'migrations'; diff --git a/frameworks/PHP/codeigniter/app/Config/Mimes.php b/frameworks/PHP/codeigniter/app/Config/Mimes.php index d02df1aba79..c2db7340cd7 100644 --- a/frameworks/PHP/codeigniter/app/Config/Mimes.php +++ b/frameworks/PHP/codeigniter/app/Config/Mimes.php @@ -3,8 +3,6 @@ namespace Config; /** - * Mimes - * * This file contains an array of mime types. It is used by the * Upload class to help identify allowed file types. * @@ -15,13 +13,13 @@ * * When working with mime types, please make sure you have the ´fileinfo´ * extension enabled to reliably detect the media types. - * - * @immutable */ class Mimes { /** * Map of extensions to mime types. + * + * @var array|string> */ public static array $mimes = [ 'hqx' => [ @@ -480,6 +478,8 @@ class Mimes 'application/sla', 'application/vnd.ms-pki.stl', 'application/x-navistyle', + 'model/stl', + 'application/octet-stream', ], ]; diff --git a/frameworks/PHP/codeigniter/app/Config/Modules.php b/frameworks/PHP/codeigniter/app/Config/Modules.php index f84580c856d..9e03fa49126 100644 --- a/frameworks/PHP/codeigniter/app/Config/Modules.php +++ b/frameworks/PHP/codeigniter/app/Config/Modules.php @@ -9,8 +9,6 @@ * * NOTE: This class is required prior to Autoloader instantiation, * and does not extend BaseConfig. - * - * @immutable */ class Modules extends BaseModules { @@ -58,7 +56,7 @@ class Modules extends BaseModules * ], * ] * - * @var array + * @var array{only?: list, exclude?: list} */ public $composerPackages = []; @@ -72,7 +70,7 @@ class Modules extends BaseModules * * If it is not listed, only the base application elements will be used. * - * @var string[] + * @var list */ public $aliases = [ 'events', diff --git a/frameworks/PHP/codeigniter/app/Config/Optimize.php b/frameworks/PHP/codeigniter/app/Config/Optimize.php new file mode 100644 index 00000000000..481e645f57b --- /dev/null +++ b/frameworks/PHP/codeigniter/app/Config/Optimize.php @@ -0,0 +1,30 @@ + + * @var array */ public $restrictions = [ ROOTPATH => '*', diff --git a/frameworks/PHP/codeigniter/app/Config/Routes.php b/frameworks/PHP/codeigniter/app/Config/Routes.php index d7cfb5a8e97..0584e0b6355 100644 --- a/frameworks/PHP/codeigniter/app/Config/Routes.php +++ b/frameworks/PHP/codeigniter/app/Config/Routes.php @@ -5,17 +5,11 @@ /** * @var RouteCollection $routes */ - -// We get a performance increase by specifying the default -// route since we don't have to scan directories. -//$routes->get('/', 'Home::index'); $routes->get('plaintext', 'Bench::plaintext'); $routes->get('json', 'Bench::json'); -$routes->get('fortunes', 'Bench::fortunes'); // /(:num) +$routes->get('fortunes', 'Bench::fortunes'); $routes->get('db', 'Bench::db'); $routes->get('queries/(:alphanum)', 'Bench::queries/$1'); $routes->get('queries/', 'Bench::queries/1'); $routes->get('update/(:alphanum)', 'Bench::update/$1'); $routes->get('update/', 'Bench::update/1'); - - diff --git a/frameworks/PHP/codeigniter/app/Config/Routing.php b/frameworks/PHP/codeigniter/app/Config/Routing.php index 8d3c773157c..3005543a9e7 100644 --- a/frameworks/PHP/codeigniter/app/Config/Routing.php +++ b/frameworks/PHP/codeigniter/app/Config/Routing.php @@ -19,17 +19,21 @@ class Routing extends BaseRouting { /** + * For Defined Routes. * An array of files that contain route definitions. * Route files are read in order, with the first match * found taking precedence. * * Default: APPPATH . 'Config/Routes.php' + * + * @var list */ public array $routeFiles = [ APPPATH . 'Config/Routes.php', ]; /** + * For Defined Routes and Auto Routing. * The default namespace to use for Controllers when no other * namespace has been specified. * @@ -38,6 +42,7 @@ class Routing extends BaseRouting public string $defaultNamespace = 'App\Controllers'; /** + * For Auto Routing. * The default controller to use when no other controller has been * specified. * @@ -46,6 +51,7 @@ class Routing extends BaseRouting public string $defaultController = 'Home'; /** + * For Defined Routes and Auto Routing. * The default method to call on the controller when no other * method has been set in the route. * @@ -54,7 +60,8 @@ class Routing extends BaseRouting public string $defaultMethod = 'index'; /** - * Whether to translate dashes in URIs to underscores. + * For Auto Routing. + * Whether to translate dashes in URIs for controller/method to underscores. * Primarily useful when using the auto-routing. * * Default: false @@ -63,13 +70,12 @@ class Routing extends BaseRouting /** * Sets the class/method that should be called if routing doesn't - * find a match. It can be either a closure or the controller/method - * name exactly like a route is defined: Users::index + * find a match. It can be the controller/method name like: Users::index * * This setting is passed to the Router class and handled there. * * If you want to use a closure, you will have to set it in the - * class constructor or the routes file by calling: + * routes file by calling: * * $routes->set404Override(function() { * // Do something here @@ -91,6 +97,7 @@ class Routing extends BaseRouting public bool $autoRoute = false; /** + * For Defined Routes. * If TRUE, will enable the use of the 'prioritize' option * when defining routes. * @@ -99,7 +106,16 @@ class Routing extends BaseRouting public bool $prioritize = false; /** - * Map of URI segments and namespaces. For Auto Routing (Improved). + * For Defined Routes. + * If TRUE, matched multiple URI segments will be passed as one parameter. + * + * Default: false + */ + public bool $multipleSegmentsOneParam = false; + + /** + * For Auto Routing (Improved). + * Map of URI segments and namespaces. * * The key is the first URI segment. The value is the controller namespace. * E.g., @@ -107,7 +123,18 @@ class Routing extends BaseRouting * 'blog' => 'Acme\Blog\Controllers', * ] * - * @var array [ uri_segment => namespace ] + * @var array */ public array $moduleRoutes = []; + + /** + * For Auto Routing (Improved). + * Whether to translate dashes in URIs for controller/method to CamelCase. + * E.g., blog-controller -> BlogController + * + * If you enable this, $translateURIDashes is ignored. + * + * Default: false + */ + public bool $translateUriToCamelCase = true; } diff --git a/frameworks/PHP/codeigniter/app/Config/Security.php b/frameworks/PHP/codeigniter/app/Config/Security.php index 57be4ee4154..635f8b77b9b 100644 --- a/frameworks/PHP/codeigniter/app/Config/Security.php +++ b/frameworks/PHP/codeigniter/app/Config/Security.php @@ -79,23 +79,8 @@ class Security extends BaseConfig * -------------------------------------------------------------------------- * * Redirect to previous page with error on failure. - */ - public bool $redirect = false; - - /** - * -------------------------------------------------------------------------- - * 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. + * @see https://codeigniter4.github.io/userguide/libraries/security.html#redirection-on-failure */ - public string $samesite = 'Lax'; + public bool $redirect = (ENVIRONMENT === 'production'); } diff --git a/frameworks/PHP/codeigniter/app/Config/Session.php b/frameworks/PHP/codeigniter/app/Config/Session.php index ea834805e5a..6944710f705 100644 --- a/frameworks/PHP/codeigniter/app/Config/Session.php +++ b/frameworks/PHP/codeigniter/app/Config/Session.php @@ -19,7 +19,7 @@ class Session extends BaseConfig * - `CodeIgniter\Session\Handlers\MemcachedHandler` * - `CodeIgniter\Session\Handlers\RedisHandler` * - * @phpstan-var class-string + * @var class-string */ public string $driver = FileHandler::class; @@ -99,4 +99,29 @@ class Session extends BaseConfig * DB Group for the database session. */ public ?string $DBGroup = null; + + /** + * -------------------------------------------------------------------------- + * Lock Retry Interval (microseconds) + * -------------------------------------------------------------------------- + * + * This is used for RedisHandler. + * + * Time (microseconds) to wait if lock cannot be acquired. + * The default is 100,000 microseconds (= 0.1 seconds). + */ + public int $lockRetryInterval = 100_000; + + /** + * -------------------------------------------------------------------------- + * Lock Max Retries + * -------------------------------------------------------------------------- + * + * This is used for RedisHandler. + * + * Maximum number of lock acquisition attempts. + * The default is 300 times. That is lock timeout is about 30 (0.1 * 300) + * seconds. + */ + public int $lockMaxRetries = 300; } diff --git a/frameworks/PHP/codeigniter/app/Config/Toolbar.php b/frameworks/PHP/codeigniter/app/Config/Toolbar.php index 97fbda28128..5a3e5045d1e 100644 --- a/frameworks/PHP/codeigniter/app/Config/Toolbar.php +++ b/frameworks/PHP/codeigniter/app/Config/Toolbar.php @@ -31,7 +31,7 @@ class Toolbar extends BaseConfig * List of toolbar collectors that will be called when Debug Toolbar * fires up and collects data from. * - * @var string[] + * @var list */ public array $collectors = [ Timers::class, @@ -49,7 +49,7 @@ class Toolbar extends BaseConfig * Collect Var Data * -------------------------------------------------------------------------- * - * If set to false var data from the views will not be colleted. Useful to + * If set to false var data from the views will not be collected. Useful to * avoid high memory usage when there are lots of data passed to the view. */ public bool $collectVarData = true; @@ -99,6 +99,8 @@ class Toolbar extends BaseConfig * We restrict the values to keep performance as high as possible. * * NOTE: The ROOTPATH will be prepended to all values. + * + * @var list */ public array $watchedDirectories = [ 'app', @@ -111,6 +113,8 @@ class Toolbar extends BaseConfig * * Contains an array of file extensions that will be watched for changes and * used to determine if the hot-reload feature should reload the page or not. + * + * @var list */ public array $watchedExtensions = [ 'php', 'css', 'js', 'html', 'svg', 'json', 'env', diff --git a/frameworks/PHP/codeigniter/app/Config/Validation.php b/frameworks/PHP/codeigniter/app/Config/Validation.php index 017dac5a584..6342dbbe7d3 100644 --- a/frameworks/PHP/codeigniter/app/Config/Validation.php +++ b/frameworks/PHP/codeigniter/app/Config/Validation.php @@ -18,7 +18,7 @@ class Validation extends BaseConfig * Stores the classes that contain the * rules that are available. * - * @var string[] + * @var list */ public array $ruleSets = [ Rules::class, diff --git a/frameworks/PHP/codeigniter/app/Config/View.php b/frameworks/PHP/codeigniter/app/Config/View.php index 78cd547e3b8..cf8dd06f106 100644 --- a/frameworks/PHP/codeigniter/app/Config/View.php +++ b/frameworks/PHP/codeigniter/app/Config/View.php @@ -5,6 +5,10 @@ use CodeIgniter\Config\View as BaseView; use CodeIgniter\View\ViewDecoratorInterface; +/** + * @phpstan-type parser_callable (callable(mixed): mixed) + * @phpstan-type parser_callable_string (callable(mixed): mixed)&string + */ class View extends BaseView { /** @@ -30,7 +34,8 @@ class View extends BaseView * { title|esc(js) } * { created_on|date(Y-m-d)|esc(attr) } * - * @var array + * @var array + * @phpstan-var array */ public $filters = []; @@ -39,7 +44,8 @@ class View extends BaseView * by the core Parser by creating aliases that will be replaced with * any callable. Can be single or tag pair. * - * @var array + * @var array|string> + * @phpstan-var array|parser_callable_string|parser_callable> */ public $plugins = []; @@ -50,7 +56,7 @@ class View extends BaseView * * All classes must implement CodeIgniter\View\ViewDecoratorInterface * - * @var class-string[] + * @var list> */ public array $decorators = []; } diff --git a/frameworks/PHP/codeigniter/app/Controllers/BaseController.php b/frameworks/PHP/codeigniter/app/Controllers/BaseController.php deleted file mode 100644 index fb44007e5c7..00000000000 --- a/frameworks/PHP/codeigniter/app/Controllers/BaseController.php +++ /dev/null @@ -1,58 +0,0 @@ -session = \Config\Services::session(); - } -} diff --git a/frameworks/PHP/codeigniter/app/Controllers/Bench.php b/frameworks/PHP/codeigniter/app/Controllers/Bench.php index fd3451938b2..9d6be4f2bd2 100644 --- a/frameworks/PHP/codeigniter/app/Controllers/Bench.php +++ b/frameworks/PHP/codeigniter/app/Controllers/Bench.php @@ -2,10 +2,19 @@ namespace App\Controllers; -use App\Libraries\DbRaw; +use CodeIgniter\Controller; +use CodeIgniter\Database\BaseConnection; +use Config\Database; -class Bench extends BaseController +class Bench extends Controller { + protected static BaseConnection $database; + + protected function database(): BaseConnection + { + return self::$database ??= Database::connect(); + } + public function plaintext() { $this->response->setContentType('text/plain'); @@ -19,7 +28,7 @@ public function json() public function db() { - $worlds = Dbraw::get() + $worlds = $this->database() ->query('SELECT * FROM World WHERE id = ?', array(mt_rand(1, 10000))) ->getRow(); @@ -32,7 +41,7 @@ public function queries($queries = 1) $queries = is_numeric($queries) ? min(max($queries, 1), 500) : 1; for ($i = 0; $i < $queries; ++$i) { - $worlds[] = Dbraw::get() + $worlds[] = $this->database() ->query('SELECT * FROM World WHERE id = ?', array(mt_rand(1, 10000))) ->getRow(); } @@ -47,12 +56,12 @@ public function update($queries = 1) for ($i = 0; $i < $queries; ++$i) { $id = mt_rand(1, 10000); - $world = Dbraw::get() + $world = $this->database() ->query('SELECT * FROM World WHERE id = ?', [$id]) ->getRow(); $world->randomNumber = mt_rand(1, 10000); - Dbraw::get() + $this->database() ->query('UPDATE World SET randomNumber=? WHERE id=?', [$world->randomNumber, $id]); $worlds[] = $world; } @@ -62,7 +71,8 @@ public function update($queries = 1) public function fortunes() { - $fortunes = Dbraw::get() + $data = []; + $fortunes = $this->database() ->query('SELECT * FROM Fortune') ->getResultArray(); diff --git a/frameworks/PHP/codeigniter/app/Controllers/Home.php b/frameworks/PHP/codeigniter/app/Controllers/Home.php deleted file mode 100644 index 59343333099..00000000000 --- a/frameworks/PHP/codeigniter/app/Controllers/Home.php +++ /dev/null @@ -1,11 +0,0 @@ -getFile()) . ':' . $exception->getLine(), 'green')); CLI::newLine(); +$last = $exception; + +while ($prevException = $last->getPrevious()) { + $last = $prevException; + + CLI::write(' Caused by:'); + CLI::write(' [' . $prevException::class . ']', 'red'); + CLI::write(' ' . $prevException->getMessage()); + CLI::write(' at ' . CLI::color(clean_path($prevException->getFile()) . ':' . $prevException->getLine(), 'green')); + CLI::newLine(); +} + // The backtrace if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) { - $backtraces = $exception->getTrace(); + $backtraces = $last->getTrace(); if ($backtraces) { CLI::write('Backtrace:', 'green'); @@ -41,20 +50,11 @@ $function .= $padClass . $error['function']; } - $args = implode(', ', array_map(static function ($value) { - switch (true) { - case is_object($value): - return 'Object(' . get_class($value) . ')'; - - case is_array($value): - return count($value) ? '[...]' : '[]'; - - case $value === null: - return 'null'; // return the lowercased version - - default: - return var_export($value, true); - } + $args = implode(', ', array_map(static fn ($value): string => match (true) { + is_object($value) => 'Object(' . $value::class . ')', + is_array($value) => $value !== [] ? '[...]' : '[]', + $value === null => 'null', // return the lowercased version + default => var_export($value, true), }, array_values($error['args'] ?? []))); $function .= '(' . $args . ')'; diff --git a/frameworks/PHP/codeigniter/app/Views/errors/html/debug.css b/frameworks/PHP/codeigniter/app/Views/errors/html/debug.css index 98f54dbc8a0..b8539a42022 100644 --- a/frameworks/PHP/codeigniter/app/Views/errors/html/debug.css +++ b/frameworks/PHP/codeigniter/app/Views/errors/html/debug.css @@ -3,7 +3,7 @@ --main-text-color: #555; --dark-text-color: #222; --light-text-color: #c7c7c7; - --brand-primary-color: #E06E3F; + --brand-primary-color: #DC4814; --light-bg-color: #ededee; --dark-bg-color: #404040; } @@ -19,7 +19,6 @@ body { } h1 { font-weight: lighter; - letter-spacing: 0.8; font-size: 3rem; color: var(--dark-text-color); margin: 0; @@ -42,9 +41,10 @@ p.lead { .header { background: var(--light-bg-color); color: var(--dark-text-color); + margin-top: 2.17rem; } .header .container { - padding: 1rem 1.75rem 1.75rem 1.75rem; + padding: 1rem; } .header h1 { font-size: 2.5rem; @@ -65,14 +65,14 @@ p.lead { display: inline; } -.footer { - background: var(--dark-bg-color); - color: var(--light-text-color); -} -.footer .container { - border-top: 1px solid #e7e7e7; - margin-top: 1rem; +.environment { + background: var(--brand-primary-color); + color: var(--main-bg-color); text-align: center; + padding: calc(4px + 0.2083vw); + width: 100%; + top: 0; + position: fixed; } .source { @@ -112,7 +112,7 @@ p.lead { } .tabs a:link, .tabs a:visited { - padding: 0rem 1rem; + padding: 0 1rem; line-height: 2.7; text-decoration: none; color: var(--dark-text-color); @@ -152,9 +152,6 @@ p.lead { border-radius: 5px; color: #31708f; } -ul, ol { - line-height: 1.8; -} table { width: 100%; diff --git a/frameworks/PHP/codeigniter/app/Views/errors/html/error_400.php b/frameworks/PHP/codeigniter/app/Views/errors/html/error_400.php new file mode 100644 index 00000000000..555da042be3 --- /dev/null +++ b/frameworks/PHP/codeigniter/app/Views/errors/html/error_400.php @@ -0,0 +1,84 @@ + + + + + <?= lang('Errors.badRequest') ?> + + + + +
+

400

+ +

+ + + + + +

+
+ + diff --git a/frameworks/PHP/codeigniter/app/Views/errors/html/error_404.php b/frameworks/PHP/codeigniter/app/Views/errors/html/error_404.php index c3010132f9b..e506f08350e 100644 --- a/frameworks/PHP/codeigniter/app/Views/errors/html/error_404.php +++ b/frameworks/PHP/codeigniter/app/Views/errors/html/error_404.php @@ -77,7 +77,7 @@ - +

diff --git a/frameworks/PHP/codeigniter/app/Views/errors/html/error_exception.php b/frameworks/PHP/codeigniter/app/Views/errors/html/error_exception.php index f311d910c0f..2c4e0091136 100644 --- a/frameworks/PHP/codeigniter/app/Views/errors/html/error_exception.php +++ b/frameworks/PHP/codeigniter/app/Views/errors/html/error_exception.php @@ -1,5 +1,5 @@
+
+ Displayed at — + PHP: — + CodeIgniter: -- + Environment: +

getCode() ? ' #' . $exception->getCode() : '') ?>

@@ -44,6 +50,30 @@

+
+ getPrevious()) { + $last = $prevException; + ?> + +
+    Caused by:
+    getCode() ? ' #' . $prevException->getCode() : '') ?>
+
+    getMessage())) ?>
+    getMessage())) ?>"
+       rel="noreferrer" target="_blank">search →
+    getFile()) . ':' . $prevException->getLine()) ?>
+    
+ + +
+ +
    @@ -66,7 +96,7 @@
  • - + getParameters(); } @@ -194,7 +224,7 @@

    - + @@ -204,7 +234,7 @@ - + @@ -288,10 +318,20 @@ - + $value) : ?> - - + + @@ -302,7 +342,7 @@ setStatusCode(http_response_code()); ?>
    @@ -315,8 +355,6 @@ headers(); ?> - -

    Headers

    HTTP MethodgetMethod())) ?>getMethod()) ?>
    IP Address
    getName(), 'html') ?>getValueLine(), 'html') ?> + getValueLine(), 'html'); + } else { + foreach ($value as $i => $header) { + echo ' ('. $i+1 . ') ' . esc($header->getValueLine(), 'html'); + } + } + ?> +
    @@ -327,10 +365,20 @@ - + $value) : ?> - + @@ -375,18 +423,7 @@ - - + diff --git a/frameworks/PHP/codeigniter/app/Views/welcome_message.php b/frameworks/PHP/codeigniter/app/Views/welcome_message.php deleted file mode 100644 index 6d5da23f122..00000000000 --- a/frameworks/PHP/codeigniter/app/Views/welcome_message.php +++ /dev/null @@ -1,325 +0,0 @@ - - - - - Welcome to CodeIgniter 4! - - - - - - - - - - - -
    - - - -
    - -

    Welcome to CodeIgniter

    - -

    The small framework with powerful features

    - -
    - -
    - - - -
    - -

    About this page

    - -

    The page you are looking at is being generated dynamically by CodeIgniter.

    - -

    If you would like to edit this page you will find it located at:

    - -
    app/Views/welcome_message.php
    - -

    The corresponding controller for this page can be found at:

    - -
    app/Controllers/Home.php
    - -
    - -
    - -
    - -

    Go further

    - -

    - - Learn -

    - -

    The User Guide contains an introduction, tutorial, a number of "how to" - guides, and then reference documentation for the components that make up - the framework. Check the User Guide !

    - -

    - - Discuss -

    - -

    CodeIgniter is a community-developed open source project, with several - venues for the community members to gather and exchange ideas. View all - the threads on CodeIgniter's forum, or chat on Slack !

    - -

    - - Contribute -

    - -

    CodeIgniter is a community driven project and accepts contributions - of code and documentation from the community. Why not - - join us ?

    - -
    - -
    - - - -
    -
    - -

    Page rendered in {elapsed_time} seconds

    - -

    Environment:

    - -
    - -
    - -

    © CodeIgniter Foundation. CodeIgniter is open source project released under the MIT - open source licence.

    - -
    - -
    - - - - - - - - - diff --git a/frameworks/PHP/codeigniter/codeigniter.dockerfile b/frameworks/PHP/codeigniter/codeigniter.dockerfile index 0737e1eeed9..ff1d472be1d 100644 --- a/frameworks/PHP/codeigniter/codeigniter.dockerfile +++ b/frameworks/PHP/codeigniter/codeigniter.dockerfile @@ -11,19 +11,18 @@ RUN apt-get update > /dev/null && apt-get install -yqq nginx git unzip \ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer -COPY deploy/conf/* /etc/php/8.5/fpm/ +COPY ./deploy/conf/ /etc/php/8.5/fpm/ +RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.5/fpm/pool.d/www.conf ; fi; -ADD ./ /codeigniter -WORKDIR /codeigniter - -RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.5/fpm/php-fpm.conf ; fi; +COPY ./deploy/nginx.conf /etc/nginx/ -RUN composer install --optimize-autoloader --classmap-authoritative --no-dev -#--quiet - -RUN chmod -R 777 writable +COPY --chown=www-data:www-data ./ /codeigniter/ +WORKDIR /codeigniter +RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --no-progress && \ + echo "opcache.preload=/codeigniter/preload.php" >> /etc/php/8.5/fpm/php.ini && \ + php spark optimize EXPOSE 8080 CMD service php8.5-fpm start && \ - nginx -c /codeigniter/deploy/nginx.conf + nginx diff --git a/frameworks/PHP/codeigniter/composer.json b/frameworks/PHP/codeigniter/composer.json old mode 100755 new mode 100644 index 76598d89ca0..28983f267c2 --- a/frameworks/PHP/codeigniter/composer.json +++ b/frameworks/PHP/codeigniter/composer.json @@ -1,16 +1,12 @@ { - "require": { - "php": "^7.4 || ^8", - "codeigniter4/framework": "^4.0" - }, - "autoload": { - "exclude-from-classmap": [ - "**/Database/Migrations/**" - ] - }, - "support": { - "forum": "http://forum.codeigniter.com/", - "source": "https://github.com/codeigniter4/CodeIgniter4", - "slack": "https://codeigniterchat.slack.com" + "require": { + "php": "^8.2", + "codeigniter4/framework": "^4.6" + }, + "autoload": { + "psr-4": { + "App\\": "app/", + "Config\\": "app/Config" } + } } diff --git a/frameworks/PHP/codeigniter/deploy/conf/php-fpm.conf b/frameworks/PHP/codeigniter/deploy/conf/php-fpm.conf index ba6f2b076e7..61778eb35cf 100644 --- a/frameworks/PHP/codeigniter/deploy/conf/php-fpm.conf +++ b/frameworks/PHP/codeigniter/deploy/conf/php-fpm.conf @@ -14,6 +14,8 @@ ; Pid file ; Note: the default prefix is /var ; Default Value: none +; Warning: if you change the value here, you need to modify systemd +; service PIDFile= setting to match the value here. pid = /run/php/php-fpm.pid ; Error log file @@ -23,7 +25,6 @@ pid = /run/php/php-fpm.pid ; Default Value: log/php-fpm.log error_log = /dev/stderr - ; syslog_facility is used to specify what type of program is logging the ; message. This lets syslogd specify that messages from different facilities ; will be handled differently. @@ -42,6 +43,24 @@ error_log = /dev/stderr ; Default Value: notice ;log_level = notice +; Log limit on number of characters in the single line (log entry). If the +; line is over the limit, it is wrapped on multiple lines. The limit is for +; all logged characters including message prefix and suffix if present. However +; the new line character does not count into it as it is present only when +; logging to a file descriptor. It means the new line character is not present +; when logging to syslog. +; Default Value: 1024 +;log_limit = 4096 + +; Log buffering specifies if the log line is buffered which means that the +; line is written in a single write operation. If the value is false, then the +; data is written directly into the file descriptor. It is an experimental +; option that can potentially improve logging performance and memory usage +; for some heavy logging scenarios. This option is ignored if logging to syslog +; as it has to be always buffered. +; Default value: yes +;log_buffering = no + ; If this number of child processes exit with SIGSEGV or SIGBUS within the time ; interval set by emergency_restart_interval then FPM will restart. A value ; of '0' means 'Off'. @@ -95,7 +114,6 @@ error_log = /dev/stderr ; - poll (any POSIX os) ; - epoll (linux >= 2.5.44) ; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0) -; - /dev/poll (Solaris >= 7) ; - port (Solaris >= 10) ; Default Value: not set (auto detection) ;events.mechanism = epoll @@ -123,428 +141,4 @@ systemd_interval = 0 ; Relative path can also be used. They will be prefixed by: ; - the global prefix if it's been set (-p argument) ; - /usr otherwise -;include=/etc/php/7.3/fpm/pool.d/*.conf - -; Start a new pool named 'www'. -; the variable $pool can be used in any directive and will be replaced by the -; pool name ('www' here) -[www] - -; Per pool prefix -; It only applies on the following directives: -; - 'access.log' -; - 'slowlog' -; - 'listen' (unixsocket) -; - 'chroot' -; - 'chdir' -; - 'php_values' -; - 'php_admin_values' -; When not set, the global prefix (or /usr) applies instead. -; Note: This directive can also be relative to the global prefix. -; Default Value: none -;prefix = /path/to/pools/$pool - -; Unix user/group of processes -; Note: The user is mandatory. If the group is not set, the default user's group -; will be used. -user = www-data -group = www-data - -; The address on which to accept FastCGI requests. -; Valid syntaxes are: -; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on -; a specific port; -; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on -; a specific port; -; 'port' - to listen on a TCP socket to all addresses -; (IPv6 and IPv4-mapped) on a specific port; -; '/path/to/unix/socket' - to listen on a unix socket. -; Note: This value is mandatory. -listen = /run/php/php-fpm.sock - -; Set listen(2) backlog. -; Default Value: 511 (-1 on FreeBSD and OpenBSD) -listen.backlog = 65535 - -; Set permissions for unix socket, if one is used. In Linux, read/write -; permissions must be set in order to allow connections from a web server. Many -; BSD-derived systems allow connections regardless of permissions. -; Default Values: user and group are set as the running user -; mode is set to 0660 -listen.owner = www-data -listen.group = www-data -;listen.mode = 0660 -; When POSIX Access Control Lists are supported you can set them using -; these options, value is a comma separated list of user/group names. -; When set, listen.owner and listen.group are ignored -;listen.acl_users = -;listen.acl_groups = - -; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. -; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original -; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address -; must be separated by a comma. If this value is left blank, connections will be -; accepted from any ip address. -; Default Value: any -;listen.allowed_clients = 127.0.0.1 - -; Specify the nice(2) priority to apply to the pool processes (only if set) -; The value can vary from -19 (highest priority) to 20 (lower priority) -; Note: - It will only work if the FPM master process is launched as root -; - The pool processes will inherit the master process priority -; unless it specified otherwise -; Default Value: no set -; process.priority = -19 - -; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user -; or group is differrent than the master process user. It allows to create process -; core dump and ptrace the process for the pool user. -; Default Value: no -; process.dumpable = yes - -; Choose how the process manager will control the number of child processes. -; Possible Values: -; static - a fixed number (pm.max_children) of child processes; -; dynamic - the number of child processes are set dynamically based on the -; following directives. With this process management, there will be -; always at least 1 children. -; pm.max_children - the maximum number of children that can -; be alive at the same time. -; pm.start_servers - the number of children created on startup. -; pm.min_spare_servers - the minimum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is less than this -; number then some children will be created. -; pm.max_spare_servers - the maximum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is greater than this -; number then some children will be killed. -; ondemand - no children are created at startup. Children will be forked when -; new requests will connect. The following parameter are used: -; pm.max_children - the maximum number of children that -; can be alive at the same time. -; pm.process_idle_timeout - The number of seconds after which -; an idle process will be killed. -; Note: This value is mandatory. -pm = static - -; The number of child processes to be created when pm is set to 'static' and the -; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. -; This value sets the limit on the number of simultaneous requests that will be -; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. -; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP -; CGI. The below defaults are based on a server without much resources. Don't -; forget to tweak pm.* to fit your needs. -; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' -; Note: This value is mandatory. -pm.max_children = 1024 - -; The number of child processes created on startup. -; Note: Used only when pm is set to 'dynamic' -; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 -pm.start_servers = 512 - -; The desired minimum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.min_spare_servers = 50 - -; The desired maximum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.max_spare_servers = 512 - -; The number of seconds after which an idle process will be killed. -; Note: Used only when pm is set to 'ondemand' -; Default Value: 10s -;pm.process_idle_timeout = 10s; - -; The number of requests each child process should execute before respawning. -; This can be useful to work around memory leaks in 3rd party libraries. For -; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. -; Default Value: 0 -;pm.max_requests = 500 - -; The URI to view the FPM status page. If this value is not set, no URI will be -; recognized as a status page. It shows the following informations: -; pool - the name of the pool; -; process manager - static, dynamic or ondemand; -; start time - the date and time FPM has started; -; start since - number of seconds since FPM has started; -; accepted conn - the number of request accepted by the pool; -; listen queue - the number of request in the queue of pending -; connections (see backlog in listen(2)); -; max listen queue - the maximum number of requests in the queue -; of pending connections since FPM has started; -; listen queue len - the size of the socket queue of pending connections; -; idle processes - the number of idle processes; -; active processes - the number of active processes; -; total processes - the number of idle + active processes; -; max active processes - the maximum number of active processes since FPM -; has started; -; max children reached - number of times, the process limit has been reached, -; when pm tries to start more children (works only for -; pm 'dynamic' and 'ondemand'); -; Value are updated in real time. -; Example output: -; pool: www -; process manager: static -; start time: 01/Jul/2011:17:53:49 +0200 -; start since: 62636 -; accepted conn: 190460 -; listen queue: 0 -; max listen queue: 1 -; listen queue len: 42 -; idle processes: 4 -; active processes: 11 -; total processes: 15 -; max active processes: 12 -; max children reached: 0 -; -; By default the status page output is formatted as text/plain. Passing either -; 'html', 'xml' or 'json' in the query string will return the corresponding -; output syntax. Example: -; http://www.foo.bar/status -; http://www.foo.bar/status?json -; http://www.foo.bar/status?html -; http://www.foo.bar/status?xml -; -; By default the status page only outputs short status. Passing 'full' in the -; query string will also return status for each pool process. -; Example: -; http://www.foo.bar/status?full -; http://www.foo.bar/status?json&full -; http://www.foo.bar/status?html&full -; http://www.foo.bar/status?xml&full -; The Full status returns for each process: -; pid - the PID of the process; -; state - the state of the process (Idle, Running, ...); -; start time - the date and time the process has started; -; start since - the number of seconds since the process has started; -; requests - the number of requests the process has served; -; request duration - the duration in µs of the requests; -; request method - the request method (GET, POST, ...); -; request URI - the request URI with the query string; -; content length - the content length of the request (only with POST); -; user - the user (PHP_AUTH_USER) (or '-' if not set); -; script - the main script called (or '-' if not set); -; last request cpu - the %cpu the last request consumed -; it's always 0 if the process is not in Idle state -; because CPU calculation is done when the request -; processing has terminated; -; last request memory - the max amount of memory the last request consumed -; it's always 0 if the process is not in Idle state -; because memory calculation is done when the request -; processing has terminated; -; If the process is in Idle state, then informations are related to the -; last request the process has served. Otherwise informations are related to -; the current request being served. -; Example output: -; ************************ -; pid: 31330 -; state: Running -; start time: 01/Jul/2011:17:53:49 +0200 -; start since: 63087 -; requests: 12808 -; request duration: 1250261 -; request method: GET -; request URI: /test_mem.php?N=10000 -; content length: 0 -; user: - -; script: /home/fat/web/docs/php/test_mem.php -; last request cpu: 0.00 -; last request memory: 0 -; -; Note: There is a real-time FPM status monitoring sample web page available -; It's available in: /usr/share/php/7.3/fpm/status.html -; -; Note: The value must start with a leading slash (/). The value can be -; anything, but it may not be a good idea to use the .php extension or it -; may conflict with a real PHP file. -; Default Value: not set -;pm.status_path = /status - -; The ping URI to call the monitoring page of FPM. If this value is not set, no -; URI will be recognized as a ping page. This could be used to test from outside -; that FPM is alive and responding, or to -; - create a graph of FPM availability (rrd or such); -; - remove a server from a group if it is not responding (load balancing); -; - trigger alerts for the operating team (24/7). -; Note: The value must start with a leading slash (/). The value can be -; anything, but it may not be a good idea to use the .php extension or it -; may conflict with a real PHP file. -; Default Value: not set -;ping.path = /ping - -; This directive may be used to customize the response of a ping request. The -; response is formatted as text/plain with a 200 response code. -; Default Value: pong -;ping.response = pong - -; The access log file -; Default: not set -;access.log = log/$pool.access.log - -; The access log format. -; The following syntax is allowed -; %%: the '%' character -; %C: %CPU used by the request -; it can accept the following format: -; - %{user}C for user CPU only -; - %{system}C for system CPU only -; - %{total}C for user + system CPU (default) -; %d: time taken to serve the request -; it can accept the following format: -; - %{seconds}d (default) -; - %{miliseconds}d -; - %{mili}d -; - %{microseconds}d -; - %{micro}d -; %e: an environment variable (same as $_ENV or $_SERVER) -; it must be associated with embraces to specify the name of the env -; variable. Some exemples: -; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e -; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e -; %f: script filename -; %l: content-length of the request (for POST request only) -; %m: request method -; %M: peak of memory allocated by PHP -; it can accept the following format: -; - %{bytes}M (default) -; - %{kilobytes}M -; - %{kilo}M -; - %{megabytes}M -; - %{mega}M -; %n: pool name -; %o: output header -; it must be associated with embraces to specify the name of the header: -; - %{Content-Type}o -; - %{X-Powered-By}o -; - %{Transfert-Encoding}o -; - .... -; %p: PID of the child that serviced the request -; %P: PID of the parent of the child that serviced the request -; %q: the query string -; %Q: the '?' character if query string exists -; %r: the request URI (without the query string, see %q and %Q) -; %R: remote IP address -; %s: status (response code) -; %t: server time the request was received -; it can accept a strftime(3) format: -; %d/%b/%Y:%H:%M:%S %z (default) -; The strftime(3) format must be encapsuled in a %{}t tag -; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t -; %T: time the log has been written (the request has finished) -; it can accept a strftime(3) format: -; %d/%b/%Y:%H:%M:%S %z (default) -; The strftime(3) format must be encapsuled in a %{}t tag -; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t -; %u: remote user -; -; Default: "%R - %u %t \"%m %r\" %s" -;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" - -; The log file for slow requests -; Default Value: not set -; Note: slowlog is mandatory if request_slowlog_timeout is set -;slowlog = log/$pool.log.slow - -; The timeout for serving a single request after which a PHP backtrace will be -; dumped to the 'slowlog' file. A value of '0s' means 'off'. -; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) -; Default Value: 0 -;request_slowlog_timeout = 0 - -; Depth of slow log stack trace. -; Default Value: 20 -;request_slowlog_trace_depth = 20 - -; The timeout for serving a single request after which the worker process will -; be killed. This option should be used when the 'max_execution_time' ini option -; does not stop script execution for some reason. A value of '0' means 'off'. -; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) -; Default Value: 0 -;request_terminate_timeout = 0 - -; Set open file descriptor rlimit. -; Default Value: system defined value -;rlimit_files = 1024 - -; Set max core size rlimit. -; Possible Values: 'unlimited' or an integer greater or equal to 0 -; Default Value: system defined value -;rlimit_core = 0 - -; Chroot to this directory at the start. This value must be defined as an -; absolute path. When this value is not set, chroot is not used. -; Note: you can prefix with '$prefix' to chroot to the pool prefix or one -; of its subdirectories. If the pool prefix is not set, the global prefix -; will be used instead. -; Note: chrooting is a great security feature and should be used whenever -; possible. However, all PHP paths will be relative to the chroot -; (error_log, sessions.save_path, ...). -; Default Value: not set -;chroot = - -; Chdir to this directory at the start. -; Note: relative path can be used. -; Default Value: current directory or / when chroot -;chdir = /var/www - -; Redirect worker stdout and stderr into main error log. If not set, stdout and -; stderr will be redirected to /dev/null according to FastCGI specs. -; Note: on highloaded environement, this can cause some delay in the page -; process time (several ms). -; Default Value: no -;catch_workers_output = yes - -; Clear environment in FPM workers -; Prevents arbitrary environment variables from reaching FPM worker processes -; by clearing the environment in workers before env vars specified in this -; pool configuration are added. -; Setting to "no" will make all environment variables available to PHP code -; via getenv(), $_ENV and $_SERVER. -; Default Value: yes -;clear_env = no - -; Limits the extensions of the main script FPM will allow to parse. This can -; prevent configuration mistakes on the web server side. You should only limit -; FPM to .php extensions to prevent malicious users to use other extensions to -; execute php code. -; Note: set an empty value to allow all extensions. -; Default Value: .php -;security.limit_extensions = .php .php3 .php4 .php5 .php7 - -; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from -; the current environment. -; Default Value: clean env -;env[HOSTNAME] = $HOSTNAME -;env[PATH] = /usr/local/bin:/usr/bin:/bin -;env[TMP] = /tmp -;env[TMPDIR] = /tmp -;env[TEMP] = /tmp - -; Additional php.ini defines, specific to this pool of workers. These settings -; overwrite the values previously defined in the php.ini. The directives are the -; same as the PHP SAPI: -; php_value/php_flag - you can set classic ini defines which can -; be overwritten from PHP call 'ini_set'. -; php_admin_value/php_admin_flag - these directives won't be overwritten by -; PHP call 'ini_set' -; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. - -; Defining 'extension' will load the corresponding shared extension from -; extension_dir. Defining 'disable_functions' or 'disable_classes' will not -; overwrite previously defined php.ini values, but will append the new value -; instead. - -; Note: path INI options can be relative and will be expanded with the prefix -; (pool, global or /usr) - -; Default Value: nothing is defined by default except the values in php.ini and -; specified at startup with the -d argument -;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com -;php_flag[display_errors] = off -;php_admin_value[error_log] = /var/log/fpm-php.www.log -;php_admin_flag[log_errors] = on -;php_admin_value[memory_limit] = 32M \ No newline at end of file +include=/etc/php/8.5/fpm/pool.d/*.conf diff --git a/frameworks/PHP/codeigniter/deploy/conf/php.ini b/frameworks/PHP/codeigniter/deploy/conf/php.ini index 82133535145..730c1a7d121 100644 --- a/frameworks/PHP/codeigniter/deploy/conf/php.ini +++ b/frameworks/PHP/codeigniter/deploy/conf/php.ini @@ -9,15 +9,15 @@ ; PHP attempts to find and load this configuration from a number of locations. ; The following is a summary of its search order: ; 1. SAPI module specific location. -; 2. The PHPRC environment variable. (As of PHP 5.2.0) -; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) +; 2. The PHPRC environment variable. +; 3. A number of predefined registry keys on Windows ; 4. Current working directory (except CLI) ; 5. The web server's directory (for SAPI modules), or directory of PHP ; (otherwise in Windows) ; 6. The directory from the --with-config-file-path compile time option, or the -; Windows directory (C:\windows or C:\winnt) +; Windows directory (usually C:\windows) ; See the PHP docs for more specific information. -; http://php.net/configuration.file +; https://php.net/configuration.file ; The syntax of the file is extremely simple. Whitespace and lines ; beginning with a semicolon are silently ignored (as you probably guessed). @@ -31,7 +31,7 @@ ; special sections cannot be overridden by user-defined INI files or ; at runtime. Currently, [PATH=] and [HOST=] sections only work under ; CGI/FastCGI. -; http://php.net/ini.sections +; https://php.net/ini.sections ; Directives are specified using the following syntax: ; directive = value @@ -58,9 +58,9 @@ ; An empty string can be denoted by simply not writing anything after the equal ; sign, or by using the None keyword: -; foo = ; sets foo to an empty string -; foo = None ; sets foo to an empty string -; foo = "None" ; sets foo to the string 'None' +; foo = ; sets foo to an empty string +; foo = None ; sets foo to an empty string +; foo = "None" ; sets foo to the string 'None' ; If you use constants in your value, and these constants belong to a ; dynamically loaded extension (either a PHP extension or a Zend extension), @@ -75,7 +75,7 @@ ; php.ini-production contains settings which hold security, performance and ; best practices at its core. But please be aware, these settings may break -; compatibility with older or less security conscience applications. We +; compatibility with older or less security-conscious applications. We ; recommending using the production ini in production and testing environments. ; php.ini-development is very similar to its production variant, except it is @@ -83,11 +83,12 @@ ; development version only in development environments, as errors shown to ; application users can inadvertently leak otherwise secure information. -; This is php.ini-production INI file. +; This is the php.ini-production INI file. ;;;;;;;;;;;;;;;;;;; ; Quick Reference ; ;;;;;;;;;;;;;;;;;;; + ; The following are all the settings which are different in either the production ; or development versions of the INIs with respect to PHP's default behavior. ; Please see the actual settings later in the document for more details as to why @@ -99,19 +100,14 @@ ; Production Value: Off ; display_startup_errors -; Default Value: Off +; Default Value: On ; Development Value: On ; Production Value: Off ; error_reporting -; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Default Value: E_ALL ; Development Value: E_ALL -; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT - -; html_errors -; Default Value: On -; Development Value: On -; Production value: On +; Production Value: E_ALL & ~E_DEPRECATED ; log_errors ; Default Value: Off @@ -123,16 +119,16 @@ ; Development Value: 60 (60 seconds) ; Production Value: 60 (60 seconds) +; mysqlnd.collect_memory_statistics +; Default Value: Off +; Development Value: On +; Production Value: Off + ; output_buffering ; Default Value: Off ; Development Value: 4096 ; Production Value: 4096 -; register_argc_argv -; Default Value: On -; Development Value: Off -; Production Value: Off - ; request_order ; Default Value: None ; Development Value: "GP" @@ -143,33 +139,38 @@ ; Development Value: 1000 ; Production Value: 1000 -; session.sid_bits_per_character -; Default Value: 4 -; Development Value: 5 -; Production Value: 5 - ; short_open_tag ; Default Value: On ; Development Value: Off ; Production Value: Off -; track_errors -; Default Value: Off -; Development Value: On -; Production Value: Off - ; variables_order ; Default Value: "EGPCS" ; Development Value: "GPCS" ; Production Value: "GPCS" +; zend.assertions +; Default Value: 1 +; Development Value: 1 +; Production Value: -1 + +; zend.exception_ignore_args +; Default Value: Off +; Development Value: Off +; Production Value: On + +; zend.exception_string_param_max_len +; Default Value: 15 +; Development Value: 15 +; Production Value: 0 + ;;;;;;;;;;;;;;;;;;;; ; php.ini Options ; ;;;;;;;;;;;;;;;;;;;; ; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" ;user_ini.filename = ".user.ini" -; To disable this feature set this option to empty value +; To disable this feature set this option to an empty value ;user_ini.filename = ; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) @@ -180,7 +181,7 @@ ;;;;;;;;;;;;;;;;;;;; ; Enable the PHP scripting language engine under Apache. -; http://php.net/engine +; https://php.net/engine engine = On ; This directive determines whether or not PHP will recognize code between @@ -193,11 +194,11 @@ engine = On ; Default Value: On ; Development Value: Off ; Production Value: Off -; http://php.net/short-open-tag +; https://php.net/short-open-tag short_open_tag = Off ; The number of significant digits displayed in floating point numbers. -; http://php.net/precision +; https://php.net/precision precision = 14 ; Output buffering is a mechanism for controlling how much output data @@ -221,7 +222,7 @@ precision = 14 ; Default Value: Off ; Development Value: 4096 ; Production Value: 4096 -; http://php.net/output-buffering +; https://php.net/output-buffering output_buffering = 4096 ; You can redirect all of the output of your scripts to a function. For @@ -236,7 +237,7 @@ output_buffering = 4096 ; and you cannot use both "ob_gzhandler" and "zlib.output_compression". ; Note: output_handler must be empty if this is set 'On' !!!! ; Instead you must use zlib.output_handler. -; http://php.net/output-handler +; https://php.net/output-handler ;output_handler = ; URL rewriter function rewrites URL on the fly by using @@ -248,7 +249,7 @@ output_buffering = 4096 ; Production Value: "form=" ;url_rewriter.tags -; URL rewriter will not rewrites absolute URL nor form by default. To enable +; URL rewriter will not rewrite absolute URL nor form by default. To enable ; absolute URL rewrite, allowed hosts must be defined at RUNTIME. ; Refer to session.trans_sid_hosts for more details. ; Default Value: "" @@ -265,16 +266,16 @@ output_buffering = 4096 ; performance, enable output_buffering in addition. ; Note: You need to use zlib.output_handler instead of the standard ; output_handler, or otherwise the output will be corrupted. -; http://php.net/zlib.output-compression +; https://php.net/zlib.output-compression zlib.output_compression = Off -; http://php.net/zlib.output-compression-level +; https://php.net/zlib.output-compression-level ;zlib.output_compression_level = -1 ; You cannot specify additional output handlers if zlib.output_compression ; is activated here. This setting does the same as output_handler but in ; a different order. -; http://php.net/zlib.output-handler +; https://php.net/zlib.output-handler ;zlib.output_handler = ; Implicit flush tells PHP to tell the output layer to flush itself @@ -282,7 +283,7 @@ zlib.output_compression = Off ; PHP function flush() after each and every call to print() or echo() and each ; and every HTML block. Turning this option on has serious performance ; implications and is generally recommended for debugging purposes only. -; http://php.net/implicit-flush +; https://php.net/implicit-flush ; Note: This directive is hardcoded to On for the CLI SAPI implicit_flush = Off @@ -294,6 +295,13 @@ implicit_flush = Off ; callback-function. unserialize_callback_func = +; The unserialize_max_depth specifies the default depth limit for unserialized +; structures. Setting the depth limit too high may result in stack overflows +; during unserialization. The unserialize_max_depth ini setting can be +; overridden by the max_depth option on individual unserialize() calls. +; A value of 0 disables the depth limit. +;unserialize_max_depth = 4096 + ; When floats & doubles are serialized, store serialize_precision significant ; digits after the floating point. The default value ensures that when floats ; are decoded with unserialize, the data will remain the same. @@ -305,22 +313,18 @@ serialize_precision = -1 ; open_basedir, if set, limits all file operations to the defined directory ; and below. This directive makes most sense if used in a per-directory ; or per-virtualhost web server configuration file. -; http://php.net/open-basedir +; Note: disables the realpath cache +; https://php.net/open-basedir ;open_basedir = -; This directive allows you to disable certain functions for security reasons. +; This directive allows you to disable certain functions. ; It receives a comma-delimited list of function names. -; http://php.net/disable-functions +; https://php.net/disable-functions disable_functions = -; This directive allows you to disable certain classes for security reasons. -; It receives a comma-delimited list of class names. -; http://php.net/disable-classes -disable_classes = - ; Colors for Syntax Highlighting mode. Anything that's acceptable in ; would work. -; http://php.net/syntax-highlighting +; https://php.net/syntax-highlighting ;highlight.string = #DD0000 ;highlight.comment = #FF9900 ;highlight.keyword = #007700 @@ -331,37 +335,54 @@ disable_classes = ; the request. Consider enabling it if executing long requests, which may end up ; being interrupted by the user or a browser timing out. PHP's default behavior ; is to disable this feature. -; http://php.net/ignore-user-abort +; https://php.net/ignore-user-abort ;ignore_user_abort = On ; Determines the size of the realpath cache to be used by PHP. This value should ; be increased on systems where PHP opens many files to reflect the quantity of ; the file operations performed. -; http://php.net/realpath-cache-size +; Note: if open_basedir is set, the cache is disabled +; https://php.net/realpath-cache-size realpath_cache_size = 4096k ; Duration of time, in seconds for which to cache realpath information for a given ; file or directory. For systems with rarely changing files, consider increasing this ; value. -; http://php.net/realpath-cache-ttl +; https://php.net/realpath-cache-ttl realpath_cache_ttl = 600 ; Enables or disables the circular reference collector. -; http://php.net/zend.enable-gc +; https://php.net/zend.enable-gc zend.enable_gc = On ; If enabled, scripts may be written in encodings that are incompatible with ; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such ; encodings. To use this feature, mbstring extension must be enabled. -; Default: Off ;zend.multibyte = Off ; Allows to set the default encoding for the scripts. This value will be used ; unless "declare(encoding=...)" directive appears at the top of the script. ; Only affects if zend.multibyte is set. -; Default: "" ;zend.script_encoding = +; Allows to include or exclude arguments from stack traces generated for exceptions. +; In production, it is recommended to turn this setting on to prohibit the output +; of sensitive information in stack traces +; Default Value: Off +; Development Value: Off +; Production Value: On +zend.exception_ignore_args = On + +; Allows setting the maximum string length in an argument of a stringified stack trace +; to a value between 0 and 1000000. +; This has no effect when zend.exception_ignore_args is enabled. +; Default Value: 15 +; Development Value: 15 +; Production Value: 0 +; In production, it is recommended to set this to 0 to reduce the output +; of sensitive information in stack traces. +zend.exception_string_param_max_len = 0 + ;;;;;;;;;;;;;;;;; ; Miscellaneous ; ;;;;;;;;;;;;;;;;; @@ -370,7 +391,7 @@ zend.enable_gc = On ; (e.g. by adding its signature to the Web server header). It is no security ; threat in any way, but it makes it possible to determine whether you use PHP ; on your server or not. -; http://php.net/expose-php +; https://php.net/expose-php expose_php = Off ;;;;;;;;;;;;;;;;;;; @@ -378,7 +399,7 @@ expose_php = Off ;;;;;;;;;;;;;;;;;;; ; Maximum execution time of each script, in seconds -; http://php.net/max-execution-time +; https://php.net/max-execution-time ; Note: This directive is hardcoded to 0 for the CLI SAPI max_execution_time = 30 @@ -389,19 +410,25 @@ max_execution_time = 30 ; Default Value: -1 (Unlimited) ; Development Value: 60 (60 seconds) ; Production Value: 60 (60 seconds) -; http://php.net/max-input-time +; https://php.net/max-input-time max_input_time = 60 ; Maximum input variable nesting level -; http://php.net/max-input-nesting-level +; https://php.net/max-input-nesting-level ;max_input_nesting_level = 64 ; How many GET/POST/COOKIE input variables may be accepted -; max_input_vars = 1000 +;max_input_vars = 1000 -; Maximum amount of memory a script may consume (128MB) -; http://php.net/memory-limit +; How many multipart body parts (combined input variable and file uploads) may +; be accepted. +; Default Value: -1 (Sum of max_input_vars and max_file_uploads) +;max_multipart_body_parts = 1500 + +; Maximum amount of memory a script may consume +; https://php.net/memory-limit memory_limit = 128M +max_memory_limit = -1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Error handling and logging ; @@ -413,7 +440,7 @@ memory_limit = 128M ; operators. The error level constants are below here for convenience as well as ; some common settings and their meanings. ; By default, PHP is set to take action on all errors, notices and warnings EXCEPT -; those related to E_NOTICE and E_STRICT, which together cover best practices and +; those related to E_NOTICE, which together cover best practices and ; recommended coding standards in PHP. For performance reasons, this is the ; recommend error reporting setting. Your production server shouldn't be wasting ; resources complaining about best practices and coding standards. That's what @@ -423,7 +450,7 @@ memory_limit = 128M ; development and early testing. ; ; Error Level Constants: -; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) +; E_ALL - All errors and warnings ; E_ERROR - fatal run-time errors ; E_RECOVERABLE_ERROR - almost fatal run-time errors ; E_WARNING - run-time warnings (non-fatal errors) @@ -433,9 +460,6 @@ memory_limit = 128M ; intentional (e.g., using an uninitialized variable and ; relying on the fact it is automatically initialized to an ; empty string) -; E_STRICT - run-time notices, enable to have PHP suggest changes -; to your code which will ensure the best interoperability -; and forward compatibility of your code ; E_CORE_ERROR - fatal errors that occur during PHP's initial startup ; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's ; initial startup @@ -451,13 +475,12 @@ memory_limit = 128M ; Common Values: ; E_ALL (Show all errors, warnings and notices including coding standards.) ; E_ALL & ~E_NOTICE (Show all errors, except for notices) -; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) ; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) -; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Default Value: E_ALL ; Development Value: E_ALL -; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT -; http://php.net/error-reporting -error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT +; Production Value: E_ALL & ~E_DEPRECATED +; https://php.net/error-reporting +error_reporting = E_ALL & ~E_DEPRECATED ; This directive controls whether or not and where PHP will output errors, ; notices and warnings too. Error output is very useful during development, but @@ -473,18 +496,16 @@ error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT ; Default Value: On ; Development Value: On ; Production Value: Off -; http://php.net/display-errors +; https://php.net/display-errors display_errors = Off ; The display of errors which occur during PHP's startup sequence are handled -; separately from display_errors. PHP's default behavior is to suppress those -; errors from clients. Turning the display of startup errors on can be useful in -; debugging configuration problems. We strongly recommend you -; set this to 'off' for production servers. -; Default Value: Off +; separately from display_errors. We strongly recommend you set this to 'off' +; for production servers to avoid leaking configuration details. +; Default Value: On ; Development Value: On ; Production Value: Off -; http://php.net/display-startup-errors +; https://php.net/display-startup-errors display_startup_errors = Off ; Besides displaying errors, PHP can also log errors to locations such as a @@ -494,46 +515,25 @@ display_startup_errors = Off ; Default Value: Off ; Development Value: On ; Production Value: On -; http://php.net/log-errors +; https://php.net/log-errors log_errors = On -; Set maximum length of log_errors. In error_log information about the source is -; added. The default is 1024 and 0 allows to not apply any maximum length at all. -; http://php.net/log-errors-max-len -log_errors_max_len = 1024 - ; Do not log repeated messages. Repeated errors must occur in same file on same ; line unless ignore_repeated_source is set true. -; http://php.net/ignore-repeated-errors +; https://php.net/ignore-repeated-errors ignore_repeated_errors = Off ; Ignore source of message when ignoring repeated messages. When this setting ; is On you will not log errors with repeated messages from different files or ; source lines. -; http://php.net/ignore-repeated-source +; https://php.net/ignore-repeated-source ignore_repeated_source = Off -; If this parameter is set to Off, then memory leaks will not be shown (on -; stdout or in the log). This has only effect in a debug compile, and if -; error reporting includes E_WARNING in the allowed list -; http://php.net/report-memleaks -report_memleaks = On - -; This setting is on by default. +; This setting is off by default. ;report_zend_debug = 0 -; Store the last error/warning message in $php_errormsg (boolean). Setting this value -; to On can assist in debugging and is appropriate for development servers. It should -; however be disabled on production servers. -; This directive is DEPRECATED. -; Default Value: Off -; Development Value: Off -; Production Value: Off -; http://php.net/track-errors -;track_errors = Off - ; Turn off normal error reporting and emit XML-RPC error XML -; http://php.net/xmlrpc-errors +; https://php.net/xmlrpc-errors ;xmlrpc_errors = 0 ; An XML-RPC faultCode @@ -543,67 +543,90 @@ report_memleaks = On ; error message as HTML for easier reading. This directive controls whether ; the error message is formatted as HTML or not. ; Note: This directive is hardcoded to Off for the CLI SAPI -; Default Value: On -; Development Value: On -; Production value: On -; http://php.net/html-errors +; https://php.net/html-errors html_errors = On ; If html_errors is set to On *and* docref_root is not empty, then PHP ; produces clickable error messages that direct to a page describing the error ; or function causing the error in detail. -; You can download a copy of the PHP manual from http://php.net/docs +; You can download a copy of the PHP manual from https://php.net/docs ; and change docref_root to the base URL of your local copy including the ; leading '/'. You must also specify the file extension being used including ; the dot. PHP's default behavior is to leave these settings empty, in which ; case no links to documentation are generated. ; Note: Never use this feature for production boxes. -; http://php.net/docref-root +; https://php.net/docref-root ; Examples ;docref_root = "/phpmanual/" -; http://php.net/docref-ext +; https://php.net/docref-ext ;docref_ext = .html ; String to output before an error message. PHP's default behavior is to leave ; this setting blank. -; http://php.net/error-prepend-string +; https://php.net/error-prepend-string ; Example: ;error_prepend_string = "" ; String to output after an error message. PHP's default behavior is to leave ; this setting blank. -; http://php.net/error-append-string +; https://php.net/error-append-string ; Example: ;error_append_string = "" ; Log errors to specified file. PHP's default behavior is to leave this value ; empty. -; http://php.net/error-log +; https://php.net/error-log ; Example: ;error_log = php_errors.log ; Log errors to syslog (Event Log on Windows). ;error_log = syslog +; The syslog ident is a string which is prepended to every message logged +; to syslog. Only used when error_log is set to syslog. +;syslog.ident = php + +; The syslog facility is used to specify what type of program is logging +; the message. Only used when error_log is set to syslog. +;syslog.facility = user + +; Set this to disable filtering control characters (the default). +; Some loggers only accept NVT-ASCII, others accept anything that's not +; control characters. If your logger accepts everything, then no filtering +; is needed at all. +; Allowed values are: +; ascii (all printable ASCII characters and NL) +; no-ctrl (all characters except control characters) +; all (all characters) +; raw (like "all", but messages are not split at newlines) +; https://php.net/syslog.filter +;syslog.filter = ascii + ;windows.show_crt_warning ; Default value: 0 ; Development value: 0 ; Production value: 0 +; This directive controls whether PHP will output the backtrace of fatal errors. +; Default Value: On +; Development Value: On +; Production Value: On +;fatal_error_backtraces = On + ;;;;;;;;;;;;;;;;; ; Data Handling ; ;;;;;;;;;;;;;;;;; ; The separator used in PHP generated URLs to separate arguments. ; PHP's default setting is "&". -; http://php.net/arg-separator.output +; https://php.net/arg-separator.output ; Example: ;arg_separator.output = "&" ; List of separator(s) used by PHP to parse input URLs into variables. ; PHP's default setting is "&". ; NOTE: Every character in this directive is considered as separator! -; http://php.net/arg-separator.input +; https://php.net/arg-separator.input ; Example: ;arg_separator.input = ";&" @@ -617,7 +640,7 @@ html_errors = On ; Default Value: "EGPCS" ; Development Value: "GPCS" ; Production Value: "GPCS"; -; http://php.net/variables-order +; https://php.net/variables-order variables_order = "GPCS" ; This directive determines which super global data (G,P & C) should be @@ -630,7 +653,7 @@ variables_order = "GPCS" ; Default Value: None ; Development Value: "GP" ; Production Value: "GP" -; http://php.net/request-order +; https://php.net/request-order request_order = "GP" ; This directive determines whether PHP registers $argv & $argc each time it @@ -639,21 +662,19 @@ request_order = "GP" ; that were passed when the script was invoked. These arrays are extremely ; useful when running scripts from the command line. When this directive is ; enabled, registering these variables consumes CPU cycles and memory each time -; a script is executed. For performance reasons, this feature should be disabled -; on production servers. -; Note: This directive is hardcoded to On for the CLI SAPI -; Default Value: On -; Development Value: Off -; Production Value: Off -; http://php.net/register-argc-argv -register_argc_argv = Off +; a script is executed. For security reasons, this feature should be disabled +; for non-CLI SAPIs. +; Note: This directive is ignored for the CLI SAPI +; This directive is deprecated. +; https://php.net/register-argc-argv +;register_argc_argv = Off ; When enabled, the ENV, REQUEST and SERVER variables are created when they're ; first used (Just In Time) instead of when the script starts. If these ; variables are not used within a script, having this directive on will result ; in a performance gain. The PHP directive register_argc_argv must be disabled -; for this directive to have any affect. -; http://php.net/auto-globals-jit +; for this directive to have any effect. +; https://php.net/auto-globals-jit auto_globals_jit = On ; Whether PHP will read the POST data. @@ -662,48 +683,48 @@ auto_globals_jit = On ; and $_FILES to always be empty; the only way you will be able to read the ; POST data will be through the php://input stream wrapper. This can be useful ; to proxy requests or to process the POST data in a memory efficient fashion. -; http://php.net/enable-post-data-reading +; https://php.net/enable-post-data-reading ;enable_post_data_reading = Off ; Maximum size of POST data that PHP will accept. ; Its value may be 0 to disable the limit. It is ignored if POST data reading ; is disabled through enable_post_data_reading. -; http://php.net/post-max-size +; https://php.net/post-max-size post_max_size = 8M ; Automatically add files before PHP document. -; http://php.net/auto-prepend-file +; https://php.net/auto-prepend-file auto_prepend_file = ; Automatically add files after PHP document. -; http://php.net/auto-append-file +; https://php.net/auto-append-file auto_append_file = ; By default, PHP will output a media type using the Content-Type header. To ; disable this, simply set it to be empty. ; ; PHP's built-in default media type is set to text/html. -; http://php.net/default-mimetype +; https://php.net/default-mimetype default_mimetype = "text/html" ; PHP's default character set is set to UTF-8. -; http://php.net/default-charset +; https://php.net/default-charset default_charset = "UTF-8" ; PHP internal character encoding is set to empty. ; If empty, default_charset is used. -; http://php.net/internal-encoding +; https://php.net/internal-encoding ;internal_encoding = ; PHP input character encoding is set to empty. ; If empty, default_charset is used. -; http://php.net/input-encoding +; https://php.net/input-encoding ;input_encoding = ; PHP output character encoding is set to empty. ; If empty, default_charset is used. ; See also output_buffer. -; http://php.net/output-encoding +; https://php.net/output-encoding ;output_encoding = ;;;;;;;;;;;;;;;;;;;;;;;;; @@ -717,42 +738,42 @@ default_charset = "UTF-8" ;include_path = ".;c:\php\includes" ; ; PHP's default setting for include_path is ".;/path/to/php/pear" -; http://php.net/include-path +; https://php.net/include-path ; The root of the PHP pages, used only if nonempty. ; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root ; if you are running php as a CGI under any web server (other than IIS) ; see documentation for security issues. The alternate is to use the ; cgi.force_redirect configuration below -; http://php.net/doc-root +; https://php.net/doc-root doc_root = ; The directory under which PHP opens the script using /~username used only ; if nonempty. -; http://php.net/user-dir +; https://php.net/user-dir user_dir = ; Directory in which the loadable extensions (modules) reside. -; http://php.net/extension-dir -; extension_dir = "./" +; https://php.net/extension-dir +;extension_dir = "./" ; On windows: -; extension_dir = "ext" +;extension_dir = "ext" ; Directory where the temporary files should be placed. ; Defaults to the system default (see sys_get_temp_dir) -; sys_temp_dir = "/tmp" +;sys_temp_dir = "/tmp" ; Whether or not to enable the dl() function. The dl() function does NOT work ; properly in multithreaded servers, such as IIS or Zeus, and is automatically ; disabled on them. -; http://php.net/enable-dl +; https://php.net/enable-dl enable_dl = Off ; cgi.force_redirect is necessary to provide security running PHP as a CGI under ; most web servers. Left undefined, PHP turns this on by default. You can ; turn it off here AT YOUR OWN RISK ; **You CAN safely turn this off for IIS, in fact, you MUST.** -; http://php.net/cgi.force-redirect +; https://php.net/cgi.force-redirect ;cgi.force_redirect = 1 ; if cgi.nph is enabled it will force cgi to always sent Status: 200 with @@ -763,7 +784,7 @@ enable_dl = Off ; (iPlanet) web servers, you MAY need to set an environment variable name that PHP ; will look for to know it is OK to continue execution. Setting this variable MAY ; cause security issues, KNOW WHAT YOU ARE DOING FIRST. -; http://php.net/cgi.redirect-status-env +; https://php.net/cgi.redirect-status-env ;cgi.redirect_status_env = ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's @@ -772,22 +793,27 @@ enable_dl = Off ; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting ; of zero causes PHP to behave as before. Default is 1. You should fix your scripts ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. -; http://php.net/cgi.fix-pathinfo - cgi.fix_pathinfo=0 +; https://php.net/cgi.fix-pathinfo +cgi.fix_pathinfo=0 ; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside ; of the web tree and people will not be able to circumvent .htaccess security. -; http://php.net/cgi.dicard-path ;cgi.discard_path=1 -; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate +; FastCGI under IIS supports the ability to impersonate ; security tokens of the calling client. This allows IIS to define the ; security context that the request runs under. mod_fastcgi under Apache ; does not currently support this feature (03/17/2002) ; Set to 1 if running under IIS. Default is zero. -; http://php.net/fastcgi.impersonate +; https://php.net/fastcgi.impersonate ;fastcgi.impersonate = 1 +; Prevent decoding of SCRIPT_FILENAME when using Apache ProxyPass or +; ProxyPassMatch. This should be used if script file paths are not stored +; in an encoded format on the file system. +; Default is 1. +;fastcgi.script_path_encoded = 0 + ; Disable logging through FastCGI connection. PHP's default behavior is to enable ; this feature. ;fastcgi.logging = 0 @@ -797,14 +823,14 @@ enable_dl = Off ; is supported by Apache. When this option is set to 1, PHP will send ; RFC2616 compliant header. ; Default is zero. -; http://php.net/cgi.rfc2616-headers +; https://php.net/cgi.rfc2616-headers ;cgi.rfc2616_headers = 0 ; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #! ; (shebang) at the top of the running script. This line might be needed if the ; script support running both as stand-alone script and via PHP CGI<. PHP in CGI ; mode skips this line and ignores its content if this directive is turned on. -; http://php.net/cgi.check-shebang-line +; https://php.net/cgi.check-shebang-line ;cgi.check_shebang_line=1 ;;;;;;;;;;;;;;;; @@ -812,16 +838,16 @@ enable_dl = Off ;;;;;;;;;;;;;;;; ; Whether to allow HTTP file uploads. -; http://php.net/file-uploads +; https://php.net/file-uploads file_uploads = On ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). -; http://php.net/upload-tmp-dir +; https://php.net/upload-tmp-dir ;upload_tmp_dir = ; Maximum allowed size for uploaded files. -; http://php.net/upload-max-filesize +; https://php.net/upload-max-filesize upload_max_filesize = 2M ; Maximum number of files that can be uploaded via a single request @@ -832,24 +858,24 @@ max_file_uploads = 20 ;;;;;;;;;;;;;;;;;; ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. -; http://php.net/allow-url-fopen +; https://php.net/allow-url-fopen allow_url_fopen = On -; Whether to allow include/require to open URLs (like http:// or ftp://) as files. -; http://php.net/allow-url-include +; Whether to allow include/require to open URLs (like https:// or ftp://) as files. +; https://php.net/allow-url-include allow_url_include = Off ; Define the anonymous ftp password (your email address). PHP's default setting ; for this is empty. -; http://php.net/from +; https://php.net/from ;from="john@doe.com" ; Define the User-Agent string. PHP's default setting for this is empty. -; http://php.net/user-agent +; https://php.net/user-agent ;user_agent="PHP" ; Default timeout for socket based streams (seconds) -; http://php.net/default-socket-timeout +; https://php.net/default-socket-timeout default_socket_timeout = 60 ; If your scripts have to deal with files from Macintosh systems, @@ -857,7 +883,7 @@ default_socket_timeout = 60 ; unix or win32 systems, setting this flag will cause PHP to ; automatically detect the EOL character in those files so that ; fgets() and file() will work regardless of the source of the file. -; http://php.net/auto-detect-line-endings +; https://php.net/auto-detect-line-endings ;auto_detect_line_endings = Off ;;;;;;;;;;;;;;;;;;;;;; @@ -872,7 +898,7 @@ default_socket_timeout = 60 ; For example: ; ; extension=mysqli -; +; ; When the extension library to load is not located in the default extension ; directory, You may specify an absolute path to the library file: ; @@ -885,29 +911,27 @@ default_socket_timeout = 60 ; ; Notes for Windows environments : ; -; - ODBC support is built in, so no dll is needed for it. -; - Many DLL files are located in the extensions/ (PHP 4) or ext/ (PHP 5+) -; extension folders as well as the separate PECL DLL download (PHP 5+). +; - Many DLL files are located in the ext/ +; extension folders as well as the separate PECL DLL download. ; Be sure to appropriately set the extension_dir directive. ; ;extension=bz2 ;extension=curl +;extension=exif +;extension=ffi +;extension=ftp ;extension=fileinfo -;extension=gd2 +;extension=gd ;extension=gettext ;extension=gmp ;extension=intl -;extension=imap -;extension=interbase ;extension=ldap ;extension=mbstring -;extension=exif ; Must be after mbstring as it depends on it ;extension=mysqli -;extension=oci8_12c ; Use with Oracle Database 12c Instant Client +;extension=odbc ;extension=openssl ;extension=pdo_firebird ;extension=pdo_mysql -;extension=pdo_oci ;extension=pdo_odbc ;extension=pdo_pgsql ;extension=pdo_sqlite @@ -915,15 +939,16 @@ default_socket_timeout = 60 ;extension=shmop ; The MIBS data available in the PHP distribution must be installed. -; See http://www.php.net/manual/en/snmp.installation.php +; See https://www.php.net/manual/en/snmp.installation.php ;extension=snmp ;extension=soap ;extension=sockets +;extension=sodium ;extension=sqlite3 ;extension=tidy -;extension=xmlrpc ;extension=xsl +;extension=zip ;;;;;;;;;;;;;;;;;;; ; Module Settings ; @@ -935,32 +960,32 @@ cli_server.color = On [Date] ; Defines the default timezone used by the date functions -; http://php.net/date.timezone +; https://php.net/date.timezone date.timezone = UTC -; http://php.net/date.default-latitude +; https://php.net/date.default-latitude ;date.default_latitude = 31.7667 -; http://php.net/date.default-longitude +; https://php.net/date.default-longitude ;date.default_longitude = 35.2333 -; http://php.net/date.sunrise-zenith -;date.sunrise_zenith = 90.583333 +; https://php.net/date.sunrise-zenith +;date.sunrise_zenith = 90.833333 -; http://php.net/date.sunset-zenith -;date.sunset_zenith = 90.583333 +; https://php.net/date.sunset-zenith +;date.sunset_zenith = 90.833333 [filter] -; http://php.net/filter.default +; https://php.net/filter.default ;filter.default = unsafe_raw -; http://php.net/filter.default-flags +; https://php.net/filter.default-flags ;filter.default_flags = [iconv] ; Use of this INI entry is deprecated, use global input_encoding instead. ; If empty, default_charset or input_encoding or iconv.input_encoding is used. -; The precedence is: default_charset < intput_encoding < iconv.input_encoding +; The precedence is: default_charset < input_encoding < iconv.input_encoding ;iconv.input_encoding = ; Use of this INI entry is deprecated, use global internal_encoding instead. @@ -980,67 +1005,75 @@ date.timezone = UTC ; This directive allows you to produce PHP errors when some error ; happens within intl functions. The value is the level of the error produced. ; Default is 0, which does not produce any errors. +; This directive is deprecated. ;intl.error_level = E_WARNING -;intl.use_exceptions = 0 +; If enabled this directive indicates that when an error occurs within an +; intl function a IntlException should be thrown. +; Default is Off, which means errors need to be handled manually. +;intl.use_exceptions = On [sqlite3] +; Directory pointing to SQLite3 extensions +; https://php.net/sqlite3.extension-dir ;sqlite3.extension_dir = +; SQLite defensive mode flag (only available from SQLite 3.26+) +; When the defensive flag is enabled, language features that allow ordinary +; SQL to deliberately corrupt the database file are disabled. This forbids +; writing directly to the schema, shadow tables (eg. FTS data tables), or +; the sqlite_dbpage virtual table. +; https://www.sqlite.org/c3ref/c_dbconfig_defensive.html +; (for older SQLite versions, this flag has no use) +;sqlite3.defensive = 1 + [Pcre] -;PCRE library backtracking limit. -; http://php.net/pcre.backtrack-limit +; PCRE library backtracking limit. +; https://php.net/pcre.backtrack-limit ;pcre.backtrack_limit=100000 -;PCRE library recursion limit. -;Please note that if you set this value to a high number you may consume all -;the available process stack and eventually crash PHP (due to reaching the -;stack size limit imposed by the Operating System). -; http://php.net/pcre.recursion-limit +; PCRE library recursion limit. +; Please note that if you set this value to a high number you may consume all +; the available process stack and eventually crash PHP (due to reaching the +; stack size limit imposed by the Operating System). +; https://php.net/pcre.recursion-limit ;pcre.recursion_limit=100000 -;Enables or disables JIT compilation of patterns. This requires the PCRE -;library to be compiled with JIT support. +; Enables or disables JIT compilation of patterns. This requires the PCRE +; library to be compiled with JIT support. ;pcre.jit=1 [Pdo] ; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" -; http://php.net/pdo-odbc.connection-pooling +; https://php.net/pdo-odbc.connection-pooling ;pdo_odbc.connection_pooling=strict -;pdo_odbc.db2_instance_name - [Pdo_mysql] -; If mysqlnd is used: Number of cache slots for the internal result set cache -; http://php.net/pdo_mysql.cache_size -pdo_mysql.cache_size = 2000 - ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. -; http://php.net/pdo_mysql.default-socket pdo_mysql.default_socket= [Phar] -; http://php.net/phar.readonly +; https://php.net/phar.readonly ;phar.readonly = On -; http://php.net/phar.require-hash +; https://php.net/phar.require-hash ;phar.require_hash = On ;phar.cache_list = [mail function] ; For Win32 only. -; http://php.net/smtp +; https://php.net/smtp SMTP = localhost -; http://php.net/smtp-port +; https://php.net/smtp-port smtp_port = 25 ; For Win32 only. -; http://php.net/sendmail-from +; https://php.net/sendmail-from ;sendmail_from = me@example.com ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). -; http://php.net/sendmail-path +; https://php.net/sendmail-path ;sendmail_path = ; Force the addition of the specified parameters to be passed as extra parameters @@ -1049,7 +1082,19 @@ smtp_port = 25 ;mail.force_extra_parameters = ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename -mail.add_x_header = On +mail.add_x_header = Off + +; Use mixed LF and CRLF line separators to keep compatibility with some +; RFC 2822 non conformant MTA. +mail.mixed_lf_and_crlf = Off + +; Control line ending mode for mail messages and headers. +; Possible values: "crlf" (default), "lf", "mixed", "os" +; - crlf: Use CRLF line endings +; - lf: Use LF line endings only (converts CRLF in message to LF) +; - mixed: Same as mail.mixed_lf_and_crlf = On +; - os: Use CRLF on Windows, LF on other systems +mail.cr_lf_mode = crlf ; The path to a log file that will log all mail() calls. Log entries include ; the full path of the script, line number, To address and headers. @@ -1058,13 +1103,13 @@ mail.add_x_header = On ;mail.log = syslog [ODBC] -; http://php.net/odbc.default-db +; https://php.net/odbc.default-db ;odbc.default_db = Not yet implemented -; http://php.net/odbc.default-user +; https://php.net/odbc.default-user ;odbc.default_user = Not yet implemented -; http://php.net/odbc.default-pw +; https://php.net/odbc.default-pw ;odbc.default_pw = Not yet implemented ; Controls the ODBC cursor model. @@ -1072,253 +1117,161 @@ mail.add_x_header = On ;odbc.default_cursortype ; Allow or prevent persistent links. -; http://php.net/odbc.allow-persistent +; https://php.net/odbc.allow-persistent odbc.allow_persistent = On ; Check that a connection is still valid before reuse. -; http://php.net/odbc.check-persistent +; https://php.net/odbc.check-persistent odbc.check_persistent = On ; Maximum number of persistent links. -1 means no limit. -; http://php.net/odbc.max-persistent +; https://php.net/odbc.max-persistent odbc.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. -; http://php.net/odbc.max-links +; https://php.net/odbc.max-links odbc.max_links = -1 ; Handling of LONG fields. Returns number of bytes to variables. 0 means ; passthru. -; http://php.net/odbc.defaultlrl +; https://php.net/odbc.defaultlrl odbc.defaultlrl = 4096 ; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. ; See the documentation on odbc_binmode and odbc_longreadlen for an explanation ; of odbc.defaultlrl and odbc.defaultbinmode -; http://php.net/odbc.defaultbinmode +; https://php.net/odbc.defaultbinmode odbc.defaultbinmode = 1 -;birdstep.max_links = -1 - -[Interbase] -; Allow or prevent persistent links. -ibase.allow_persistent = 1 - -; Maximum number of persistent links. -1 means no limit. -ibase.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -ibase.max_links = -1 - -; Default database name for ibase_connect(). -;ibase.default_db = - -; Default username for ibase_connect(). -;ibase.default_user = - -; Default password for ibase_connect(). -;ibase.default_password = - -; Default charset for ibase_connect(). -;ibase.default_charset = - -; Default timestamp format. -ibase.timestampformat = "%Y-%m-%d %H:%M:%S" - -; Default date format. -ibase.dateformat = "%Y-%m-%d" - -; Default time format. -ibase.timeformat = "%H:%M:%S" - [MySQLi] ; Maximum number of persistent links. -1 means no limit. -; http://php.net/mysqli.max-persistent +; https://php.net/mysqli.max-persistent mysqli.max_persistent = -1 ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements -; http://php.net/mysqli.allow_local_infile +; https://php.net/mysqli.allow_local_infile ;mysqli.allow_local_infile = On +; It allows the user to specify a folder where files that can be sent via LOAD DATA +; LOCAL can exist. It is ignored if mysqli.allow_local_infile is enabled. +;mysqli.local_infile_directory = + ; Allow or prevent persistent links. -; http://php.net/mysqli.allow-persistent +; https://php.net/mysqli.allow-persistent mysqli.allow_persistent = On ; Maximum number of links. -1 means no limit. -; http://php.net/mysqli.max-links +; https://php.net/mysqli.max-links mysqli.max_links = -1 -; If mysqlnd is used: Number of cache slots for the internal result set cache -; http://php.net/mysqli.cache_size -mysqli.cache_size = 2000 - -; Default port number for mysqli_connect(). If unset, mysqli_connect() will use -; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the -; compile-time value defined MYSQL_PORT (in that order). Win32 will only look -; at MYSQL_PORT. -; http://php.net/mysqli.default-port +; Default port number for mysqli_connect(). +; https://php.net/mysqli.default-port mysqli.default_port = 3306 ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. -; http://php.net/mysqli.default-socket +; https://php.net/mysqli.default-socket mysqli.default_socket = -; Default host for mysql_connect() (doesn't apply in safe mode). -; http://php.net/mysqli.default-host +; Default host for mysqli_connect(). +; https://php.net/mysqli.default-host mysqli.default_host = -; Default user for mysql_connect() (doesn't apply in safe mode). -; http://php.net/mysqli.default-user +; Default user for mysqli_connect(). +; https://php.net/mysqli.default-user mysqli.default_user = -; Default password for mysqli_connect() (doesn't apply in safe mode). +; Default password for mysqli_connect(). ; Note that this is generally a *bad* idea to store passwords in this file. ; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") ; and reveal this password! And of course, any users with read access to this ; file will be able to reveal the password as well. -; http://php.net/mysqli.default-pw +; https://php.net/mysqli.default-pw mysqli.default_pw = -; Allow or prevent reconnect -mysqli.reconnect = Off +; If this option is enabled, closing a persistent connection will rollback +; any pending transactions of this connection, before it is put back +; into the persistent connection pool. +;mysqli.rollback_on_cached_plink = Off [mysqlnd] ; Enable / Disable collection of general statistics by mysqlnd which can be ; used to tune and monitor MySQL operations. -; http://php.net/mysqlnd.collect_statistics mysqlnd.collect_statistics = Off ; Enable / Disable collection of memory usage statistics by mysqlnd which can be ; used to tune and monitor MySQL operations. -; http://php.net/mysqlnd.collect_memory_statistics +; Default Value: Off +; Development Value: On +; Production Value: Off mysqlnd.collect_memory_statistics = Off ; Records communication from all extensions using mysqlnd to the specified log ; file. -; http://php.net/mysqlnd.debug +; https://php.net/mysqlnd.debug ;mysqlnd.debug = ; Defines which queries will be logged. -; http://php.net/mysqlnd.log_mask ;mysqlnd.log_mask = 0 ; Default size of the mysqlnd memory pool, which is used by result sets. -; http://php.net/mysqlnd.mempool_default_size ;mysqlnd.mempool_default_size = 16000 ; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. -; http://php.net/mysqlnd.net_cmd_buffer_size ;mysqlnd.net_cmd_buffer_size = 2048 ; Size of a pre-allocated buffer used for reading data sent by the server in ; bytes. -; http://php.net/mysqlnd.net_read_buffer_size ;mysqlnd.net_read_buffer_size = 32768 ; Timeout for network requests in seconds. -; http://php.net/mysqlnd.net_read_timeout ;mysqlnd.net_read_timeout = 31536000 ; SHA-256 Authentication Plugin related. File with the MySQL server public RSA ; key. -; http://php.net/mysqlnd.sha256_server_public_key ;mysqlnd.sha256_server_public_key = -[OCI8] - -; Connection: Enables privileged connections using external -; credentials (OCI_SYSOPER, OCI_SYSDBA) -; http://php.net/oci8.privileged-connect -;oci8.privileged_connect = Off - -; Connection: The maximum number of persistent OCI8 connections per -; process. Using -1 means no limit. -; http://php.net/oci8.max-persistent -;oci8.max_persistent = -1 - -; Connection: The maximum number of seconds a process is allowed to -; maintain an idle persistent connection. Using -1 means idle -; persistent connections will be maintained forever. -; http://php.net/oci8.persistent-timeout -;oci8.persistent_timeout = -1 - -; Connection: The number of seconds that must pass before issuing a -; ping during oci_pconnect() to check the connection validity. When -; set to 0, each oci_pconnect() will cause a ping. Using -1 disables -; pings completely. -; http://php.net/oci8.ping-interval -;oci8.ping_interval = 60 - -; Connection: Set this to a user chosen connection class to be used -; for all pooled server requests with Oracle 11g Database Resident -; Connection Pooling (DRCP). To use DRCP, this value should be set to -; the same string for all web servers running the same application, -; the database pool must be configured, and the connection string must -; specify to use a pooled server. -;oci8.connection_class = - -; High Availability: Using On lets PHP receive Fast Application -; Notification (FAN) events generated when a database node fails. The -; database must also be configured to post FAN events. -;oci8.events = Off - -; Tuning: This option enables statement caching, and specifies how -; many statements to cache. Using 0 disables statement caching. -; http://php.net/oci8.statement-cache-size -;oci8.statement_cache_size = 20 - -; Tuning: Enables statement prefetching and sets the default number of -; rows that will be fetched automatically after statement execution. -; http://php.net/oci8.default-prefetch -;oci8.default_prefetch = 100 - -; Compatibility. Using On means oci_close() will not close -; oci_connect() and oci_new_connect() connections. -; http://php.net/oci8.old-oci-close-semantics -;oci8.old_oci_close_semantics = Off - [PostgreSQL] ; Allow or prevent persistent links. -; http://php.net/pgsql.allow-persistent +; https://php.net/pgsql.allow-persistent pgsql.allow_persistent = On ; Detect broken persistent links always with pg_pconnect(). ; Auto reset feature requires a little overheads. -; http://php.net/pgsql.auto-reset-persistent +; https://php.net/pgsql.auto-reset-persistent pgsql.auto_reset_persistent = Off ; Maximum number of persistent links. -1 means no limit. -; http://php.net/pgsql.max-persistent +; https://php.net/pgsql.max-persistent pgsql.max_persistent = -1 ; Maximum number of links (persistent+non persistent). -1 means no limit. -; http://php.net/pgsql.max-links +; https://php.net/pgsql.max-links pgsql.max_links = -1 ; Ignore PostgreSQL backends Notice message or not. ; Notice message logging require a little overheads. -; http://php.net/pgsql.ignore-notice +; https://php.net/pgsql.ignore-notice pgsql.ignore_notice = 0 ; Log PostgreSQL backends Notice message or not. ; Unless pgsql.ignore_notice=0, module cannot log notice message. -; http://php.net/pgsql.log-notice +; https://php.net/pgsql.log-notice pgsql.log_notice = 0 [bcmath] ; Number of decimal digits for all bcmath functions. -; http://php.net/bcmath.scale +; https://php.net/bcmath.scale bcmath.scale = 0 [browscap] -; http://php.net/browscap +; https://php.net/browscap ;browscap = extra/browscap.ini [Session] ; Handler used to store/retrieve data. -; http://php.net/session.save-handler +; https://php.net/session.save-handler session.save_handler = files ; Argument passed to save_handler. In the case of files, this is the path @@ -1347,111 +1300,120 @@ session.save_handler = files ; ; where MODE is the octal representation of the mode. Note that this ; does not overwrite the process's umask. -; http://php.net/session.save-path +; https://php.net/session.save-path ;session.save_path = "/var/lib/php/sessions" ; Whether to use strict session mode. -; Strict session mode does not accept uninitialized session ID and regenerate -; session ID if browser sends uninitialized session ID. Strict mode protects -; applications from session fixation via session adoption vulnerability. It is -; disabled by default for maximum compatibility, but enabling it is encouraged. +; Strict session mode does not accept an uninitialized session ID, and +; regenerates the session ID if the browser sends an uninitialized session ID. +; Strict mode protects applications from session fixation via a session adoption +; vulnerability. It is disabled by default for maximum compatibility, but +; enabling it is encouraged. ; https://wiki.php.net/rfc/strict_sessions session.use_strict_mode = 0 ; Whether to use cookies. -; http://php.net/session.use-cookies +; https://php.net/session.use-cookies session.use_cookies = 1 -; http://php.net/session.cookie-secure +; https://php.net/session.cookie-secure ;session.cookie_secure = +; https://php.net/session.cookie-partitioned +;session.cookie_partitioned = 0 + ; This option forces PHP to fetch and use a cookie for storing and maintaining ; the session id. We encourage this operation as it's very helpful in combating ; session hijacking when not specifying and managing your own session id. It is ; not the be-all and end-all of session hijacking defense, but it's a good start. -; http://php.net/session.use-only-cookies +; https://php.net/session.use-only-cookies session.use_only_cookies = 1 ; Name of the session (used as cookie name). -; http://php.net/session.name +; https://php.net/session.name session.name = PHPSESSID ; Initialize session on request startup. -; http://php.net/session.auto-start +; https://php.net/session.auto-start session.auto_start = 0 ; Lifetime in seconds of cookie or, if 0, until browser is restarted. -; http://php.net/session.cookie-lifetime +; https://php.net/session.cookie-lifetime session.cookie_lifetime = 0 ; The path for which the cookie is valid. -; http://php.net/session.cookie-path +; https://php.net/session.cookie-path session.cookie_path = / ; The domain for which the cookie is valid. -; http://php.net/session.cookie-domain +; https://php.net/session.cookie-domain session.cookie_domain = -; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. -; http://php.net/session.cookie-httponly +; Whether or not to add the httpOnly flag to the cookie, which makes it +; inaccessible to browser scripting languages such as JavaScript. +; https://php.net/session.cookie-httponly session.cookie_httponly = -; Handler used to serialize data. php is the standard serializer of PHP. -; http://php.net/session.serialize-handler +; Add SameSite attribute to cookie to help mitigate Cross-Site Request Forgery (CSRF/XSRF) +; Current valid values are "Strict", "Lax" or "None". When using "None", +; make sure to include the quotes, as `none` is interpreted like `false` in ini files. +; https://tools.ietf.org/html/draft-west-first-party-cookies-07 +session.cookie_samesite = + +; Handler used to serialize data. php is the standard serializer of PHP. +; https://php.net/session.serialize-handler session.serialize_handler = php -; Defines the probability that the 'garbage collection' process is started -; on every session initialization. The probability is calculated by using -; gc_probability/gc_divisor. Where session.gc_probability is the numerator -; and gc_divisor is the denominator in the equation. Setting this value to 1 -; when the session.gc_divisor value is 100 will give you approximately a 1% chance -; the gc will run on any give request. +; Defines the probability that the 'garbage collection' process is started on every +; session initialization. The probability is calculated by using gc_probability/gc_divisor, +; e.g. 1/100 means there is a 1% chance that the GC process starts on each request. ; Default Value: 1 ; Development Value: 1 ; Production Value: 1 -; http://php.net/session.gc-probability +; https://php.net/session.gc-probability +; Debian Default Value: 0 +; This is disabled in the Debian packages due to the strict permissions +; on /var/lib/php. Instead, GC is performed through /etc/cron.d/php, +; which uses the session.gc_maxlifetime setting. Please, check +; /usr/share/doc/php8.2-common/README.Debian.gz for further reference. session.gc_probability = 0 ; Defines the probability that the 'garbage collection' process is started on every -; session initialization. The probability is calculated by using the following equation: -; gc_probability/gc_divisor. Where session.gc_probability is the numerator and -; session.gc_divisor is the denominator in the equation. Setting this value to 1 -; when the session.gc_divisor value is 100 will give you approximately a 1% chance -; the gc will run on any give request. Increasing this value to 1000 will give you -; a 0.1% chance the gc will run on any give request. For high volume production servers, -; this is a more efficient approach. +; session initialization. The probability is calculated by using gc_probability/gc_divisor, +; e.g. 1/100 means there is a 1% chance that the GC process starts on each request. +; For high volume production servers, using a value of 1000 is a more efficient approach. ; Default Value: 100 ; Development Value: 1000 ; Production Value: 1000 -; http://php.net/session.gc-divisor +; https://php.net/session.gc-divisor session.gc_divisor = 1000 ; After this number of seconds, stored data will be seen as 'garbage' and ; cleaned up by the garbage collection process. -; http://php.net/session.gc-maxlifetime +; https://php.net/session.gc-maxlifetime session.gc_maxlifetime = 1440 ; NOTE: If you are using the subdirectory option for storing session files ; (see session.save_path above), then garbage collection does *not* ; happen automatically. You will need to do your own garbage ; collection through a shell script, cron entry, or some other method. -; For example, the following script would is the equivalent of -; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): +; For example, the following script is the equivalent of setting +; session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): ; find /path/to/sessions -cmin +24 -type f | xargs rm ; Check HTTP Referer to invalidate externally stored URLs containing ids. ; HTTP_REFERER has to contain this substring for the session to be ; considered as valid. -; http://php.net/session.referer-check +; https://php.net/session.referer-check session.referer_check = ; Set to {nocache,private,public,} to determine HTTP caching aspects ; or leave this empty to avoid sending anti-caching headers. -; http://php.net/session.cache-limiter +; https://php.net/session.cache-limiter session.cache_limiter = nocache ; Document expires after n minutes. -; http://php.net/session.cache-expire +; https://php.net/session.cache-expire session.cache_expire = 180 ; trans sid support is disabled by default. @@ -1463,18 +1425,9 @@ session.cache_expire = 180 ; in publicly accessible computer. ; - User may access your site with the same session ID ; always using URL stored in browser's history or bookmarks. -; http://php.net/session.use-trans-sid +; https://php.net/session.use-trans-sid session.use_trans_sid = 0 -; Set session ID character length. This value could be between 22 to 256. -; Shorter length than default is supported only for compatibility reason. -; Users should use 32 or more chars. -; http://php.net/session.sid-length -; Default Value: 32 -; Development Value: 26 -; Production Value: 26 -session.sid_length = 26 - ; The URL rewriter will look for URLs in a defined set of HTML tags. ; is special; if you include them here, the rewriter will ; add a hidden field with the info which is otherwise appended @@ -1484,11 +1437,11 @@ session.sid_length = 26 ; Default Value: "a=href,area=href,frame=src,form=" ; Development Value: "a=href,area=href,frame=src,form=" ; Production Value: "a=href,area=href,frame=src,form=" -; http://php.net/url-rewriter.tags +; https://php.net/url-rewriter.tags session.trans_sid_tags = "a=href,area=href,frame=src,form=" ; URL rewriter does not rewrite absolute URLs by default. -; To enable rewrites for absolute pathes, target hosts must be specified +; To enable rewrites for absolute paths, target hosts must be specified ; at RUNTIME. i.e. use ini_set() ; tags is special. PHP will check action attribute's URL regardless ; of session.trans_sid_tags setting. @@ -1500,23 +1453,11 @@ session.trans_sid_tags = "a=href,area=href,frame=src,form=" ; Production Value: "" ;session.trans_sid_hosts="" -; Define how many bits are stored in each character when converting -; the binary hash data to something readable. -; Possible values: -; 4 (4 bits: 0-9, a-f) -; 5 (5 bits: 0-9, a-v) -; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") -; Default Value: 4 -; Development Value: 5 -; Production Value: 5 -; http://php.net/session.hash-bits-per-character -session.sid_bits_per_character = 5 - ; Enable upload progress tracking in $_SESSION ; Default Value: On ; Development Value: On ; Production Value: On -; http://php.net/session.upload-progress.enabled +; https://php.net/session.upload-progress.enabled ;session.upload_progress.enabled = On ; Cleanup the progress information as soon as all POST data has been read @@ -1524,14 +1465,14 @@ session.sid_bits_per_character = 5 ; Default Value: On ; Development Value: On ; Production Value: On -; http://php.net/session.upload-progress.cleanup +; https://php.net/session.upload-progress.cleanup ;session.upload_progress.cleanup = On ; A prefix used for the upload progress key in $_SESSION ; Default Value: "upload_progress_" ; Development Value: "upload_progress_" ; Production Value: "upload_progress_" -; http://php.net/session.upload-progress.prefix +; https://php.net/session.upload-progress.prefix ;session.upload_progress.prefix = "upload_progress_" ; The index name (concatenated with the prefix) in $_SESSION @@ -1539,7 +1480,7 @@ session.sid_bits_per_character = 5 ; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" ; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" ; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" -; http://php.net/session.upload-progress.name +; https://php.net/session.upload-progress.name ;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" ; How frequently the upload progress should be updated. @@ -1547,18 +1488,18 @@ session.sid_bits_per_character = 5 ; Default Value: "1%" ; Development Value: "1%" ; Production Value: "1%" -; http://php.net/session.upload-progress.freq +; https://php.net/session.upload-progress.freq ;session.upload_progress.freq = "1%" ; The minimum delay between updates, in seconds ; Default Value: 1 ; Development Value: 1 ; Production Value: 1 -; http://php.net/session.upload-progress.min-freq +; https://php.net/session.upload-progress.min-freq ;session.upload_progress.min_freq = "1" ; Only write session data when session data is changed. Enabled by default. -; http://php.net/session.lazy-write +; https://php.net/session.lazy-write ;session.lazy_write = On [Assertion] @@ -1566,67 +1507,47 @@ session.sid_bits_per_character = 5 ; -1: Do not compile at all ; 0: Jump over assertion at run-time ; 1: Execute assertions -; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) +; Changing from or to a negative value is only possible in php.ini! +; (For turning assertions on and off at run-time, toggle zend.assertions between the values 1 and 0) ; Default Value: 1 ; Development Value: 1 ; Production Value: -1 -; http://php.net/zend.assertions +; https://php.net/zend.assertions zend.assertions = -1 -; Assert(expr); active by default. -; http://php.net/assert.active -;assert.active = On - -; Throw an AssertationException on failed assertions -; http://php.net/assert.exception -;assert.exception = On - -; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active) -; http://php.net/assert.warning -;assert.warning = On - -; Don't bail out by default. -; http://php.net/assert.bail -;assert.bail = Off - -; User-function to be called if an assertion fails. -; http://php.net/assert.callback -;assert.callback = 0 - -; Eval the expression with current error_reporting(). Set to true if you want -; error_reporting(0) around the eval(). -; http://php.net/assert.quiet-eval -;assert.quiet_eval = 0 - [COM] ; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs -; http://php.net/com.typelib-file +; https://php.net/com.typelib-file ;com.typelib_file = ; allow Distributed-COM calls -; http://php.net/com.allow-dcom +; https://php.net/com.allow-dcom ;com.allow_dcom = true -; autoregister constants of a components typlib on com_load() -; http://php.net/com.autoregister-typelib +; autoregister constants of a component's typelib on com_load() +; https://php.net/com.autoregister-typelib ;com.autoregister_typelib = true ; register constants casesensitive -; http://php.net/com.autoregister-casesensitive +; https://php.net/com.autoregister-casesensitive ;com.autoregister_casesensitive = false ; show warnings on duplicate constant registrations -; http://php.net/com.autoregister-verbose +; https://php.net/com.autoregister-verbose ;com.autoregister_verbose = true ; The default character set code-page to use when passing strings to and from COM objects. ; Default: system ANSI code page ;com.code_page= +; The version of the .NET framework to use. The value of the setting are the first three parts +; of the framework's version number, separated by dots, and prefixed with "v", e.g. "v4.0.30319". +;com.dotnet_version= + [mbstring] ; language for internal character representation. ; This affects mb_send_mail() and mbstring.detect_order. -; http://php.net/mbstring.language +; https://php.net/mbstring.language ;mbstring.language = Japanese ; Use of this INI entry is deprecated, use global internal_encoding instead. @@ -1638,10 +1559,10 @@ zend.assertions = -1 ; Use of this INI entry is deprecated, use global input_encoding instead. ; http input encoding. -; mbstring.encoding_traslation = On is needed to use this setting. +; mbstring.encoding_translation = On is needed to use this setting. ; If empty, default_charset or input_encoding or mbstring.input is used. -; The precedence is: default_charset < intput_encoding < mbsting.http_input -; http://php.net/mbstring.http-input +; The precedence is: default_charset < input_encoding < mbstring.http_input +; https://php.net/mbstring.http-input ;mbstring.http_input = ; Use of this INI entry is deprecated, use global output_encoding instead. @@ -1651,7 +1572,7 @@ zend.assertions = -1 ; The precedence is: default_charset < output_encoding < mbstring.http_output ; To use an output encoding conversion, mbstring's output handler must be set ; otherwise output encoding conversion cannot be performed. -; http://php.net/mbstring.http-output +; https://php.net/mbstring.http-output ;mbstring.http_output = ; enable automatic encoding translation according to @@ -1659,44 +1580,40 @@ zend.assertions = -1 ; converted to internal encoding by setting this to On. ; Note: Do _not_ use automatic encoding translation for ; portable libs/applications. -; http://php.net/mbstring.encoding-translation +; https://php.net/mbstring.encoding-translation ;mbstring.encoding_translation = Off ; automatic encoding detection order. ; "auto" detect order is changed according to mbstring.language -; http://php.net/mbstring.detect-order +; https://php.net/mbstring.detect-order ;mbstring.detect_order = auto ; substitute_character used when character cannot be converted ; one from another -; http://php.net/mbstring.substitute-character +; https://php.net/mbstring.substitute-character ;mbstring.substitute_character = none -; overload(replace) single byte functions by mbstring functions. -; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), -; etc. Possible values are 0,1,2,4 or combination of them. -; For example, 7 for overload everything. -; 0: No overload -; 1: Overload mail() function -; 2: Overload str*() functions -; 4: Overload ereg*() functions -; http://php.net/mbstring.func-overload -;mbstring.func_overload = 0 - -; enable strict encoding detection. -; Default: Off -;mbstring.strict_detection = On +; Enable strict encoding detection. +;mbstring.strict_detection = Off ; This directive specifies the regex pattern of content types for which mb_output_handler() ; is activated. -; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) -;mbstring.http_output_conv_mimetype= +; Default: mbstring.http_output_conv_mimetypes=^(text/|application/xhtml\+xml) +;mbstring.http_output_conv_mimetypes= + +; This directive specifies maximum stack depth for mbstring regular expressions. It is similar +; to the pcre.recursion_limit for PCRE. +;mbstring.regex_stack_limit=100000 + +; This directive specifies maximum retry count for mbstring regular expressions. It is similar +; to the pcre.backtrack_limit for PCRE. +;mbstring.regex_retry_limit=1000000 [gd] ; Tell the jpeg decode to ignore warnings and try to create ; a gd image. The warning will then be displayed as notices ; disabled by default -; http://php.net/gd.jpeg-ignore-warning +; https://php.net/gd.jpeg-ignore-warning ;gd.jpeg_ignore_warning = 1 [exif] @@ -1704,48 +1621,48 @@ zend.assertions = -1 ; With mbstring support this will automatically be converted into the encoding ; given by corresponding encode setting. When empty mbstring.internal_encoding ; is used. For the decode settings you can distinguish between motorola and -; intel byte order. A decode setting cannot be empty. -; http://php.net/exif.encode-unicode +; intel byte order. A decode setting must not be empty. +; https://php.net/exif.encode-unicode ;exif.encode_unicode = ISO-8859-15 -; http://php.net/exif.decode-unicode-motorola +; https://php.net/exif.decode-unicode-motorola ;exif.decode_unicode_motorola = UCS-2BE -; http://php.net/exif.decode-unicode-intel +; https://php.net/exif.decode-unicode-intel ;exif.decode_unicode_intel = UCS-2LE -; http://php.net/exif.encode-jis +; https://php.net/exif.encode-jis ;exif.encode_jis = -; http://php.net/exif.decode-jis-motorola +; https://php.net/exif.decode-jis-motorola ;exif.decode_jis_motorola = JIS -; http://php.net/exif.decode-jis-intel +; https://php.net/exif.decode-jis-intel ;exif.decode_jis_intel = JIS [Tidy] ; The path to a default tidy configuration file to use when using tidy -; http://php.net/tidy.default-config +; https://php.net/tidy.default-config ;tidy.default_config = /usr/local/lib/php/default.tcfg ; Should tidy clean and repair output automatically? ; WARNING: Do not use this option if you are generating non-html content ; such as dynamic images -; http://php.net/tidy.clean-output +; https://php.net/tidy.clean-output tidy.clean_output = Off [soap] ; Enables or disables WSDL caching feature. -; http://php.net/soap.wsdl-cache-enabled +; https://php.net/soap.wsdl-cache-enabled soap.wsdl_cache_enabled=1 ; Sets the directory name where SOAP extension will put cache files. -; http://php.net/soap.wsdl-cache-dir +; https://php.net/soap.wsdl-cache-dir soap.wsdl_cache_dir="/tmp" ; (time to live) Sets the number of second while cached file will be used ; instead of original one. -; http://php.net/soap.wsdl-cache-ttl +; https://php.net/soap.wsdl-cache-ttl soap.wsdl_cache_ttl=86400 ; Sets the size of the cache limit. (Max. number of WSDL files to cache) @@ -1804,14 +1721,18 @@ opcache.validate_timestamps=0 ; size of the optimized code. opcache.save_comments=0 +; If enabled, compilation warnings (including notices and deprecations) will +; be recorded and replayed each time a file is included. Otherwise, compilation +; warnings will only be emitted when the file is first cached. +;opcache.record_warnings=0 + ; Allow file existence override (file_exists, etc.) performance feature. opcache.enable_file_override=1 ; A bitmask, where each bit enables or disables the appropriate OPcache ; passes -;opcache.optimization_level=0xffffffff +;opcache.optimization_level=0x7FFFBFFF -;opcache.inherited_hack=1 ;opcache.dups_fix=0 ; The location of the OPcache blacklist file (wildcards allowed). @@ -1826,10 +1747,6 @@ opcache.enable_file_override=1 ; are cached. ;opcache.max_file_size=0 -; Check the cache checksum each N requests. -; The default value of "0" means that the checks are disabled. -;opcache.consistency_checks=0 - ; How long to wait (in seconds) for a scheduled restart to begin if the cache ; is not being accessed. ;opcache.force_restart_timeout=180 @@ -1860,11 +1777,24 @@ opcache.enable_file_override=1 ; errors. ;opcache.mmap_base= +; Facilitates multiple OPcache instances per user (for Windows only). All PHP +; processes with the same cache ID and user share an OPcache instance. +;opcache.cache_id= + ; Enables and sets the second level cache directory. ; It should improve performance when SHM memory is full, at server restart or ; SHM reset. The default "" disables file based caching. ;opcache.file_cache= +; Enables or disables read-only mode for the second level cache directory. +; It should improve performance for read-only containers, +; when the cache is pre-warmed and packaged alongside the application. +; Best used with `opcache.validate_timestamps=0`, `opcache.enable_file_override=1` +; and `opcache.file_cache_consistency_checks=0`. +; Note: A cache generated with a different build of PHP, a different file path, +; or different settings (including which extensions are loaded), may be ignored. +;opcache.file_cache_read_only=0 + ; Enables or disables opcode caching in shared memory. ;opcache.file_cache_only=0 @@ -1877,7 +1807,12 @@ opcache.enable_file_override=1 ;opcache.file_cache_fallback=1 ; Enables or disables copying of PHP code (text segment) into HUGE PAGES. -; This should improve performance, but requires appropriate OS configuration. +; Under certain circumstances (if only a single global PHP process is +; started from which all others fork), this can increase performance +; by a tiny amount because TLB misses are reduced. On the other hand, this +; delays PHP startup, increases memory usage and degrades performance +; under memory pressure - use with care. +; Requires appropriate OS configuration. opcache.huge_code_pages=1 ; Validate cached file permissions. @@ -1886,6 +1821,31 @@ opcache.huge_code_pages=1 ; Prevent name collisions in chroot'ed environment. ;opcache.validate_root=0 +; If specified, it produces opcode dumps for debugging different stages of +; optimizations. +;opcache.opt_debug_level=0 + +; Specifies a PHP script that is going to be compiled and executed at server +; start-up. +; https://php.net/opcache.preload +;opcache.preload= + +; Preloading code as root is not allowed for security reasons. This directive +; facilitates to let the preloading to be run as another user. +; https://php.net/opcache.preload_user +opcache.preload_user=www-data + +; Prevents caching files that are less than this number of seconds old. It +; protects from caching of incompletely updated files. In case all file updates +; on your site are atomic, you may increase performance by setting it to "0". +;opcache.file_update_protection=2 + +; Absolute path used to store shared lockfiles (for *nix only). +;opcache.lockfile_path=/tmp + +opcache.jit_buffer_size = 128M +opcache.jit = tracing + [curl] ; A default value for the CURLOPT_CAINFO option. This is required to be an ; absolute path. @@ -1909,9 +1869,20 @@ opcache.huge_code_pages=1 ; SSL stream context option. ;openssl.capath= -opcache.jit_buffer_size = 128M -opcache.jit = tracing - -; Local Variables: -; tab-width: 4 -; End: \ No newline at end of file +; The libctx is an OpenSSL library context. OpenSSL defines a default library +; context, but PHP OpenSSL also defines its own library context to avoid +; interference with other libraries using OpenSSL and to provide an independent +; context for each thread in ZTS. Possible values: +; "custom" - use a custom library context (default) +; "default" - use the default OpenSSL library context +;openssl.libctx=custom + +[ffi] +; FFI API restriction. Possible values: +; "preload" - enabled in CLI scripts and preloaded files (default) +; "false" - always disabled +; "true" - always enabled +;ffi.enable=preload + +; List of headers files to preload, wildcard patterns allowed. +;ffi.preload= diff --git a/frameworks/PHP/codeigniter/deploy/conf/pool.d/www.conf b/frameworks/PHP/codeigniter/deploy/conf/pool.d/www.conf new file mode 100644 index 00000000000..880f3b0bb63 --- /dev/null +++ b/frameworks/PHP/codeigniter/deploy/conf/pool.d/www.conf @@ -0,0 +1,489 @@ +; Start a new pool named 'www'. +; the variable $pool can be used in any directive and will be replaced by the +; pool name ('www' here) +[www] + +; Per pool prefix +; It only applies on the following directives: +; - 'access.log' +; - 'slowlog' +; - 'listen' (unixsocket) +; - 'chroot' +; - 'chdir' +; - 'php_values' +; - 'php_admin_values' +; When not set, the global prefix (or /usr) applies instead. +; Note: This directive can also be relative to the global prefix. +; Default Value: none +;prefix = /path/to/pools/$pool + +; Unix user/group of the child processes. This can be used only if the master +; process running user is root. It is set after the child process is created. +; The user and group can be specified either by their name or by their numeric +; IDs. +; Note: If the user is root, the executable needs to be started with +; --allow-to-run-as-root option to work. +; Default Values: The user is set to master process running user by default. +; If the group is not set, the user's group is used. +user = www-data +group = www-data + +; The address on which to accept FastCGI requests. +; Valid syntaxes are: +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on +; a specific port; +; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on +; a specific port; +; 'port' - to listen on a TCP socket to all addresses +; (IPv6 and IPv4-mapped) on a specific port; +; '/path/to/unix/socket' - to listen on a unix socket. +; Note: This value is mandatory. +listen = /run/php/php-fpm.sock + +; Set listen(2) backlog. +; Default Value: 511 (-1 on Linux, FreeBSD and OpenBSD) +listen.backlog = 65535 + +; Set permissions for unix socket, if one is used. In Linux, read/write +; permissions must be set in order to allow connections from a web server. Many +; BSD-derived systems allow connections regardless of permissions. The owner +; and group can be specified either by name or by their numeric IDs. +; Default Values: Owner is set to the master process running user. If the group +; is not set, the owner's group is used. Mode is set to 0660. +listen.owner = www-data +listen.group = www-data +;listen.mode = 0660 + +; When POSIX Access Control Lists are supported you can set them using +; these options, value is a comma separated list of user/group names. +; When set, listen.owner and listen.group are ignored +;listen.acl_users = +;listen.acl_groups = + +; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. +; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original +; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address +; must be separated by a comma. If this value is left blank, connections will be +; accepted from any ip address. +; Default Value: any +;listen.allowed_clients = 127.0.0.1 + +; Set the associated the route table (FIB). FreeBSD only +; Default Value: -1 +;listen.setfib = 1 + +; Specify the nice(2) priority to apply to the pool processes (only if set) +; The value can vary from -19 (highest priority) to 20 (lower priority) +; Note: - It will only work if the FPM master process is launched as root +; - The pool processes will inherit the master process priority +; unless it specified otherwise +; Default Value: no set +; process.priority = -19 + +; Set the process dumpable flag (PR_SET_DUMPABLE prctl for Linux or +; PROC_TRACE_CTL procctl for FreeBSD) even if the process user +; or group is different than the master process user. It allows to create process +; core dump and ptrace the process for the pool user. +; Default Value: no +; process.dumpable = yes + +; Choose how the process manager will control the number of child processes. +; Possible Values: +; static - a fixed number (pm.max_children) of child processes; +; dynamic - the number of child processes are set dynamically based on the +; following directives. With this process management, there will be +; always at least 1 children. +; pm.max_children - the maximum number of children that can +; be alive at the same time. +; pm.start_servers - the number of children created on startup. +; pm.min_spare_servers - the minimum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is less than this +; number then some children will be created. +; pm.max_spare_servers - the maximum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is greater than this +; number then some children will be killed. +; pm.max_spawn_rate - the maximum number of rate to spawn child +; processes at once. +; ondemand - no children are created at startup. Children will be forked when +; new requests will connect. The following parameter are used: +; pm.max_children - the maximum number of children that +; can be alive at the same time. +; pm.process_idle_timeout - The number of seconds after which +; an idle process will be killed. +; Note: This value is mandatory. +pm = static + +; The number of child processes to be created when pm is set to 'static' and the +; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. +; This value sets the limit on the number of simultaneous requests that will be +; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. +; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP +; CGI. The below defaults are based on a server without much resources. Don't +; forget to tweak pm.* to fit your needs. +; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' +; Note: This value is mandatory. +pm.max_children = 1024 + +; The number of child processes created on startup. +; Note: Used only when pm is set to 'dynamic' +; Default Value: (min_spare_servers + max_spare_servers) / 2 +pm.start_servers = 512 + +; The desired minimum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.min_spare_servers = 50 + +; The desired maximum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.max_spare_servers = 512 + +; The number of rate to spawn child processes at once. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +; Default Value: 32 +;pm.max_spawn_rate = 32 + +; The number of seconds after which an idle process will be killed. +; Note: Used only when pm is set to 'ondemand' +; Default Value: 10s +;pm.process_idle_timeout = 10s; + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. For +; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default Value: 0 +;pm.max_requests = 500 + +; The URI to view the FPM status page. If this value is not set, no URI will be +; recognized as a status page. It shows the following information: +; pool - the name of the pool; +; process manager - static, dynamic or ondemand; +; start time - the date and time FPM has started; +; start since - number of seconds since FPM has started; +; accepted conn - the number of request accepted by the pool; +; listen queue - the number of request in the queue of pending +; connections (see backlog in listen(2)); +; max listen queue - the maximum number of requests in the queue +; of pending connections since FPM has started; +; listen queue len - the size of the socket queue of pending connections; +; idle processes - the number of idle processes; +; active processes - the number of active processes; +; total processes - the number of idle + active processes; +; max active processes - the maximum number of active processes since FPM +; has started; +; max children reached - number of times, the process limit has been reached, +; when pm tries to start more children (works only for +; pm 'dynamic' and 'ondemand'); +; Value are updated in real time. +; Example output: +; pool: www +; process manager: static +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 62636 +; accepted conn: 190460 +; listen queue: 0 +; max listen queue: 1 +; listen queue len: 42 +; idle processes: 4 +; active processes: 11 +; total processes: 15 +; max active processes: 12 +; max children reached: 0 +; +; By default the status page output is formatted as text/plain. Passing either +; 'html', 'xml' or 'json' in the query string will return the corresponding +; output syntax. Example: +; http://www.foo.bar/status +; http://www.foo.bar/status?json +; http://www.foo.bar/status?html +; http://www.foo.bar/status?xml +; +; By default the status page only outputs short status. Passing 'full' in the +; query string will also return status for each pool process. +; Example: +; http://www.foo.bar/status?full +; http://www.foo.bar/status?json&full +; http://www.foo.bar/status?html&full +; http://www.foo.bar/status?xml&full +; The Full status returns for each process: +; pid - the PID of the process; +; state - the state of the process (Idle, Running, ...); +; start time - the date and time the process has started; +; start since - the number of seconds since the process has started; +; requests - the number of requests the process has served; +; request duration - the duration in µs of the requests; +; request method - the request method (GET, POST, ...); +; request URI - the request URI with the query string; +; content length - the content length of the request (only with POST); +; user - the user (PHP_AUTH_USER) (or '-' if not set); +; script - the main script called (or '-' if not set); +; last request cpu - the %cpu the last request consumed +; it's always 0 if the process is not in Idle state +; because CPU calculation is done when the request +; processing has terminated; +; last request memory - the max amount of memory the last request consumed +; it's always 0 if the process is not in Idle state +; because memory calculation is done when the request +; processing has terminated; +; If the process is in Idle state, then information is related to the +; last request the process has served. Otherwise information is related to +; the current request being served. +; Example output: +; ************************ +; pid: 31330 +; state: Running +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 63087 +; requests: 12808 +; request duration: 1250261 +; request method: GET +; request URI: /test_mem.php?N=10000 +; content length: 0 +; user: - +; script: /home/fat/web/docs/php/test_mem.php +; last request cpu: 0.00 +; last request memory: 0 +; +; Note: There is a real-time FPM status monitoring sample web page available +; It's available in: /usr/share/php/8.5/fpm/status.html +; +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;pm.status_path = /status + +; The address on which to accept FastCGI status request. This creates a new +; invisible pool that can handle requests independently. This is useful +; if the main pool is busy with long running requests because it is still possible +; to get the status before finishing the long running requests. +; +; Valid syntaxes are: +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on +; a specific port; +; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on +; a specific port; +; 'port' - to listen on a TCP socket to all addresses +; (IPv6 and IPv4-mapped) on a specific port; +; '/path/to/unix/socket' - to listen on a unix socket. +; Default Value: value of the listen option +;pm.status_listen = 127.0.0.1:9001 + +; The ping URI to call the monitoring page of FPM. If this value is not set, no +; URI will be recognized as a ping page. This could be used to test from outside +; that FPM is alive and responding, or to +; - create a graph of FPM availability (rrd or such); +; - remove a server from a group if it is not responding (load balancing); +; - trigger alerts for the operating team (24/7). +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;ping.path = /ping + +; This directive may be used to customize the response of a ping request. The +; response is formatted as text/plain with a 200 response code. +; Default Value: pong +;ping.response = pong + +; The access log file +; Default: not set +;access.log = log/$pool.access.log + +; The access log format. +; The following syntax is allowed +; %%: the '%' character +; %C: %CPU used by the request +; it can accept the following format: +; - %{user}C for user CPU only +; - %{system}C for system CPU only +; - %{total}C for user + system CPU (default) +; %d: time taken to serve the request +; it can accept the following format: +; - %{seconds}d (default) +; - %{milliseconds}d +; - %{milli}d +; - %{microseconds}d +; - %{micro}d +; %e: an environment variable (same as $_ENV or $_SERVER) +; it must be associated with embraces to specify the name of the env +; variable. Some examples: +; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e +; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e +; %f: script filename +; %l: content-length of the request (for POST request only) +; %m: request method +; %M: peak of memory allocated by PHP +; it can accept the following format: +; - %{bytes}M (default) +; - %{kilobytes}M +; - %{kilo}M +; - %{megabytes}M +; - %{mega}M +; %n: pool name +; %o: output header +; it must be associated with embraces to specify the name of the header: +; - %{Content-Type}o +; - %{X-Powered-By}o +; - %{Transfert-Encoding}o +; - .... +; %p: PID of the child that serviced the request +; %P: PID of the parent of the child that serviced the request +; %q: the query string +; %Q: the '?' character if query string exists +; %r: the request URI (without the query string, see %q and %Q) +; %R: remote IP address +; %s: status (response code) +; %t: server time the request was received +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsulated in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %T: time the log has been written (the request has finished) +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsulated in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %u: basic auth user if specified in Authorization header +; +; Default: "%R - %u %t \"%m %r\" %s" +;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{milli}d %{kilo}M %C%%" + +; A list of request_uri values which should be filtered from the access log. +; +; As a security precaution, this setting will be ignored if: +; - the request method is not GET or HEAD; or +; - there is a request body; or +; - there are query parameters; or +; - the response code is outwith the successful range of 200 to 299 +; +; Note: The paths are matched against the output of the access.format tag "%r". +; On common configurations, this may look more like SCRIPT_NAME than the +; expected pre-rewrite URI. +; +; Default Value: not set +;access.suppress_path[] = /ping +;access.suppress_path[] = /health_check.php + +; The log file for slow requests +; Default Value: not set +; Note: slowlog is mandatory if request_slowlog_timeout is set +;slowlog = log/$pool.log.slow + +; The timeout for serving a single request after which a PHP backtrace will be +; dumped to the 'slowlog' file. A value of '0s' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_slowlog_timeout = 0 + +; Depth of slow log stack trace. +; Default Value: 20 +;request_slowlog_trace_depth = 20 + +; The timeout for serving a single request after which the worker process will +; be killed. This option should be used when the 'max_execution_time' ini option +; does not stop script execution for some reason. A value of '0' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_terminate_timeout = 0 + +; The timeout set by 'request_terminate_timeout' ini option is not engaged after +; application calls 'fastcgi_finish_request' or when application has finished and +; shutdown functions are being called (registered via register_shutdown_function). +; This option will enable timeout limit to be applied unconditionally +; even in such cases. +; Default Value: no +;request_terminate_timeout_track_finished = no + +; Set open file descriptor rlimit. +; Default Value: system defined value +;rlimit_files = 1024 + +; Set max core size rlimit. +; Possible Values: 'unlimited' or an integer greater or equal to 0 +; Default Value: system defined value +;rlimit_core = 0 + +; Chroot to this directory at the start. This value must be defined as an +; absolute path. When this value is not set, chroot is not used. +; Note: you can prefix with '$prefix' to chroot to the pool prefix or one +; of its subdirectories. If the pool prefix is not set, the global prefix +; will be used instead. +; Note: chrooting is a great security feature and should be used whenever +; possible. However, all PHP paths will be relative to the chroot +; (error_log, sessions.save_path, ...). +; Default Value: not set +;chroot = + +; Chdir to this directory at the start. +; Note: relative path can be used. +; Default Value: current directory or / when chroot +;chdir = /var/www + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environment, this can cause some delay in the page +; process time (several ms). +; Default Value: no +;catch_workers_output = yes + +; Decorate worker output with prefix and suffix containing information about +; the child that writes to the log and if stdout or stderr is used as well as +; log level and time. This options is used only if catch_workers_output is yes. +; Settings to "no" will output data as written to the stdout or stderr. +; Default value: yes +;decorate_workers_output = no + +; Clear environment in FPM workers +; Prevents arbitrary environment variables from reaching FPM worker processes +; by clearing the environment in workers before env vars specified in this +; pool configuration are added. +; Setting to "no" will make all environment variables available to PHP code +; via getenv(), $_ENV and $_SERVER. +; Default Value: yes +;clear_env = no + +; Limits the extensions of the main script FPM will allow to parse. This can +; prevent configuration mistakes on the web server side. You should only limit +; FPM to .php extensions to prevent malicious users to use other extensions to +; execute php code. +; Note: set an empty value to allow all extensions. +; Default Value: .php +;security.limit_extensions = .php .php3 .php4 .php5 .php7 + +; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from +; the current environment. +; Default Value: clean env +;env[HOSTNAME] = $HOSTNAME +;env[PATH] = /usr/local/bin:/usr/bin:/bin +;env[TMP] = /tmp +;env[TMPDIR] = /tmp +;env[TEMP] = /tmp + +; Additional php.ini defines, specific to this pool of workers. These settings +; overwrite the values previously defined in the php.ini. The directives are the +; same as the PHP SAPI: +; php_value/php_flag - you can set classic ini defines which can +; be overwritten from PHP call 'ini_set'. +; php_admin_value/php_admin_flag - these directives won't be overwritten by +; PHP call 'ini_set' +; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. + +; Defining 'extension' will load the corresponding shared extension from +; extension_dir. Defining 'disable_functions' will not overwrite previously +; defined php.ini values, but will append the new value instead. + +; Note: path INI options can be relative and will be expanded with the prefix +; (pool, global or /usr) + +; Default Value: nothing is defined by default except the values in php.ini and +; specified at startup with the -d argument +;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com +;php_flag[display_errors] = off +;php_admin_value[error_log] = /var/log/fpm-php.www.log +;php_admin_flag[log_errors] = on +;php_admin_value[memory_limit] = 32M diff --git a/frameworks/PHP/codeigniter/preload.php b/frameworks/PHP/codeigniter/preload.php new file mode 100644 index 00000000000..288b30b4ef4 --- /dev/null +++ b/frameworks/PHP/codeigniter/preload.php @@ -0,0 +1,112 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use CodeIgniter\Boot; +use Config\Paths; + +/* + *--------------------------------------------------------------- + * Sample file for Preloading + *--------------------------------------------------------------- + * See https://www.php.net/manual/en/opcache.preloading.php + * + * How to Use: + * 0. Copy this file to your project root folder. + * 1. Set the $paths property of the preload class below. + * 2. Set opcache.preload in php.ini. + * php.ini: + * opcache.preload=/path/to/preload.php + */ + +// Load the paths config file +require __DIR__ . '/app/Config/Paths.php'; + +// Path to the front controller +define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR); + +class preload +{ + /** + * @var array Paths to preload. + */ + private array $paths = [ + [ + 'include' => __DIR__ . '/vendor/codeigniter4/framework/system', // Change this path if using manual installation + 'exclude' => [ + // Not needed if you don't use them. + '/system/Database/OCI8/', + '/system/Database/Postgre/', + '/system/Database/SQLite3/', + '/system/Database/SQLSRV/', + // Not needed for web apps. + '/system/Database/Seeder.php', + '/system/Test/', + '/system/CLI/', + '/system/Commands/', + '/system/Publisher/', + '/system/ComposerScripts.php', + // Not Class/Function files. + '/system/Config/Routes.php', + '/system/Language/', + '/system/bootstrap.php', + '/system/util_bootstrap.php', + '/system/rewrite.php', + '/Views/', + // Errors occur. + '/system/ThirdParty/', + ], + ], + ]; + + public function __construct() + { + $this->loadAutoloader(); + } + + private function loadAutoloader(): void + { + $paths = new Paths(); + require rtrim($paths->systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'Boot.php'; + + Boot::preload($paths); + } + + /** + * Load PHP files. + */ + public function load(): void + { + foreach ($this->paths as $path) { + $directory = new RecursiveDirectoryIterator($path['include']); + $fullTree = new RecursiveIteratorIterator($directory); + $phpFiles = new RegexIterator( + $fullTree, + '/.+((? $file) { + foreach ($path['exclude'] as $exclude) { + if (str_contains($file[0], $exclude)) { + continue 2; + } + } + + require_once $file[0]; + // Uncomment only for debugging (to inspect which files are included). + // Never use this in production - preload scripts must not generate output. + // echo 'Loaded: ' . $file[0] . "\n"; + } + } + } +} + +(new preload())->load(); diff --git a/frameworks/PHP/codeigniter/public/.htaccess b/frameworks/PHP/codeigniter/public/.htaccess index a5d6c2a5412..abac3cb6b94 100644 --- a/frameworks/PHP/codeigniter/public/.htaccess +++ b/frameworks/PHP/codeigniter/public/.htaccess @@ -1,5 +1,5 @@ # Disable directory browsing -Options All -Indexes +Options -Indexes # ---------------------------------------------------------------------- # Rewrite engine @@ -45,5 +45,5 @@ Options All -Indexes # Disable server signature start - ServerSignature Off +ServerSignature Off # Disable server signature end diff --git a/frameworks/PHP/codeigniter/public/index.php b/frameworks/PHP/codeigniter/public/index.php index df2853effed..a0a20db43db 100644 --- a/frameworks/PHP/codeigniter/public/index.php +++ b/frameworks/PHP/codeigniter/public/index.php @@ -1,16 +1,40 @@ systemDirectory . '/Boot.php'; -exit(CodeIgniter\Boot::bootWeb($paths)); +exit(Boot::bootWeb($paths)); diff --git a/frameworks/PHP/codeigniter/spark b/frameworks/PHP/codeigniter/spark new file mode 100755 index 00000000000..e7871ea8e68 --- /dev/null +++ b/frameworks/PHP/codeigniter/spark @@ -0,0 +1,87 @@ +#!/usr/bin/env php + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use CodeIgniter\Boot; +use Config\Paths; + +/* + * -------------------------------------------------------------------- + * CODEIGNITER COMMAND-LINE TOOLS + * -------------------------------------------------------------------- + * The main entry point into the CLI system and allows you to run + * commands and perform maintenance on your application. + */ + +/* + *--------------------------------------------------------------- + * CHECK SERVER API + *--------------------------------------------------------------- + */ + +// Refuse to run when called from php-cgi +if (str_starts_with(PHP_SAPI, 'cgi')) { + exit("The cli tool is not supported when running php-cgi. It needs php-cli to function!\n\n"); +} + +/* + *--------------------------------------------------------------- + * CHECK PHP VERSION + *--------------------------------------------------------------- + */ + +$minPhpVersion = '8.1'; // If you update this, don't forget to update `public/index.php`. +if (version_compare(PHP_VERSION, $minPhpVersion, '<')) { + $message = sprintf( + 'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s', + $minPhpVersion, + PHP_VERSION, + ); + + exit($message); +} + +// We want errors to be shown when using it from the CLI. +error_reporting(E_ALL); +ini_set('display_errors', '1'); + +/* + *--------------------------------------------------------------- + * SET THE CURRENT DIRECTORY + *--------------------------------------------------------------- + */ + +// Path to the front controller +define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR); + +// Ensure the current directory is pointing to the front controller's directory +chdir(FCPATH); + +/* + *--------------------------------------------------------------- + * BOOTSTRAP THE APPLICATION + *--------------------------------------------------------------- + * This process sets up the path constants, loads and registers + * our autoloader, along with Composer's, loads our constants + * and fires up an environment-specific bootstrapping. + */ + +// LOAD OUR PATHS CONFIG FILE +// This is the line that might need to be changed, depending on your folder structure. +require FCPATH . '../app/Config/Paths.php'; +// ^^^ Change this line if you move your application folder + +$paths = new Paths(); + +// LOAD THE FRAMEWORK BOOTSTRAP FILE +require $paths->systemDirectory . '/Boot.php'; + +exit(Boot::bootSpark($paths)); diff --git a/frameworks/PHP/codeigniter/writable/.htaccess b/frameworks/PHP/codeigniter/writable/.htaccess old mode 100755 new mode 100644 index f24db0accc7..3462048add7 --- a/frameworks/PHP/codeigniter/writable/.htaccess +++ b/frameworks/PHP/codeigniter/writable/.htaccess @@ -1,6 +1,6 @@ - Require all denied + Require all denied - Deny from all + Deny from all diff --git a/frameworks/PHP/codeigniter/writable/cache/index.html b/frameworks/PHP/codeigniter/writable/cache/index.html old mode 100755 new mode 100644 diff --git a/frameworks/PHP/codeigniter/writable/debugbar/.gitkeep b/frameworks/PHP/codeigniter/writable/debugbar/.gitkeep deleted file mode 100755 index e69de29bb2d..00000000000 diff --git a/frameworks/PHP/codeigniter/writable/debugbar/index.html b/frameworks/PHP/codeigniter/writable/debugbar/index.html new file mode 100644 index 00000000000..b702fbc3967 --- /dev/null +++ b/frameworks/PHP/codeigniter/writable/debugbar/index.html @@ -0,0 +1,11 @@ + + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + + diff --git a/frameworks/PHP/codeigniter/writable/index.html b/frameworks/PHP/codeigniter/writable/index.html new file mode 100644 index 00000000000..b702fbc3967 --- /dev/null +++ b/frameworks/PHP/codeigniter/writable/index.html @@ -0,0 +1,11 @@ + + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + + diff --git a/frameworks/PHP/codeigniter/writable/logs/index.html b/frameworks/PHP/codeigniter/writable/logs/index.html old mode 100755 new mode 100644 diff --git a/frameworks/PHP/codeigniter/writable/session/index.html b/frameworks/PHP/codeigniter/writable/session/index.html old mode 100755 new mode 100644 diff --git a/frameworks/PHP/codeigniter/writable/uploads/index.html b/frameworks/PHP/codeigniter/writable/uploads/index.html old mode 100755 new mode 100644 From 539939a5669c55861ee5b1625ea643bcc036e12b Mon Sep 17 00:00:00 2001 From: Sergey Kuznetsov Date: Tue, 16 Dec 2025 15:36:14 +0500 Subject: [PATCH 2/2] Remove PHP version check --- frameworks/PHP/codeigniter/public/index.php | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/frameworks/PHP/codeigniter/public/index.php b/frameworks/PHP/codeigniter/public/index.php index a0a20db43db..10d33a94e30 100644 --- a/frameworks/PHP/codeigniter/public/index.php +++ b/frameworks/PHP/codeigniter/public/index.php @@ -3,26 +3,6 @@ use CodeIgniter\Boot; use Config\Paths; -/* - *--------------------------------------------------------------- - * CHECK PHP VERSION - *--------------------------------------------------------------- - */ - -$minPhpVersion = '8.1'; // If you update this, don't forget to update `spark`. -if (version_compare(PHP_VERSION, $minPhpVersion, '<')) { - $message = sprintf( - 'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s', - $minPhpVersion, - PHP_VERSION, - ); - - header('HTTP/1.1 503 Service Unavailable.', true, 503); - echo $message; - - exit(1); -} - /* *--------------------------------------------------------------- * SET THE CURRENT DIRECTORY
    getHeaderLine($name), 'html') ?> + getHeaderLine($name), 'html'); + } else { + foreach ($value as $i => $header) { + echo ' ('. $i+1 . ') ' . esc($header->getValueLine(), 'html'); + } + } + ?> +