Skip to content

chore(legacy): remove the legacy PHP installer and self-update - #186

Open
pjcdawkins wants to merge 6 commits into
mainfrom
chore/remove-legacy-installer
Open

pjcdawkins wants to merge 6 commits into
mainfrom
chore/remove-legacy-installer

Conversation

@pjcdawkins

@pjcdawkins pjcdawkins commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

The legacy CLI only runs through the Go wrapper's embedded PHP binary, so the pre-5.x installer (curl -sS https://platform.sh/cli/installer | php) and the PHP self-update code are unused.

Removed:

  • legacy/dist/ (installer, manifest, dev-build index), the installer test and scripts, and legacy/.platform.app.yaml
  • self:update, self:release and self:stats, with SelfUpdater, SelfUpdateChecker, ManifestStrategy and VersionUtil
  • the installer_url, manifest_url, github_repo, release_branch and updates.* legacy config keys
  • the padraic/phar-updater and padraic/humbug_get_contents dependencies
  • the installer config check in self:build (still used to build the embedded phar)
  • self:update from the wrapper's disabled_commands, and the UPDATES_CHECK=0 the wrapper passed to the PHP CLI

The legacy PHP minimum is raised to 8.4 (in composer.json, the Composer platform config and the dev Dockerfile), matching the embedded binary.

Docs: legacy/README.md described the archived standalone CLI; it is now a short developer note, absorbing legacy/CONTRIBUTING.md. The configuration and environment variable docs move to a new Configuration section in the root README (also fixing SSH_AUTO_LOAD_CERT → AUTO_LOAD_SSH_CERT).

The platform.sh/cli/installer and manifest.json URLs are hosted separately and are not affected.

🤖 Generated with Claude Code

The legacy CLI now only runs through the Go wrapper's embedded PHP binary,
so the pre-5.x installer and self-update code paths are unused.

Removed:
- dist/ (installer.php, manifest.json, dev-build-index.php), the
  installer test and scripts, and .platform.app.yaml (dev-build hosting)
- self:update, self:release and self:stats, with SelfUpdater,
  SelfUpdateChecker and ManifestStrategy
- the installer_url, manifest_url, github_repo, release_branch and
  updates.* legacy config keys
- the padraic/phar-updater and padraic/humbug_get_contents dependencies
- the installer config check in self:build
- the "Legacy installer" README section

The https://platform.sh/cli/installer and manifest.json URLs are hosted
separately and are not affected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@upsun-dispatch upsun-dispatch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Reviewed — No blocking findings · 🔵 2 minor points

🔍 Full review · 30 files reviewed

🔵 Minor points

  • legacy/config-defaults.yaml:399 — The PR removes the updates.check key, but internal/legacy/legacy.go:144 still passes envPrefix+"UPDATES_CHECK=0" to every legacy PHP process. The setting existed to keep SelfUpdateChecker quiet, and that class is now deleted, so the variable no longer affects anything. It also suggests the PHP layer still has an update check.
  • legacy/src/Command/Self/SelfReleaseCommand.php:17 — Platformsh\Cli\Util\VersionUtil was only used by self:release and the self-update code. With both removed, nothing in legacy/src calls it; only tests/Util/VersionUtilTest.php does. The class and its test are now dead code that the PR left behind.
Verification
  • Nothing under legacy/src, legacy/tests or legacy/resources still references SelfUpdateChecker, SelfUpdater, ManifestStrategy, or the removed config keys (installer_url, manifest_url, github_repo, release_branch, updates.*).
  • phpstan-baseline.neon has no leftover entries for the deleted files, so phpstan's unmatched-ignore check will not fail on them.
  • SelfBuildCommand is still complete after checkInstallerFile() is removed, and none of its imports were used only by that method.
  • Application.php still uses $container after the update-check block is removed; the LegacyMigration check on the next lines reads it.
  • No CI workflow, Makefile target or box config refers to legacy/dist or the deleted scripts/test/installer.sh and build-and-install.sh.

No tests were added. The deletions are covered by the ci.yml PHP job (php-cs-fixer, phpstan, PHPUnit via scripts/test/unit.sh, and a self:build phar build), and the Go test job covers the edits to the wrapper config. commands/abbreviation_test.go keeps self:update only as a stub fixture, so it does not depend on the real command.

Review details
  • Commit: e3dc24a
  • Model: claude-opus-5-5

Review 1 of 10 for this pull request · View the full run

VersionUtil was only used by self:release and the self-update code.

Also note why the wrapper still sets UPDATES_CHECK=0 for the PHP CLI:
wrapper processes spawned from it (e.g. ssh-cert:load via SSH config)
inherit the variable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@upsun-dispatch upsun-dispatch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Reviewed — No new issues found · 1 still open

🔁 Incremental · 3 files reviewed

