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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phpswitcher

CI

PHP Switcher

A simple CLI tool to manage multiple PHP versions on macOS and Linux.

Features

Prerequisites

Installation

Homebrew (macOS)

Composer

Install script (macOS & Linux)

After installing, restart your terminal and verify with:

Usage

List installed PHP versions:

Shows all available PHP versions and highlights the one that is currently active.

Install a PHP version:

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.

Uninstall a PHP version:

Remove a PHP version that is no longer needed. The currently active version cannot be uninstalled — switch to a different version first.

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.

Set a global default PHP version:

Set a fallback version that's used when no .php-version file or composer.json is found in the directory tree:

Show status:

Display the current active PHP version, how it was detected, and path information:

Manage PHP extensions:

List installed extensions for a PHP version, or install new ones:

On Linux, extensions are installed via apt (e.g., php8.1-xdebug). On macOS, PECL is used.

Show Version:

Self-Update:

This will fetch and install the latest version of phpswitcher from GitHub.

Check active PHP version (after switching):

Automatic Version Switching

phpswitcher supports automatic version switching when you change directories. This is achieved by hooking into your shell's prompt.

How it Works

  1. When you cd into a new directory, phpswitcher looks for a .php-version file in the current directory or any parent directory.
  2. If no .php-version file is found, it checks for a composer.json in the current directory and reads the PHP version constraint.
  3. If neither is found, it falls back to the global default version (if set via phpswitcher default).
  4. If a required version is detected and it differs from the currently active version, phpswitcher automatically switches to it.

Usage

To use this feature, simply create a file named .php-version in the root of your project and put the desired PHP version number in it.

Now, whenever you cd into this directory (or any subdirectory), phpswitcher will ensure that PHP 8.1 is activated automatically.

This feature is enabled by default during the installation process, which adds a sourcing line to your shell's profile file (.bashrc, .zshrc, or Fish config).

Fish Shell Support

Fish shell is fully supported. The installer automatically detects Fish and creates a config file at ~/.config/fish/conf.d/phpswitcher.fish. Auto-switching works via Fish's --on-variable PWD event.

Tab Completion

Tab completion for commands and PHP versions is enabled automatically during installation for Bash, Zsh, and Fish. Type phpswitcher followed by Tab to see available commands, or phpswitcher use followed by Tab to see installed PHP versions.

Development

  1. Clone the repository: git clone https://github.com/rawdreeg/phpswitcher.git
  2. Navigate into the project directory: cd phpswitcher.
  3. The main script is bin/phpswitcher. You can run it directly for testing:

  4. To create a release artifact, run the build script:

    This will create a phpswitcher.tar.gz in the root directory.

Contributing

Contributions are welcome! Please feel free to open issues or submit pull requests.

License

MIT License


All versions of phpswitcher with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rawdreeg/phpswitcher contains the following files

Loading the files please wait ...