You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
phpvm is a PHP Version Manager written as a single bash script (`phpvm.sh`). It supports macOS (Homebrew) and Linux (apt, dnf, yum, pacman). Tests use BATS.
6
+
7
+
## Code Style
8
+
9
+
- POSIX-compliant bash where possible
10
+
- All global variables must be prefixed with `PHPVM_` to avoid namespace pollution when sourced
11
+
- Use `command` prefix for external commands (e.g., `command grep`, `command awk`)
12
+
- Use `printf '%s\n'` instead of `echo` when piping variable content to avoid `-n`/`-e` interpretation
13
+
- Use `if/then/fi` instead of `[ test ] && cmd` for functions that must return 0 on success
14
+
- Use `while IFS= read -r` loops instead of `for x in $(...)` to avoid word-splitting issues
15
+
- Prefer `command_exists` helper over inline `command -v X > /dev/null 2>&1`
16
+
17
+
## Testing
18
+
19
+
```bash
20
+
bash -n phpvm.sh # Syntax check
21
+
bats tests/ # Run all tests
22
+
bats tests/01_core.bats # Run specific test file
23
+
```
24
+
25
+
Tests run in isolated mock environments with `PHPVM_TEST_MODE=true`.
26
+
27
+
## Release Procedure
28
+
29
+
Conventions: tag = `X.Y.Z` (no `v` prefix), title = `vX.Y.Z` (with `v` prefix).
30
+
31
+
1. Bump `PHPVM_VERSION` in `phpvm.sh`
32
+
2. Add entry to `CHANGELOG.md` under `[Unreleased]` with format:
-**Fixed `README.MD` β `README.md` casing in `release.yml`:** The release workflow referenced `README.MD` but the file is `README.md`, causing CI failures on case-sensitive Linux filesystems.
10
+
-**Fixed `README.MD` β `README.md` casing in `CLAUDE.md` file structure diagram.**
0 commit comments