Outstanding from earlier reviews:

  • 🔵 legacy/src/Command/Self/SelfReleaseCommand.php:17: Leaves unused code to maintain. (first raised)
Verification
  • Nothing in the .php, .go, .yaml or .neon files still refers to VersionUtil, so deleting it and its test leaves no dangling reference.
  • internal/update.go:122 reads EnvPrefix+"UPDATES_CHECK", so the env var on legacy.go line 145 still stops update checks in Go wrapper processes that the PHP CLI starts, as the new comment says.

This increment deletes an unused PHP utility and its test, and adds one comment. No test is added. The VersionUtil removal is covered by the PHPUnit and PHPStan runs on the legacy code; the comment changes no behaviour.

Review details

Review 2 of 10 for this pull request · View the full run

legacy/README.md described the archived standalone CLI (install,
upgrade and usage for platformsh/cli). It is now a short developer
note for the PHP layer, and absorbs the still-relevant parts of
legacy/CONTRIBUTING.md, which pointed at the archived repository.

The user config file and environment variable docs move to a new
Configuration section in the root README, using the UPSUN_CLI_ prefix.
This also fixes the SSH certificate variable name, which is
AUTO_LOAD_SSH_CERT, not SSH_AUTO_LOAD_CERT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@upsun-dispatch

upsun-dispatch Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

📋 PR Summary

This PR removes the pre-5.x PHP installer and the PHP self-update code. The legacy CLI now only runs through the Go wrapper's embedded PHP binary, so these were no longer used. The related commands, services, config keys, Composer dependencies and tests are removed too, and the legacy PHP minimum goes up to 8.4. The docs move into a new Configuration section in the root README. The latest push stops the wrapper from setting UPDATES_CHECK=0 for the PHP process, since the PHP layer no longer has an update check.

Changes
Layer / File(s) Summary
Go wrapper
internal/legacy/legacy.go No longer sets the &lt;PREFIX>UPDATES_CHECK=0 environment variable when running the legacy PHP CLI.
internal/legacy/cert_store_windows_test.go Removes one line from the test to match the wrapper change.
internal/config/platformsh-cli.yaml Removes self:update from disabled_commands.
internal/config/upsun-cli.yaml Removes self:update from disabled_commands.
Docs
README.md Adds a Configuration section covering config and environment variables, and corrects SSH_AUTO_LOAD_CERT to AUTO_LOAD_SSH_CERT.
docs/design/update-message-install-detection.md Changes the double-notification explanation to say the PHP layer has no update check of its own.
legacy/README.md Rewritten as a short developer note that absorbs the content of CONTRIBUTING.md.
legacy/CONTRIBUTING.md Removed; its content is now in legacy/README.md.
Installer and distribution
legacy/dist/installer.php Removes the legacy PHP installer.
legacy/dist/manifest.json Removes the update manifest.
legacy/dist/dev-build-index.php Removes the dev-build index.
legacy/dist/README.md Removed along with the rest of legacy/dist/.
legacy/.platform.app.yaml Removes the hosting app config for the installer.
legacy/scripts/test/build-and-install.sh Removes the installer test script.
legacy/scripts/test/installer.sh Removes the installer test script.
legacy/tests/InstallerTest.php Removes the installer test.
Self-update code
legacy/src/Command/Self/SelfUpdateCommand.php Removes the self:update command.
legacy/src/Command/Self/SelfReleaseCommand.php Removes the self:release command.
legacy/src/Command/Self/SelfStatsCommand.php Removes the self:stats command.
legacy/src/Command/Self/SelfBuildCommand.php Removes the installer config check; the command is kept because it builds the embedded phar.
legacy/src/SelfUpdate/ManifestStrategy.php Removed.
legacy/src/Service/SelfUpdateChecker.php Removed.
legacy/src/Service/SelfUpdater.php Removed.
legacy/src/Util/VersionUtil.php Removed.
legacy/tests/Util/VersionUtilTest.php Removed along with VersionUtil.
legacy/src/Application.php Removes references to the deleted commands and services.
legacy/src/Rector/InjectCommandServicesRector.php Removes references to the deleted services.
legacy/config/services.yaml Removes the definitions for the deleted services.
Config, dependencies and tooling
legacy/config-defaults.yaml Removes the installer_url, manifest_url, github_repo, release_branch and updates.* keys.
legacy/config.yaml Removes the keys that are no longer used.
legacy/composer.json Drops the padraic phar-updater and humbug_get_contents packages and raises the PHP requirement to 8.4.
legacy/composer.lock Updated to match the dependency changes.
legacy/Dockerfile Moves the dev image to PHP 8.4.
legacy/phpstan-baseline.neon Removes baseline entries for the deleted code.
legacy/phpstan.neon Removes paths that no longer exist.
legacy/.php-cs-fixer.dist.php Removes a reference to a deleted path.

@upsun-dispatch upsun-dispatch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Reviewed — No new issues found · 1 still open

