Download the PHP package rawdreeg/phpswitcher without Composer
On this page you can find all versions of the php package rawdreeg/phpswitcher. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rawdreeg/phpswitcher
More information about rawdreeg/phpswitcher
Files in rawdreeg/phpswitcher
Package phpswitcher
Short Description A simple CLI tool to manage multiple PHP versions on macOS using Homebrew. Linux and Windows support planned.
License MIT
Informations about the package phpswitcher
PHP Switcher
A simple CLI tool to manage multiple PHP versions on macOS using Homebrew. (Currently only supports macOS with Homebrew. Linux/Windows support is planned).
Features
- Install specific PHP versions (via Homebrew).
- Switch the active linked PHP version (via Homebrew).
Prerequisites
- macOS: The current version only supports macOS.
- Homebrew: Required for installing and managing PHP versions. Ensure it's installed: https://brew.sh/
Installation (Recommended)
Run the following command in your terminal to download and execute the installation script:
Follow any prompts from the script. You may need to enter your password for sudo
commands if installing to a system-wide directory like /usr/local/bin
.
After installation, open a new terminal session or run source ~/.zshrc
(or the equivalent for your shell, like source ~/.bash_profile
) and verify with:
Installation from Source (for Development)
- Clone the repository:
git clone https://github.com/rawdreeg/phpswitcher.git
- Navigate into the project directory:
cd phpswitcher
. - Run the local setup script:
bash install.sh
. Note: Running the script locally like this is intended for development. It checks dependencies and builds the PHAR in thebin/
directory. - Test commands using the locally built executable:
./bin/phpswitcher install 8.2
.
Usage
(Currently supports macOS/Homebrew only)
Install a PHP version:
Similar to the use
command, if you are in a directory containing a composer.json
file with a PHP requirement, you can omit the <version>
argument to automatically detect and install the required X.Y
version.
Switch active PHP version:
If you are in a directory containing a composer.json
file with a PHP requirement (require.php
or config.platform.php
), you can omit the <version>
argument, and phpswitcher
will attempt to detect and use the appropriate X.Y
version.
Check active PHP version (after switching):
Development
- Clone the repository.
- Navigate into the project directory:
cd phpswitcher
. - Install dependencies:
composer install
. - Run the setup script (this installs dependencies including Homebrew if missing):
bash install.sh
. - Run commands directly using the local executable:
./bin/phpswitcher install 8.2
.
Contributing
Contributions are welcome! Please feel free to open issues or submit pull requests.
License
MIT License