Skip to content

Replace .pv-php with pv.yml and add php:current command#30

Merged
munezaclovis merged 3 commits intomainfrom
pv-yml-php-current
Mar 9, 2026
Merged

Replace .pv-php with pv.yml and add php:current command#30
munezaclovis merged 3 commits intomainfrom
pv-yml-php-current

Conversation

@munezaclovis
Copy link
Copy Markdown
Contributor

Summary

  • Replaces per-project .pv-php files with pv.yml (php: "8.4") for future extensibility (services, env injection, etc.)
  • Adds pv php:current command that walks up from $PWD, resolves PHP version (pv.ymlcomposer.json → global default), and prints to stdout
  • Simplifies the PHP shim from ~70 lines of bash to a 3-line delegation to pv php:current
  • Adds ProjectConfig type to internal/config/ for reading pv.yml files
  • Updates docs, e2e fixtures, and uninstall cleanup to reference pv.yml
  • Also includes colima/lima and setup TUI changes

Test plan

  • 16 tests for internal/config/pvyml_test.go (YAML parsing variants, walk-up, edge cases)
  • 9 tests for internal/commands/php/current_test.go (pv.yml, composer.json, walk-up, priority, global fallback, error cases)
  • 10 tests for internal/phpenv/resolve_test.go (updated from .pv-php to pv.yml, added walk-up tests)
  • Updated cmd/uninstall_test.go for pv.yml references
  • Updated e2e fixtures and shim test scripts
  • Full go test ./... passes

Migrate per-project PHP version config from `.pv-php` (plain text) to
`pv.yml` (YAML), enabling future extensibility (services, env, etc.).

Add `pv php:current` command that walks up from $PWD, resolves the PHP
version from pv.yml → composer.json → global default, and prints it to
stdout. The PHP shim now delegates version resolution to this command
instead of doing its own bash-based parsing.

Also includes unrelated colima/lima and setup TUI changes.
Tests direct output, walk-up resolution, and pv.yml priority over
composer.json alongside the existing shim tests.
…es, and clean up

- Surface pv.yml parse errors instead of silently falling through to wrong PHP version
- Remove 2>/dev/null from PHP shim so php:current errors are visible
- Remove worker directive from non-Octane Caddy templates (fixes FrankenPHP crash on standard Laravel apps)
- Fix symlink error handling in extractTarGz
- Inherit caller's transport/timeout in latestLimaVersion and validate HTTP status
- Use safe type assertion in setup wizard
- Surface InstalledVersions/LoadSettings errors in setup
- Update colima command descriptions to mention Lima
- Add ~/.pv/internal/lima/ to CLAUDE.md binary storage rules
- Remove dead os.IsNotExist check on RemoveAll
- Update e2e fixtures to use plain PHP for non-Octane sites
- Delete outdated plan.md
@munezaclovis munezaclovis merged commit 94b9075 into main Mar 9, 2026
1 check passed
@munezaclovis munezaclovis deleted the pv-yml-php-current branch March 9, 2026 00:48
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