Skip to content

feat(php): add PHP 8.6 and make 8.5 the default for new PHP sites - #126

Merged
mrrobot47 merged 4 commits into
EasyEngine:developfrom
mrrobot47:feat/php-8.6
Nov 19, 2026
Merged

mrrobot47 merged 4 commits into
EasyEngine:developfrom
mrrobot47:feat/php-8.6

Conversation

@mrrobot47

@mrrobot47 mrrobot47 commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds PHP 8.6 to ee site create --type=php, and moves the default PHP version for new PHP sites from 8.4 to 8.5, for EasyEngine v4.15.0.

It also puts the default PHP version in one constant, so the next default bump is a small edit, and makes create() match --php as strings. This carries the constant refactor of #113 (supersedes #113).

PHP 8.6 is opt-in with --php=8.6. The default and --php=latest move to 8.5:

before after
--php default (new sites) 8.4 8.5
--php=latest image easyengine/php8.4 easyengine/php8.5
fallback for an unsupported 8.x version 8.4 8.5
--php=8.6 rejected easyengine/php8.6
--php=8, 8.10, 08.5, 8.60 (EE's option check compares loosely and lets them through) kept as is: image easyengine/php8, easyengine/php8.10, … has no tag, the create fails late prompt to continue with 8.5
--php=' 8.5' kept with the space 8.5

Changes

  1. feat(php): add PHP 8.6 to the supported PHP versions: 8.6 in the --php help, options and $supported_php_versions of src/PHP.php. The site runs the easyengine/php8.6 image with the tag from core's img-versions.json.
  2. feat(php): make PHP 8.5 the default for new PHP sites: the --php default and help and the 8.x fallback in src/PHP.php, and the latest image in src/Site_PHP_Docker.php. The Behat features that check the default or latest site now expect 8.5 (features/site.feature, features/create.feature, features/lifecycle.feature, features/php-version.feature, features/COVERAGE.md). The README's --php help now matches the command: default 8.5, with 8.6 listed.
  3. refactor(php): read the default PHP version from one constant: PHP::DEFAULT_PHP_VERSION ('8.5') drives the latest image in src/Site_PHP_Docker.php, the 8.x fallback and create()'s fallback when --php is missing, and PHP::SUPPORTED_PHP_VERSIONS replaces the inline version list. The --php docblock keeps default: 8.5: EE's dispatcher injects it before create() runs, so it stays the effective default and --help keeps showing it (a docblock can't reference a constant).
  4. fix(php): match --php against the supported versions as strings: EE's synopsis check compares --php loosely with the options Spyc parses from the docblock (floats such as 8.5 next to strings such as '8.0'), so create() now trims the value, casts it to a string (the injected default arrives as the float 8.5) and checks it strictly against SUPPORTED_PHP_VERSIONS. Values that only match numerically (8, 8.10, 08.5) get the existing fallback prompt instead of a broken image name, a non-numeric value that gets through (a bare --php, or 8.5abc on PHP 7) is refused as unsupported instead of reaching floor() (a TypeError on PHP 8), and the stored version is always a string such as '8.5'. The php type's create has no --yes, so the prompt reads stdin, as before.

This only changes what new sites get. Existing sites keep their stored version. A site stored as latest moves to the easyengine/php8.5 image the next time its compose file is regenerated, and keeps the PHP config it already has. That's the same behaviour as in #110, which moved latest and the fallback from 8.3 to 8.4.

Why 8.5 and not 8.6

PHP 8.6.0 was released on 2026-11-19. Its image (EasyEngine/dockerfiles#385) builds memcached, redis and apcu from unreleased upstream commits, because their releases don't build on 8.6 yet, and it drops mcrypt and imap. 8.5 is the newest version with a complete extension set. 8.6 can become the default once the extensions have releases.

Dependencies

The Behat php-version.feature outline has no 8.6 row yet: it would fail until the image is published and core pins it.

Bumping the default PHP version later

  1. PHP::DEFAULT_PHP_VERSION in src/PHP.php.
  2. default: of [--php=<php-version>] in the create() docblock.
  3. The default: lines of the --php blocks in README.md.
  4. The Behat rows that expect the default or latest version (features/site.feature (default: in the help), features/create.feature, features/lifecycle.feature and features/php-version.feature). They check the default site and a latest site separately, so a bump that misses the constant or the docblock fails CI.

Testing

PHPUnit, in my local test suite (not part of this PR), on PHP 7.4 and 8.5:

  • --php input by input, through EE's real synopsis check and through create(): every listed version and latest are stored as that exact string and run easyengine/php<v> with a tag from core's img-versions.json (latest and an omitted --php → easyengine/php8.5); 8.5 is trimmed; 8, 8.10, 08.5, 8.60, 8e0, 7, 5.60 get the fallback prompt with the exact text, and answering n (or no stdin) creates nothing; the php type has no --yes, so the prompt reads stdin as before; a bare --php, 8.5abc and 8.5.0 (the last two pass EE's check only on PHP 7) are refused as unsupported; 7.1, 8.7, 9.0, 5.5, abc stay rejected by the synopsis check.
  • Drift checks: the docblock default: equals DEFAULT_PHP_VERSION, the docblock options and the "Currently only supports PHP …" sentence equal SUPPORTED_PHP_VERSIONS, every --php block in README.md matches both, every supported version has an image tag, and latest runs the same image as a site created without --php. Bumping only the constant, or only the docblock default, makes these tests fail.
  • The behaviour tests fail on the code before this change (the loose spellings, whitespace, the omitted default stored as a float) and pass with it.
  • Full suite: the only failures are the same 3 pre-existing database-name tests as on develop, on both PHP versions.
  • php -l is clean on PHP 7.4 and 8.5 for the changed files.

Behat was not run locally. The updated features run in this repo's CI. They expect easyengine/php8.5, which is already published.

Summary by CodeRabbit

  • New Features
    • PHP 8.6 is now available as an option for site commands.
  • Updates
    • PHP 8.5 is now the default for new sites, and latest selects PHP 8.5.
    • Major-version inputs such as PHP 8 can prompt to use the supported fallback version; unsupported version inputs are rejected.
  • Documentation
    • Updated command help and PHP version guidance to reflect the new default and PHP 8.6 option.

Allow `--php=8.6` for PHP sites. The site runs the easyengine/php8.6 image with the tag from core's img-versions.json. The default and `latest` stay on 8.4.
New PHP sites now default to PHP 8.5 instead of 8.4. `--php=latest` now runs the easyengine/php8.5 image, and create() now falls back to 8.5 for an 8.x version it doesn't support. PHP 8.6 stays opt-in with `--php=8.6`.

Changes: the `--php` default and help in src/PHP.php, the 8.x fallback in the same file, and the `latest` image in src/Site_PHP_Docker.php. The Behat features that check the default or `latest` site now expect 8.5. The README's `--php` help now matches the command: default 8.5, with 8.6 listed.
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: PHP version update

Layer / File(s) Summary
PHP version selection and image mapping
src/PHP.php, src/Site_PHP_Docker.php
The supported-version list adds PHP 8.6. Unsupported PHP 8.x inputs fall back to 8.5, and latest selects the image for the default PHP version.
Version expectations and command documentation
features/*.feature, features/COVERAGE.md, README.md, src/PHP.php
Feature expectations and coverage notes use PHP 8.5 as the default. Command documentation and the create() documentation add PHP 8.6 to supported versions and options.

Suggested reviewers: l0rd-zer0

Change: Feature

Merge Risk: Minimal · up to 11665

New PHP sites and latest will use PHP 8.5, and PHP 8.6 can be requested explicitly. Before release, confirm that core pins the PHP 8.6 image, otherwise --php=8.6 cannot create a site. Default behavior does not depend on that pin.

Security architecture risk: Minimal · up to 11665

The inspected change does not establish a new security-boundary or failure-containment weakness. PHP 8.6 remains opt-in, explicit stored versions retain their image mapping, and latest keeps its existing regeneration-time behavior while moving to PHP 8.5.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed runtime selection affects newly created sites using the default or PHP 8 fallback, sites requesting PHP 8.6, and stored-latest sites whose compose files are regenerated. It does not remap other explicit stored versions.

Trust Boundaries and Controls

  • inferred — For the inspected create path, caller-controlled version input is reduced to a supported version or fixed fallback before reaching image selection. The change does not introduce an arbitrary registry or image-name override through that input.

Resilience and Maintainability Implications

  • observed — The PR leaves creation-stage tracking, exception cleanup, interrupt rollback and database-ownership gating unchanged. These mechanisms are invoked by the existing lifecycle; their inherited cleanup implementation was not available for end-to-end verification.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e665d1e4-49dc-41ee-bb9d-899afb550e3a
Commits

Reviewing files that changed from the base of the PR and between f85a4a9 and 11665de.

Files selected for processing: 3

  • features/COVERAGE.md
  • src/PHP.php
  • src/Site_PHP_Docker.php
Files skipped from review as they are similar to previous changes: 1

  • features/COVERAGE.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

`PHP::DEFAULT_PHP_VERSION` ('8.5') now drives the `latest` image in `Site_PHP_Docker`, the 8.x fallback and create()'s own fallback when `--php` is missing, and `PHP::SUPPORTED_PHP_VERSIONS` replaces the inline version list. This carries over the constant refactor of EasyEngine#113.

The `--php` docblock keeps `default: 8.5`: EE's dispatcher injects it before create() runs, so it stays the effective default and `--help` keeps showing it. A docblock can't reference a constant, so a default bump changes both.

No behaviour change.
EE's synopsis check compares `--php` loosely with the options Spyc parses from the docblock (floats such as 8.5 next to strings such as '8.0'), so `8`, `8.10`, `08.5`, `8.60` or ` 8.5` pass it. create() compared loosely too and kept such values as they were, so the compose file asked for images like `easyengine/php8` or `easyengine/php8.10`, which have no tag in img-versions.json, and the create failed late.

create() now trims the value, casts it to a string (the injected docblock default arrives as the float 8.5) and checks it strictly against `SUPPORTED_PHP_VERSIONS`. Surrounding whitespace is dropped; any other spelling that isn't listed gets the existing fallback prompt (`--php=8` asks to continue with 8.5). A non-numeric value that gets through, such as a bare `--php` or `8.5abc` on PHP 7, is refused as unsupported instead of reaching floor(), which throws a TypeError on PHP 8. The fallback versions are strings as well, so the stored version is always a string such as '8.5'.

Carries over the strict check from EasyEngine#113.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant