Skip to content

Commit 67740d9

Browse files
committed
Convert entire project from JavaScript to Shell
1 parent ffc0032 commit 67740d9

29 files changed

+206
-11605
lines changed

.prettierrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

README.MD

Lines changed: 42 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -9,100 +9,70 @@
99

1010
## Introduction
1111

12-
`phpvm` is a PHP Version Manager that allows you to easily install, switch between, and manage multiple PHP versions via the command line.
12+
`phpvm` is a lightweight PHP Version Manager that allows you to easily install, switch between, and manage multiple PHP versions via the command line.
1313

1414
**Example:**
1515

1616
```sh
17-
$ phpvm use 7.4
18-
Now using PHP v7.4.10
17+
$ phpvm use 8.2
18+
Now using PHP v8.2.10
1919
$ php -v
20-
PHP 7.4.10
21-
$ phpvm use 8.0
22-
Now using PHP v8.0.8
20+
PHP 8.2.10
21+
$ phpvm use 8.1
22+
Now using PHP v8.1.13
2323
$ php -v
24-
PHP 8.0.8
24+
PHP 8.1.13
2525
```
2626

27-
## About phpvm
27+
## Features
2828

29-
`phpvm` is a version manager designed to be used on Unix-like systems, including macOS and Linux. It allows you to install and manage PHP versions, switch between them seamlessly, and work with multiple versions on your system.
30-
31-
### Key Features
32-
33-
- Install and use different PHP versions.
34-
- Easily switch between installed PHP versions.
35-
- List installed PHP versions.
36-
- Uninstall a specific PHP version.
29+
- Install and manage multiple PHP versions.
30+
- Seamlessly switch between installed PHP versions.
31+
- Auto-switch PHP versions based on project `.phpvmrc`.
32+
- Supports macOS (via Homebrew) and Linux distributions.
33+
- Works with common shells (`bash`, `zsh`).
3734

3835
## Installation
3936

40-
### Install & Update Script
37+
### Install & Update phpvm
4138

42-
To **install** or **update** phpvm, run the following command using either `curl` or `wget`:
39+
To **install** or **update** phpvm, run one of the following commands:
4340

4441
```sh
4542
curl -o- https://raw.githubusercontent.com/Thavarshan/phpvm/main/bin/install.sh | bash
4643
```
4744

4845
```sh
49-
wget -qO- https://raw.githubusercontent.com/Thavarshan/phpvm/main/bin/install | bash
46+
wget -qO- https://raw.githubusercontent.com/Thavarshan/phpvm/main/bin/install.sh | bash
5047
```
5148

52-
This script clones the `phpvm` repository into `~/.phpvm` and attempts to add the following lines to your profile (`~/.bashrc`, `~/.zshrc`, or `~/.profile`):
49+
This script will download and set up `phpvm` in `~/.phpvm`, adding the following to your shell profile (`~/.bashrc`, `~/.zshrc`, or `~/.profile`):
5350

5451
```sh
5552
export PHPVM_DIR="$HOME/.phpvm"
56-
export PATH="$HOME/.local/bin:$PATH"
53+
source "$PHPVM_DIR/phpvm"
5754
```
5855

5956
### Verify Installation
6057

61-
To verify that `phpvm` has been installed, run the following command:
58+
Run the following command:
6259

6360
```sh
6461
command -v phpvm
6562
```
6663

67-
This should output `phpvm` if the installation was successful.
68-
69-
### Manual Install
70-
71-
To manually install `phpvm`, clone the repository:
72-
73-
```sh
74-
git clone https://github.com/Thavarshan/phpvm.git ~/.phpvm
75-
```
76-
77-
Then add the following lines to your shell's profile (`~/.bashrc`, `~/.zshrc`, etc.):
78-
79-
```sh
80-
export PHPVM_DIR="$HOME/.phpvm"
81-
export PATH="$HOME/.local/bin:$PATH"
82-
```
83-
84-
### Manual Update
85-
86-
To manually update `phpvm` to the latest version, use the following commands:
87-
88-
```sh
89-
cd ~/.phpvm
90-
git fetch --tags origin
91-
git checkout `git describe --abbrev=0 --tags`
92-
```
64+
If the installation was successful, it should output `phpvm`.
9365

