CRITICAL SAFETY DIRECTIVE: NEVER use backticks (`) inside git commit messages.
When running git commit -m "..." in the shell (like Zsh/Bash), backticks are immediately evaluated as command substitution by the user's shell BEFORE the commit is executed. If a file, branch, or text snippet contains a command-like string inside backticks, the shell will execute it silently with the user's full privileges.
- Do not use backticks (`) in commit bodies or summaries.
- If you need to quote code, files, or strings in a commit message, use single quotes (e.g. 'filename.rs') or double quotes (e.g. "function_name") instead.
- Obey this rule forever, until the end of electronics.
- $PVM_DIR: Root directory. Resolved via
dirs::data_local_dir(), so defaults to~/.local/share/pvmon Linux and~/Library/Application Support/pvmon macOS. - $PVM_DIR/versions/: Installation directory for specific PHP versions.
- $PVM_DIR/bin/pvm: The
pvmbinary itself. - $PVM_DIR/remote_cache-.json: 24-hour cache for the remote version index, scoped per target triple (e.g.
linux-x86_64). - $PVM_DIR/.env_update[_]: Short-lived files written per shell invocation; the shell wrapper sources them to mutate the parent shell's environment.
src/cli.rs: Command definitions usingclap.src/commands/: Implementation of subcommands. Each command is astructwith acall()method.src/fs.rs: Filesystem utilities (handlingPVM_DIR, version paths, env files).src/network.rs: API client for fetching and downloading PHP versions.src/shell.rs: Shell-specific logic for setting environment variables.
- Endpoint:
https://dl.static-php.dev/static-php-cli/bulk/ - Supported OS:
linux,macOS. - Supported Arch:
x86_64,aarch64. - Packages:
cli,fpm,micro. - Format:
tar.gzonly.
- Add a new module file in
src/commands/. - Define the command
structwith#[derive(Parser, Debug)]. - Export the module in
src/commands/mod.rs. - Register the variant in the
Commandsenum insrc/cli.rs. - Implement the
call()method logic.
- Errors: Use
anyhow::Resultfor all command-level fallible functions. - Interactivity: Use
dialoguerfor menus and confirmations. - Icons: Use
coloredfor status icons:✓(green),✗(red),↻(blue),💡(yellow). - Async: Use
tokiofor runtime andreqwestfor all network I/O. - Data Integrity: Use file locking (
std::fs::File::lock/lock_shared/unlock, stable since Rust 1.89) when writing to env update files or the remote cache.
- Isolation: Every integration test MUST use
tempfile::tempdir()and setPVM_DIRto that path. - CLI Verification: Use
assert_cmdandpredicatesfor output and exit code verification.
- Pre-commit: Run
cargo clippy -- -D warningsandcargo fmt --all -- --check. - Tooling: Use
replaceorwrite_filefor codebase modifications. Avoidsed/echoin shell. - Commit Messages: Follow Conventional Commits. No backticks (Rule 1).