Skip to content

Sprint 13: WP-CLI support (phpvm wp-cli) + legacy hook verb removal (1.11.0)#22

Merged
devhardiyanto merged 6 commits into
mainfrom
feat/sprint13-wp-cli
Jul 17, 2026
Merged

Sprint 13: WP-CLI support (phpvm wp-cli) + legacy hook verb removal (1.11.0)#22
devhardiyanto merged 6 commits into
mainfrom
feat/sprint13-wp-cli

Conversation

@devhardiyanto

Copy link
Copy Markdown
Owner

What

Sprint 13 (v1.11.0): new phpvm wp-cli command — global WP-CLI install that follows the active PHP version — plus hard removal of the legacy phpvm hook install/uninstall/remove verb aliases.

Breaking: phpvm hook install/uninstall/remove removed — use phpvm hook enable/disable. The old verbs were a one-sprint compatibility shim from Sprint 12 and now fall through to the phpvm hook usage help.

Why

B18 (WP-CLI support, cross-platform) + B19 (post-1.10.0 housekeeping — the audit found no dead code, only these lingering aliases). Plan: docs/reports/arch/sprint13-plan.md.

How

phpvm wp-cli is modeled 1:1 on phpvm composer, the existing precedent for a global CLI phar: wp-cli.phar in ~/.phpvm/, a wp shim in ~/.phpvm/bin/ (on PATH) that runs whatever PHP is active. Integrity is verified against the upstream wp-cli.phar.sha512 via PHP's own hash_file('sha512', ...) — no sha512sum/shasum, so one code path covers Linux (GNU) and macOS (BSD). Windows honors the existing PHPVM_SKIP_HASH escape hatch.

Changes

  • windows/phpvm.ps1Invoke-WpCli + dispatcher/help/did-you-mean wiring; hook aliases removed from Invoke-Hook
  • linux/phpvm.shphpvm_wp_cli + dispatcher/help/did-you-mean wiring; hook aliases removed from phpvm_hook
  • tests/windows/WpCli.Tests.ps1 — install, idempotency, hash-mismatch, skip-hash (mocked, offline)
  • tests/linux/commands.bats — same coverage via curl-stub + fake-php doubles, plus dispatch route
  • README.md — new WP-CLI section; Windows hook examples now use enable/disable
  • Version bump 1.10.0 → 1.11.0 (5 files)

Testing Done

  • Pester 74/74 passed (PowerShell 7.6, offline)
  • PSScriptAnalyzer clean
  • bash -n on phpvm.sh/install.sh; wp-cli install/idempotency/mismatch flows exercised manually in Git Bash (bats not available locally — CI runs it)

… aliases

Old verbs now fall through to the hook usage help; use enable/disable.
README Windows auto-switch section updated to match.

devhardiyanto
…verification

Modeled on Invoke-Composer: wp-cli.phar in $PHPVM_DIR, wp.bat shim in
$PHPVM_BIN so wp follows the active PHP version. Hash verified via PHP
hash_file('sha512') against the upstream .sha512, honoring PHPVM_SKIP_HASH.

devhardiyanto
…rification

Modeled on phpvm_composer: wp-cli.phar in $PHPVM_DIR, POSIX wp shim in
$PHPVM_BIN so wp follows the active PHP version. Hash verified via PHP
hash_file('sha512') — no sha512sum/shasum, so GNU and BSD/macOS share one path.

devhardiyanto
Pester: mocked Invoke-WebRequest/Get-WebString + fake php.bat for hash_file.
bats: curl shell-function stub + FAKE_PHP_HASH double, plus dispatch route.

devhardiyanto
@devhardiyanto
devhardiyanto merged commit 88c6d14 into main Jul 17, 2026
4 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