Skip to content

v1.11.0

Latest

Choose a tag to compare

@Thavarshan Thavarshan released this 13 Apr 18:46
· 1 commit to main since this release
fda23d1

What's New

New Commands

  • phpvm exec <version> <command> [args...] — Run a command with a specific PHP version without globally switching. Uses subshell isolation so your current shell is unaffected.
  • phpvm run <version> [script] [args...] — Shortcut for phpvm exec <version> php <script>.
  • phpvm ls-remote [pattern] — List available PHP versions from your system package manager. Supports pattern filtering (e.g., phpvm ls-remote 8.2).
  • phpvm resolve <version|alias> — Resolve a version descriptor or alias to a locally installed version number.
  • phpvm unload — Remove phpvm from the current shell session (deactivates, removes hooks, unsets all functions/variables).
  • phpvm cache clear — Clear the phpvm cache directory.

New Features

  • --no-use flag on source: source phpvm.sh --no-use loads functions without auto-switching or registering the cd hook. Useful for lazy-loading setups.
  • Bash tab completion: Context-aware completions for commands, installed versions, and alias names. Auto-loaded when phpvm is sourced.
  • Auto-set default alias on first install: The first phpvm install now automatically sets the default alias (matches nvm behaviour).
  • PHPVM_BIN export: After every version switch, $PHPVM_BIN points to the active PHP binary directory.
  • XDG_CONFIG_HOME fallback: PHPVM_DIR now respects $XDG_CONFIG_HOME/phpvm when set.

Bug Fixes

  • hash -r after version switch: Bash command hash table is now invalidated after switching, preventing stale binary resolution.
  • phpvm_current uses printf: Consistent with project conventions.

Improved

  • phpvm list output: Active version marked with -> arrow and green colouring. Default alias shown inline.
  • Help text: All commands now documented as implemented with usage examples.

Testing

  • 78 BATS tests (22 new), 0 failures.
  • ShellCheck clean (0 warnings).

Full Changelog: v1.10.0...v1.11.0

Compatibility

  • macOS bash 3.2 fix: Replaced case inside $() with if/else in ls-remote brew handler to avoid parser bug in bash 3.2.