🔁 Incremental · 3 files reviewed

Outstanding from earlier reviews:

  • 🔵 legacy/src/Command/Self/SelfReleaseCommand.php:17: Leaves unused code to maintain. (first raised)
Verification
  • Every env var listed in the new README Configuration section matches the code: the Config.php override map for TOKEN, DEBUG, DISABLE_CACHE, DEFAULT_TIMEOUT, SESSION_ID and AUTO_LOAD_SSH_CERT, plus the direct reads in Application.php and SelfInstallCommand.
  • The documented colour behaviour matches Application.php: CLICOLOR_FORCE=1 turns colour on, and NO_COLOR or CLICOLOR_FORCE=0 turns it off.
  • The user config path ~/.upsun-cli/config.yaml comes from Config.php, which reads getUserConfigDir()/config.yaml, and from user_config_dir .upsun-cli in upsun-cli.yaml.
  • The make lint, make test and make clean targets and the .env-dist file cited in legacy/README.md all exist under legacy/.
  • No remaining file in the repo links to the deleted legacy/CONTRIBUTING.md.

This increment only changes documentation, so no tests cover it. I checked the documented env vars, paths and make targets by hand against legacy/src and legacy/Makefile.

Review details

Review 3 of 10 for this pull request · View the full run

The wrapper embeds PHP 8.4, so raise the minimum and the Composer
platform version to match, and update the development Dockerfile.
Locked dependency versions are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@upsun-dispatch upsun-dispatch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Reviewed — No new issues found · 1 still open

🔁 Incremental · 3 files reviewed

Outstanding from earlier reviews:

  • 🔵 legacy/src/Command/Self/SelfReleaseCommand.php:17: Leaves unused code to maintain. (first raised)
Verification
  • composer.json require.php, config.platform.php and composer.lock platform/platform-overrides all consistently say 8.4.
  • legacy/Dockerfile base image php:8.4-cli matches the php-version '8.4' set in ci.yml and release.yml.
  • No locked dependency in composer.lock declares a PHP constraint that excludes 8.4 (only ^8.1 and ^8.2 remain).
  • internal/legacy/legacy.go now documents UPDATES_CHECK=0 as suppressing update checks in wrapper processes the PHP CLI spawns.

No tests change in these commits. The ci.yml jobs that set up PHP use php-version '8.4' (lines 67 and 112), and the composer.lock platform settings were regenerated to match; I did not read those jobs or see their results.

Review details

Review 4 of 10 for this pull request · View the full run

@upsun-dispatch upsun-dispatch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Reviewed — No new issues found · 1 still open

🔁 Incremental (base moved) · 1 base file checked

Outstanding from earlier reviews:

  • 🔵 legacy/src/Command/Self/SelfReleaseCommand.php:17: Leaves unused code to maintain. (first raised)
Verification
  • The base fixture change only touches legacy/tests/data/apps/build-deps/php/_platform.app.yaml, which none of the files this PR removed refer to.
  • legacy/tests/Local/BuildFlavor/DependenciesTest.php still points at tests/data/apps/build-deps, a directory this PR does not touch.
  • internal/update.go:122 reads <PREFIX>UPDATES_CHECK, so the variable set at internal/legacy/legacy.go:145 still stops update checks in wrapper processes the PHP CLI starts.

This round has no PR diff. The base change is a fixture used by DependenciesTest, which runs with the legacy PHP unit tests (make test in legacy/). No PR test covers the fixture's interaction with this change, and none is needed.

Review details

Review 5 of 10 for this pull request · View the full run

It only disabled the PHP CLI's own update checker, which has been
removed. The wrapper's update check is passive in the processes the
PHP CLI may spawn (e.g. ssh-cert:load via SSH config): it prints only
a notice, and not in quiet mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@upsun-dispatch upsun-dispatch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Changes suggested — 🟡 1 warning · 1 still open

🔁 Incremental (head + base moved) · 2 files reviewed

Outstanding from earlier reviews:

  • 🔵 legacy/src/Command/Self/SelfReleaseCommand.php:17: Leaves unused code to maintain. (first raised)
Verification
  • internal/update.go:122 still gates the Go update check on &lt;PREFIX>UPDATES_CHECK != "0", so the variable is still read by the Go side.
  • No other env var passed in Exec (MIGRATE_CHECK, WRAPPED, etc.) is checked by shouldCheckForUpdate, so nothing else turns off the check in nested wrapper processes.
  • The base change (#187) only changes LocalProject::getGitExcludePath/writeGitExclude and tests, and none of the symbols this PR removes are involved.

This increment has no tests. No Go test checks the environment CLIWrapper.Exec builds, or checks that nested wrapper processes skip the update check. The Go test job (make test) will not catch the removal.

Review details

Review 6 of 10 for this pull request · View the full run

Comment thread internal/legacy/legacy.go

This branch has not been deployed

No deployments
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