|
| 1 | +# PHPFlex |
| 2 | + |
| 3 | +PHPFlex is a powerful command-line tool that allows developers to seamlessly switch between multiple PHP versions on their local environment. It provides a simple way to specify the desired PHP version for running commands or scripts, making it ideal for testing, development, and debugging across various PHP environments. |
| 4 | + |
| 5 | +# _Features_: |
| 6 | + |
| 7 | +- Version Switching: Instantly switch to any installed PHP version (e.g., 8.1, 8.2, 8.3) without changing system settings. |
| 8 | +- Command Execution: Run any PHP command or script with the specified version directly from the terminal. |
| 9 | +- User-friendly: Single function for all versions, simplifying multi-version management. |
| 10 | +- Error Handling: Clear error messages if the specified PHP version is not found. |
| 11 | + |
| 12 | +```bash |
| 13 | +# Check the PHP version for 8.1 |
| 14 | +phpFlex 8.1 -v |
| 15 | + |
| 16 | +# Run a PHP script with version 8.2 |
| 17 | +phpFlex 8.2 myscript.php |
| 18 | + |
| 19 | +# Execute an inline PHP command with version 8.3 |
| 20 | +phpFlex 8.3 -r 'echo "Hello, PHP 8.3!";' |
| 21 | +``` |
| 22 | + |
| 23 | +# Installation |
| 24 | + |
| 25 | +--- |
| 26 | +To start using PHPFlex, execute the script `install.sh`. It checks whether you are using bash or zsh and installs PHPFlex to your configuration file. |
| 27 | + |
| 28 | +*Hint:* It is important that you reload your configuration after installation to use PHPFlex. |
| 29 | + |
| 30 | +Sometimes it is necessary to set the correct permission to run the script |
| 31 | +```bash |
| 32 | +chmod -x install.sh && \ |
| 33 | +./install.sh \ |
| 34 | +source ~/<.zshrc | .bashrc> |
| 35 | +``` |
| 36 | + |
| 37 | +# Uninstall |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +To stop using PHPFlex, run the script `uninstall.sh`. It create a backup file of your configuration before PHPFlex is removed. |
| 42 | + |
| 43 | +*Hint:* It is important to reload your configuration to remove PHPFlex from your current commandline session. |
| 44 | + |
| 45 | +Sometimes it is necessary to set the correct permission to run the script |
| 46 | +```bash |
| 47 | +chmod -x uninstall.sh && \ |
| 48 | +./uninstall.sh \ |
| 49 | +source ~/<.zshrc | .bashrc> |
| 50 | +``` |
| 51 | + |
| 52 | +# Contributions |
| 53 | + |
| 54 | +--- |
| 55 | + |
| 56 | +Help us to improve this project by reporting bugs, enhancement requests or other suggestions via the issue tracker. |
| 57 | + |
| 58 | +After creating the issue tracker, it is also possible to create a PR with reference to the issue. |
| 59 | + |
| 60 | +Thank you very much for your support! |
0 commit comments