diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index c00e70ba3291..3f99053424ec 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -25,10 +25,10 @@ body: description: Which PHP versions did you run your code? multiple: true options: - - '8.1' - '8.2' - '8.3' - '8.4' + - '8.5' validations: required: true diff --git a/.github/workflows/deploy-apidocs.yml b/.github/workflows/deploy-apidocs.yml index a660e33eb03c..686487346655 100644 --- a/.github/workflows/deploy-apidocs.yml +++ b/.github/workflows/deploy-apidocs.yml @@ -43,7 +43,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' tools: phive coverage: none diff --git a/.github/workflows/deploy-userguide-latest.yml b/.github/workflows/deploy-userguide-latest.yml index 8fee24da6299..94ba76dd9fbd 100644 --- a/.github/workflows/deploy-userguide-latest.yml +++ b/.github/workflows/deploy-userguide-latest.yml @@ -30,7 +30,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' coverage: none - name: Setup Python diff --git a/.github/workflows/reusable-phpunit-test.yml b/.github/workflows/reusable-phpunit-test.yml index 86a0d07bd228..0a8f37422c58 100644 --- a/.github/workflows/reusable-phpunit-test.yml +++ b/.github/workflows/reusable-phpunit-test.yml @@ -175,7 +175,7 @@ jobs: - name: Setup global environment variables run: | echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV - echo "ARTIFACT_NAME=${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-db-${{ inputs.db-platform || 'none' }}" >> $GITHUB_ENV + echo "ARTIFACT_NAME=${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-db-${{ inputs.db-platform || 'none' }}${{ inputs.mysql-version || '' }}" >> $GITHUB_ENV - name: Cache dependencies uses: actions/cache@v5 @@ -214,6 +214,7 @@ jobs: DB: ${{ inputs.db-platform }} TACHYCARDIA_MONITOR_GA: ${{ inputs.enable-profiling && 'enabled' || '' }} TERM: xterm-256color + continue-on-error: ${{ inputs.php-version == '8.5' }} - name: Upload coverage results as artifact if: ${{ inputs.enable-artifact-upload }} diff --git a/.github/workflows/test-autoreview.yml b/.github/workflows/test-autoreview.yml index 55300ae5eff5..891b928793b8 100644 --- a/.github/workflows/test-autoreview.yml +++ b/.github/workflows/test-autoreview.yml @@ -26,8 +26,8 @@ jobs: name: Automatic Code Review uses: ./.github/workflows/reusable-serviceless-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo with: - job-name: PHP 8.1 - php-version: '8.1' + job-name: PHP 8.2 + php-version: '8.2' job-id: auto-review-tests group-name: AutoReview @@ -47,7 +47,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' - name: Install dependencies run: composer update diff --git a/.github/workflows/test-coding-standards.yml b/.github/workflows/test-coding-standards.yml index c122f1e25b62..b20ea882772b 100644 --- a/.github/workflows/test-coding-standards.yml +++ b/.github/workflows/test-coding-standards.yml @@ -28,8 +28,10 @@ jobs: fail-fast: false matrix: php-version: - - '8.1' - - '8.4' + - '8.2' + include: + - php-version: '8.5' + composer-option: '--ignore-platform-req=php' steps: - name: Checkout base branch for PR @@ -61,7 +63,7 @@ jobs: ${{ runner.os }}- - name: Install dependencies - run: composer update --ansi --no-interaction + run: composer update --ansi --no-interaction ${{ matrix.composer-option }} - name: Run lint run: composer cs diff --git a/.github/workflows/test-deptrac.yml b/.github/workflows/test-deptrac.yml index a301f3552d55..b95bb8ec717e 100644 --- a/.github/workflows/test-deptrac.yml +++ b/.github/workflows/test-deptrac.yml @@ -48,7 +48,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' tools: composer extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3 diff --git a/.github/workflows/test-phpstan.yml b/.github/workflows/test-phpstan.yml index 5634b634d482..62dd759b6bbb 100644 --- a/.github/workflows/test-phpstan.yml +++ b/.github/workflows/test-phpstan.yml @@ -57,7 +57,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' extensions: intl coverage: none diff --git a/.github/workflows/test-phpunit.yml b/.github/workflows/test-phpunit.yml index 62a8ab0e4338..d9191cec858d 100644 --- a/.github/workflows/test-phpunit.yml +++ b/.github/workflows/test-phpunit.yml @@ -56,10 +56,10 @@ jobs: strategy: matrix: php-version: - - '8.1' - '8.2' - '8.3' - '8.4' + - '8.5' uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo with: @@ -83,10 +83,10 @@ jobs: fail-fast: false matrix: php-version: - - '8.1' - '8.2' - '8.3' - '8.4' + - '8.5' db-platform: - MySQLi - OCI8 @@ -96,7 +96,7 @@ jobs: mysql-version: - '8.0' include: - - php-version: '8.1' + - php-version: '8.2' db-platform: MySQLi mysql-version: '5.7' @@ -123,10 +123,10 @@ jobs: strategy: matrix: php-version: - - '8.1' - '8.2' - '8.3' - '8.4' + - '8.5' uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo with: @@ -149,10 +149,10 @@ jobs: strategy: matrix: php-version: - - '8.1' - '8.2' - '8.3' - '8.4' + - '8.5' uses: ./.github/workflows/reusable-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo with: @@ -163,7 +163,8 @@ jobs: enable-artifact-upload: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }} enable-coverage: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }} enable-profiling: ${{ matrix.php-version == needs.coverage-php-version.outputs.version }} - extra-extensions: redis, memcached + extra-extensions: redis, memcached, apcu + extra-ini-options: apc.enable_cli=1 extra-composer-options: ${{ matrix.composer-option }} coveralls: diff --git a/.github/workflows/test-psalm.yml b/.github/workflows/test-psalm.yml index a2ad9668bd91..c7a85cd275d9 100644 --- a/.github/workflows/test-psalm.yml +++ b/.github/workflows/test-psalm.yml @@ -24,7 +24,12 @@ jobs: build: name: Psalm Analysis runs-on: ubuntu-latest - if: (! contains(github.event.head_commit.message, '[ci skip]')) + + strategy: + fail-fast: false + matrix: + php-version: + - '8.2' steps: - name: Checkout base branch for PR @@ -39,7 +44,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: ${{ matrix.php-version }} extensions: intl, json, mbstring, xml, mysqli, oci8, pgsql, sqlsrv, sqlite3 coverage: none env: @@ -66,7 +71,9 @@ jobs: restore-keys: ${{ runner.os }}-psalm- - name: Install dependencies - run: composer update --ansi --no-interaction + run: | + composer require sebastian/diff:^5.0 --ansi --working-dir utils + composer update --ansi --no-interaction - name: Run Psalm analysis run: utils/vendor/bin/psalm diff --git a/.github/workflows/test-rector.yml b/.github/workflows/test-rector.yml index 72bbf8198875..964823299a38 100644 --- a/.github/workflows/test-rector.yml +++ b/.github/workflows/test-rector.yml @@ -40,12 +40,17 @@ permissions: jobs: build: - name: PHP ${{ matrix.php-versions }} Analyze code (Rector) + name: PHP ${{ matrix.php-version }} Analyze code (Rector) runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: - php-versions: ['8.1', '8.4'] + php-version: + - '8.2' + include: + - php-version: '8.5' + composer-option: '--ignore-platform-req=php' + steps: - name: Checkout base branch for PR if: github.event_name == 'pull_request' @@ -59,7 +64,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php-versions }} + php-version: ${{ matrix.php-version }} extensions: intl - name: Use latest Composer @@ -79,7 +84,7 @@ jobs: restore-keys: ${{ runner.os }}-composer- - name: Install dependencies - run: composer update --ansi --no-interaction + run: composer update --ansi --no-interaction ${{ matrix.composer-option }} - name: Rector Cache uses: actions/cache@v5 diff --git a/.gitignore b/.gitignore index 988be09b1948..485512fa4a7b 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,9 @@ $RECYCLE.BIN/ .env .vagrant Vagrantfile +user_guide_src/venv/ +.python-version +user_guide_src/.python-version #------------------------- # Temporary Files diff --git a/README.md b/README.md index 77419c2a2348..6a4e1025a8f5 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Made with [contrib.rocks](https://contrib.rocks). ## Server Requirements -PHP version 8.1 or higher is required, with the following extensions installed: +PHP version 8.2 or higher is required, with the following extensions installed: - [intl](http://php.net/manual/en/intl.requirements.php) - [mbstring](http://php.net/manual/en/mbstring.installation.php) @@ -95,8 +95,9 @@ PHP version 8.1 or higher is required, with the following extensions installed: > [!WARNING] > - The end of life date for PHP 7.4 was November 28, 2022. > - The end of life date for PHP 8.0 was November 26, 2023. -> - If you are still using PHP 7.4 or 8.0, you should upgrade immediately. -> - The end of life date for PHP 8.1 will be December 31, 2025. +> - The end of life date for PHP 8.1 was December 31, 2025. +> - If you are still using a PHP version below 8.2, you should upgrade immediately. +> - The end of life date for PHP 8.2 will be December 31, 2026. Additionally, make sure that the following extensions are enabled in your PHP: diff --git a/admin/framework/README.md b/admin/framework/README.md index a23783ac316a..dd39ef950968 100644 --- a/admin/framework/README.md +++ b/admin/framework/README.md @@ -42,7 +42,7 @@ Please read the [*Contributing to CodeIgniter*](https://github.com/codeigniter4/ ## Server Requirements -PHP version 8.1 or higher is required, with the following extensions installed: +PHP version 8.2 or higher is required, with the following extensions installed: - [intl](http://php.net/manual/en/intl.requirements.php) - [mbstring](http://php.net/manual/en/mbstring.installation.php) @@ -50,8 +50,9 @@ PHP version 8.1 or higher is required, with the following extensions installed: > [!WARNING] > - The end of life date for PHP 7.4 was November 28, 2022. > - The end of life date for PHP 8.0 was November 26, 2023. -> - If you are still using PHP 7.4 or 8.0, you should upgrade immediately. -> - The end of life date for PHP 8.1 will be December 31, 2025. +> - The end of life date for PHP 8.1 was December 31, 2025. +> - If you are still using below PHP 8.2, you should upgrade immediately. +> - The end of life date for PHP 8.2 will be December 31, 2026. Additionally, make sure that the following extensions are enabled in your PHP: diff --git a/admin/framework/composer.json b/admin/framework/composer.json index 7a6e1c58a1e1..ab34d89fd260 100644 --- a/admin/framework/composer.json +++ b/admin/framework/composer.json @@ -10,10 +10,10 @@ "slack": "https://codeigniterchat.slack.com" }, "require": { - "php": "^8.1", + "php": "^8.2", "ext-intl": "*", "ext-mbstring": "*", - "laminas/laminas-escaper": "^2.17", + "laminas/laminas-escaper": "^2.18", "psr/log": "^3.0" }, "require-dev": { @@ -27,6 +27,7 @@ "predis/predis": "^3.0" }, "suggest": { + "ext-apcu": "If you use Cache class ApcuHandler", "ext-curl": "If you use CURLRequest class", "ext-dom": "If you use TestResponse", "ext-exif": "If you run Image class tests", @@ -38,7 +39,9 @@ "ext-memcached": "If you use Cache class MemcachedHandler with Memcached", "ext-mysqli": "If you use MySQL", "ext-oci8": "If you use Oracle Database", + "ext-pcntl": "If you use Signals", "ext-pgsql": "If you use PostgreSQL", + "ext-posix": "If you use Signals", "ext-readline": "Improves CLI::input() usability", "ext-redis": "If you use Cache class RedisHandler", "ext-simplexml": "If you format XML", diff --git a/admin/starter/.github/workflows/phpunit.yml b/admin/starter/.github/workflows/phpunit.yml index 2be22ec16095..fb5e3a2cb7e0 100644 --- a/admin/starter/.github/workflows/phpunit.yml +++ b/admin/starter/.github/workflows/phpunit.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: - php-versions: ['8.1', '8.3'] + php-versions: ['8.2', '8.4'] runs-on: ubuntu-latest diff --git a/admin/starter/README.md b/admin/starter/README.md index d14b4c9c804c..45f98af6033e 100644 --- a/admin/starter/README.md +++ b/admin/starter/README.md @@ -50,7 +50,7 @@ Problems with it can be raised on our forum, or as issues in the main repository ## Server Requirements -PHP version 8.1 or higher is required, with the following extensions installed: +PHP version 8.2 or higher is required, with the following extensions installed: - [intl](http://php.net/manual/en/intl.requirements.php) - [mbstring](http://php.net/manual/en/mbstring.installation.php) @@ -58,8 +58,9 @@ PHP version 8.1 or higher is required, with the following extensions installed: > [!WARNING] > - The end of life date for PHP 7.4 was November 28, 2022. > - The end of life date for PHP 8.0 was November 26, 2023. -> - If you are still using PHP 7.4 or 8.0, you should upgrade immediately. -> - The end of life date for PHP 8.1 will be December 31, 2025. +> - The end of life date for PHP 8.1 was December 31, 2025. +> - If you are still using below PHP 8.2, you should upgrade immediately. +> - The end of life date for PHP 8.2 will be December 31, 2026. Additionally, make sure that the following extensions are enabled in your PHP: diff --git a/admin/starter/composer.json b/admin/starter/composer.json index 38a51e29fb64..d47149e0287f 100644 --- a/admin/starter/composer.json +++ b/admin/starter/composer.json @@ -10,8 +10,8 @@ "slack": "https://codeigniterchat.slack.com" }, "require": { - "php": "^8.1", - "codeigniter4/framework": "^4.0" + "php": "^8.2", + "codeigniter4/framework": "^4.7" }, "require-dev": { "fakerphp/faker": "^1.9", diff --git a/app/Config/CURLRequest.php b/app/Config/CURLRequest.php index 5a3d4e9311b2..bc5947fb7bb7 100644 --- a/app/Config/CURLRequest.php +++ b/app/Config/CURLRequest.php @@ -6,6 +6,22 @@ class CURLRequest extends BaseConfig { + /** + * -------------------------------------------------------------------------- + * CURLRequest Share Connection Options + * -------------------------------------------------------------------------- + * + * Share connection options between requests. + * + * @var list + * + * @see https://www.php.net/manual/en/curl.constants.php#constant.curl-lock-data-connect + */ + public array $shareConnectionOptions = [ + CURL_LOCK_DATA_CONNECT, + CURL_LOCK_DATA_DNS, + ]; + /** * -------------------------------------------------------------------------- * CURLRequest Share Options diff --git a/app/Config/Cache.php b/app/Config/Cache.php index 1169c95ff7ee..38ac5419d84c 100644 --- a/app/Config/Cache.php +++ b/app/Config/Cache.php @@ -3,6 +3,7 @@ namespace Config; use CodeIgniter\Cache\CacheInterface; +use CodeIgniter\Cache\Handlers\ApcuHandler; use CodeIgniter\Cache\Handlers\DummyHandler; use CodeIgniter\Cache\Handlers\FileHandler; use CodeIgniter\Cache\Handlers\MemcachedHandler; @@ -112,14 +113,24 @@ class Cache extends BaseConfig * Your Redis server can be specified below, if you are using * the Redis or Predis drivers. * - * @var array{host?: string, password?: string|null, port?: int, timeout?: int, database?: int} + * @var array{ + * host?: string, + * password?: string|null, + * port?: int, + * timeout?: int, + * async?: bool, + * persistent?: bool, + * database?: int + * } */ public array $redis = [ - 'host' => '127.0.0.1', - 'password' => null, - 'port' => 6379, - 'timeout' => 0, - 'database' => 0, + 'host' => '127.0.0.1', + 'password' => null, + 'port' => 6379, + 'timeout' => 0, + 'async' => false, // specific to Predis and ignored by the native Redis extension + 'persistent' => false, + 'database' => 0, ]; /** @@ -133,6 +144,7 @@ class Cache extends BaseConfig * @var array> */ public array $validHandlers = [ + 'apcu' => ApcuHandler::class, 'dummy' => DummyHandler::class, 'file' => FileHandler::class, 'memcached' => MemcachedHandler::class, @@ -159,4 +171,28 @@ class Cache extends BaseConfig * @var bool|list */ public $cacheQueryString = false; + + /** + * -------------------------------------------------------------------------- + * Web Page Caching: Cache Status Codes + * -------------------------------------------------------------------------- + * + * HTTP status codes that are allowed to be cached. Only responses with + * these status codes will be cached by the PageCache filter. + * + * Default: [] - Cache all status codes (backward compatible) + * + * Recommended: [200] - Only cache successful responses + * + * You can also use status codes like: + * [200, 404, 410] - Cache successful responses and specific error codes + * [200, 201, 202, 203, 204] - All 2xx successful responses + * + * WARNING: Using [] may cache temporary error pages (404, 500, etc). + * Consider restricting to [200] for production applications to avoid + * caching errors that should be temporary. + * + * @var list + */ + public array $cacheStatusCodes = []; } diff --git a/app/Config/ContentSecurityPolicy.php b/app/Config/ContentSecurityPolicy.php index 2ac41a70dadb..f64a9af22b0a 100644 --- a/app/Config/ContentSecurityPolicy.php +++ b/app/Config/ContentSecurityPolicy.php @@ -30,6 +30,11 @@ class ContentSecurityPolicy extends BaseConfig */ public ?string $reportURI = null; + /** + * Specifies a reporting endpoint to which violation reports ought to be sent. + */ + public ?string $reportTo = null; + /** * Instructs user agents to rewrite URL schemes, changing * HTTP to HTTPS. This directive is for websites with @@ -38,12 +43,12 @@ class ContentSecurityPolicy extends BaseConfig public bool $upgradeInsecureRequests = false; // ------------------------------------------------------------------------- - // Sources allowed + // CSP DIRECTIVES SETTINGS // NOTE: once you set a policy to 'none', it cannot be further restricted // ------------------------------------------------------------------------- /** - * Will default to self if not overridden + * Will default to `'self'` if not overridden * * @var list|string|null */ @@ -56,6 +61,21 @@ class ContentSecurityPolicy extends BaseConfig */ public $scriptSrc = 'self'; + /** + * Specifies valid sources for JavaScript