9466
## Usage
9567

9668
### Installing PHP Versions
9769

98-
To install a specific version of PHP, run:
70+
To install a specific version of PHP:
9971

10072
```sh
10173
phpvm install 8.1
10274
```
10375

104-
This will install PHP version 8.1.
105-
10676
### Switching PHP Versions
10777

10878
To switch between installed versions:
@@ -111,77 +81,70 @@ To switch between installed versions:
11181
phpvm use 8.0
11282
```
11383

114-
This will switch to PHP 8.0. You can verify the active version by running:
84+
Check the active version:
11585

11686
```sh
11787
php -v
11888
```
11989

120-
### Uninstalling PHP Versions
90+
### Auto-Switching PHP Versions
12191

122-
To uninstall a version of PHP:
92+
If a `.phpvmrc` file is present in your project directory, `phpvm` will automatically switch to the specified version:
12393

12494
```sh
125-
phpvm uninstall 7.4
95+
echo "8.1" > .phpvmrc
12696
```
12797

128-
This will uninstall PHP 7.4 from the system.
98+
Upon entering the project directory, `phpvm` will switch to PHP 8.1 automatically.
12999

130-
### Listing Installed Versions
100+
### Uninstalling PHP Versions
131101

132-
To list the installed PHP versions:
102+
To uninstall a specific PHP version:
133103

134104
```sh
135-
phpvm list
105+
phpvm uninstall 7.4
136106
```
137107

138-
This will display all the PHP versions managed by `phpvm`.
139-
140-
## Running Tests
108+
### Listing Installed Versions
141109

142-
You can run tests using Jest. Install the dependencies and run the following command:
110+
To list installed PHP versions:
143111

144112
```sh
145-
npm install
146-
npm test
113+
phpvm list
147114
```
148115

149-
This will run all tests defined for `phpvm`.
150-
151116
## Uninstallation
152117

153-
To manually uninstall `phpvm`, run:
118+
To completely remove `phpvm`, run:
154119

155120
```sh
156121
rm -rf ~/.phpvm
157122
```
158123

159-
And remove the following lines from your shell's profile:
124+
And remove the following lines from your shell profile (`~/.bashrc`, `~/.zshrc`, etc.):
160125

161126
```sh
162127
export PHPVM_DIR="$HOME/.phpvm"
163-
export PATH="$HOME/.local/bin:$PATH"
128+
source "$PHPVM_DIR/phpvm"
164129
```
165130

166131
## Troubleshooting
167132

168-
If you encounter any issues with `phpvm` or its functionality, consider the following troubleshooting steps:
133+
If you experience issues with `phpvm`, try the following:
169134

170-
- Make sure your shell configuration file is correctly sourcing `phpvm`.
171-
- For macOS, ensure that the necessary command line tools (like Homebrew or Xcode) are installed.
172-
- Restart your terminal after making any changes.
173-
- Ensure you have proper permissions to install PHP versions and modify system paths.
135+
- Ensure your shell profile is sourcing `phpvm`.
136+
- Restart your terminal after installation.
137+
- Make sure Homebrew is installed (for macOS users).
138+
- Check for permission issues when installing PHP versions.
174139

175140
## Maintainers
176141

177142
`phpvm` is maintained by [Jerome Thayananthajothy](https://github.com/Thavarshan).
178143

179144
## License
180145

181-
This project is licensed under the MIT License. See [LICENSE](./LICENSE) for more details.
146+
This project is licensed under the MIT License. See [LICENSE](./LICENSE) for details.
182147

183148
## Disclaimer
184149

185-
`phpvm` is an open-source tool designed to simplify PHP version management. While we strive to ensure its functionality across different platforms and configurations, we make no warranties or guarantees regarding its accuracy, completeness, reliability, or suitability for any particular purpose.
186-
187-
**Use at your own risk.** By using `phpvm`, you acknowledge that the developers and contributors are not responsible for any damages or data loss resulting from the installation, configuration, or use of this tool.
150+
`phpvm` is provided as-is, without any warranties. Use it at your own risk.

babel.config.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)