14
14
** Example:**
15
15
16
16
``` sh
17
+ $ phpvm version
18
+ phpvm version 1.5.0
19
+
20
+ PHP Version Manager for macOS and Linux
21
+ Author: Jerome Thayananthajothy
< [email protected] >
22
+ Repository: https://github.com/Thavarshan/phpvm
23
+
24
+ Usage: phpvm help
25
+
17
26
$ phpvm use 8.2
18
27
Switching to PHP 8.2...
19
28
Switched to PHP 8.2.
@@ -31,9 +40,13 @@ PHP 8.1.13
31
40
- Install and manage multiple PHP versions.
32
41
- Seamlessly switch between installed PHP versions.
33
42
- Auto-switch PHP versions based on project ` .phpvmrc ` .
34
- - Supports macOS (via Homebrew) and Linux distributions.
43
+ - Supports macOS (via Homebrew) and Linux distributions including WSL.
44
+ - Enhanced cross-platform compatibility with improved shell support.
35
45
- Works with common shells (` bash ` , ` zsh ` ).
46
+ - Comprehensive version commands (` phpvm version ` , ` phpvm --version ` , ` phpvm -v ` ).
47
+ - Post-install validation with helpful warnings for missing binaries.
36
48
- Improved error handling with detailed messages and suggestions.
49
+ - Enhanced Homebrew integration with better link failure detection.
37
50
- Informative, color-coded feedback with timestamps for logs.
38
51
- Includes unit tests with BATS for automated testing.
39
52
- Helper functions for better maintainability and reduced code duplication.
@@ -72,6 +85,21 @@ If the installation was successful, it should output the path to `phpvm`.
72
85
73
86
## Usage
74
87
88
+ ### Available Commands
89
+
90
+ | Command | Description |
91
+ | ------------------------- | ------------------------------------- |
92
+ | ` phpvm install <version> ` | Install a specific PHP version |
93
+ | ` phpvm use <version> ` | Switch to a specific PHP version |
94
+ | ` phpvm system ` | Switch to system/Homebrew default PHP |
95
+ | ` phpvm list ` | List all installed PHP versions |
96
+ | ` phpvm auto ` | Auto-switch based on ` .phpvmrc ` file |
97
+ | ` phpvm test ` | Run built-in self-tests |
98
+ | ` phpvm version ` | Show version information |
99
+ | ` phpvm --version ` | Show version information (alias) |
100
+ | ` phpvm -v ` | Show version information (alias) |
101
+ | ` phpvm help ` | Show help message |
102
+
75
103
### Installing PHP Versions
76
104
77
105
To install a specific version of PHP:
@@ -88,7 +116,7 @@ To switch between installed versions:
88
116
phpvm use 8.0
89
117
```
90
118
91
- To switch back to the system PHP version:
119
+ To switch back to the system PHP version (Homebrew default on macOS) :
92
120
93
121
``` sh
94
122
phpvm system
@@ -100,6 +128,18 @@ Verify the active version with:
100
128
php -v
101
129
```
102
130
131
+ ### Version Information
132
+
133
+ To check the phpvm version and get information:
134
+
135
+ ``` sh
136
+ phpvm version
137
+ # or
138
+ phpvm --version
139
+ # or
140
+ phpvm -v
141
+ ```
142
+
103
143
### Auto-Switching PHP Versions
104
144
105
145
Create a ` .phpvmrc ` file in your project directory to specify the desired PHP version:
@@ -157,18 +197,24 @@ export PATH="$PHPVM_DIR/bin:$PATH"
157
197
If you experience issues with ` phpvm ` , try the following:
158
198
159
199
- Run ` phpvm test ` to verify all functions are working correctly
200
+ - Check the phpvm version with ` phpvm version ` or ` phpvm --version `
160
201
- Ensure your shell profile is sourcing ` phpvm.sh `
161
202
- Restart your terminal after installing or updating
162
203
- Verify that the required package manager is installed:
163
204
- Homebrew for macOS
164
205
- apt, dnf, yum, or pacman for Linux
165
206
- Check for permission issues during the installation or PHP version switching process
166
207
- For Linux systems, you may need to use ` sudo ` for installation and switching
208
+ - On WSL systems, ensure you're using bash shell compatibility
209
+ - If you encounter Homebrew link issues on macOS, try manually relinking:
` brew unlink [email protected] && brew link --force [email protected] `
167
210
- Refer to the [ Changelog] ( ./CHANGELOG.md ) for recent updates and fixes
168
211
169
212
## Development & Testing
170
213
171
214
- This project includes a set of BATS unit tests located in the repository (e.g., ` test_phpvm.bats ` ).
215
+ - v1.5.0 introduces significant cross-platform compatibility improvements, especially for WSL and Linux systems.
216
+ - Enhanced error handling and validation with post-install checks for binary availability.
217
+ - Improved Homebrew integration with better link failure detection and recovery.
172
218
- Contributions, bug reports, and feature requests are welcome.
173
219
- The codebase now includes helper functions for better maintainability and reduced duplication.
174
220
0 commit comments