Auto-install missing PHP version during pv link#38
Merged
munezaclovis merged 3 commits intomainfrom Mar 10, 2026
Merged
Conversation
- Switch from default to explicit config.AutoOn case for safety - Add TestLink_AutoOffWarnsButLinksWithMissingVersion - Add TestLink_SkipsInstallWhenNonGlobalVersionIsInstalled
munezaclovis
added a commit
that referenced
this pull request
Mar 25, 2026
- #16 (setup TUI off-by-one): cursor bound is correct, max = len+1 - #19 (StartBackgroundUpdater): IS called from server.Start() - #38 (updateSymlinks divergence): SetGlobal saves before calling, paths always agree - #39 (frankenphp logFile leak): struct only built after Start() succeeds, Process is always non-nil
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
install_php_versionautomation setting (default:true) to control whetherpv linkauto-installs a missing PHP versionpv linkresolves a PHP version (frompv.ymlorcomposer.json) that isn't installed, it now installs it automatically, prompts, or warns based on the settingHow it works
After version resolution in
pv link, if the resolved PHP version differs from the global default and isn't installed:true(default)php:installaskfalseIf installation fails, linking is aborted. If the user declines or the setting is off, linking continues with a warning.
Motivation
Previously, linking a project with an uninstalled PHP version succeeded silently, and the failure only surfaced as a 502 Bad Gateway when visiting the site. This change catches it at link time — the natural moment to bootstrap project dependencies. This also lays the groundwork for a richer
pv link/pv initthat fully bootstraps frompv.yml.Test plan
go vet ./...passes cleangofmt -l .reports no issuesgo test ./...)TestDefaultSettings_HasInstallPHPVersion,TestLookupGate_InstallPHPVersion,TestLink_SkipsInstallWhenVersionIsGlobalpv linkon a project withpv.ymlspecifying an uninstalled version triggers installinstall_php_version: askin~/.pv/pv.yml, verify prompt appearsinstall_php_version: "false", verify warning is shown but link succeeds