Thanks to visit codestin.com
Credit goes to github.com

Skip to content

usepvm/pvm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Version Manager for Windows

PVM (PHP Version Manager) is a lightweight PowerShell tool for Windows that makes it easy to install, switch, and manage multiple PHP versions.

Installation & Setup

Clone the repo and add the directory to you Path variable.

git clone https://github.com/drissboumlik/pvm
cd pvm

# Run this command to setup pvm
pvm setup

Usage

# Display the avilable options
pvm help

# Display help for a specific command
pvm help <command>

# Display information about the environment
pvm info # pvm ini info

# Display active PHP version
pvm current

# List installed PHP versions
pvm list # pvm ls

# List installable PHP versions from remote source
pvm list available # pvm ls available

# Install a specific version.
pvm install <version> # pvm i <version>

# Uninstall a specific version
pvm uninstall <version> # pvm rm <version>

# Switch to use the specified version
pvm use <version>

# Switch to use the detected PHP version from .php-version or composer.json in your current project/directory
pvm use auto

Manage php.ini settings and extensions directly from the CLI.

# Check status of multiple extensions
pvm ini status xdebug opcache

# Enable or disable multiple extensions
pvm ini enable xdebug opcache
pvm ini disable xdebug opcache

# Set or Get multiple settings values
pvm ini set memory_limit=512M max_file_uploads=20
pvm ini get memory_limit max_file_uploads

# Restore backup
pvm ini restore

# Check logs
pvm log --pageSize=[number] # Default value is 5

Running Tests

Run tests against the PowerShell scripts in the repo — especially useful for contributors verifying changes before submitting a pull request:

Requirements

To run tests with, you need to have the Pester testing framework installed. Pester is a testing framework for PowerShell.

Open PowerShell as Administrator and run:

Install-Module -Name Pester -Force -SkipPublisherCheck

💡 If prompted to trust the repository, type Y and press Enter.

You can verify the installation with:

Get-Module -ListAvailable Pester

Run the tests

pvm test [files = (files inside the tests/ directory)] [--coverage] [--verbosity=(None|Normal|Detailed|Diagnostic)] [--tag=yourTag]

# Examples:
pvm test # Runs all tests with Normal (default) verbosity.
pvm test use install # Runs only use.tests.ps1 and install.tests.ps1 with Normal verbosity.
pvm test --verbosity=Detailed --coverage # Runs all tests with Detailed verbosity and generates coverage report.
pvm test helpers list --verbosity=Diagnostic --tag=myTag # Runs helpers.tests.ps1 and list.tests.ps1 with Diagnostic verbosity and only runs tests with tag "myTag".

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

PHP Version Manager for windows

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Contributors 2

  •  
  •