Skip to content

fix(php): remove stale PHP version fallbacks#111

Merged
mrrobot47 merged 1 commit into
EasyEngine:developfrom
mrrobot47:fix/php-version-fallback
Jun 15, 2026
Merged

fix(php): remove stale PHP version fallbacks#111
mrrobot47 merged 1 commit into
EasyEngine:developfrom
mrrobot47:fix/php-version-fallback

Conversation

@mrrobot47

Copy link
Copy Markdown
Member

Summary

Mirrors the PHP version cleanup done in site-type-wp. The default is already PHP 8.4 here — PR #110 (php-fpm 8.5 support) correctly bumped the --php synopsis default: to 8.4, and EE injects that into the args before create() runs. This PR removes two leftovers from earlier defaults that were dead or actively wrong.

Changes

1. Drop the dead 'latest' fallback (PHP.php:201)

- $this->site_data['php_version'] = \EE\Utils\get_flag_value( $assoc_args, 'php', 'latest' );
+ $this->site_data['php_version'] = \EE\Utils\get_flag_value( $assoc_args, 'php' );

The synopsis default: 8.4 is always populated into $assoc_args['php'] before the command runs, so the 'latest' fallback never executed. It only served to confuse and drift from the real default — same dead code that was removed from site-type-wp.

2. Remove the stale 8.0 → 'latest' remap (PHP.php:251)

- $this->site_data['php_version'] = ( 8.0 === (double) $this->site_data['php_version'] ) ? 'latest' : $this->site_data['php_version'];

This dated back to when 8.0 was the latest image. With latest now resolving to easyengine/php8.4, the remap silently rewrote an explicit --php=8.0 request to 'latest' → the php8.4 image. Removing it ensures an explicitly requested version is always honoured. site-type-wp removed its equivalent line in the "Scrape latest in php version entry" change; this repo never got that cleanup.

Behaviour

Invocation Before After
(no --php) 8.4 8.4 (unchanged)
--php=latest php8.4 image php8.4 image (unchanged)
--php=8.0 silently → php8.4 php8.0 (fixed)

No change for the default or latest; the only behavioural difference is that --php=8.0 is now honoured instead of being rewritten.

The default PHP version is already 8.4: EE injects the `--php` synopsis
default into the args before `create()` runs, so the two leftovers from
earlier defaults were dead or wrong:

- The `'latest'` fallback in the `--php` flag lookup never executed,
  since the synopsis default is always set first.
- The `8.0 === (double) ... ? 'latest'` remap dated back to when 8.0 was
  the latest image. With `latest` now resolving to php8.4, it silently
  rewrote an explicit `--php=8.0` request to the 8.4 image. Removing it
  ensures an explicitly requested version is always honoured.

Brings PHP version handling in line with site-type-wp.
@mrrobot47 mrrobot47 merged commit bfe3c87 into EasyEngine:develop Jun 15, 2026
1 of 5 checks passed
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