valet-windows
valet-windows copied to clipboard
feat: add support for multiple PHP services
Hey! Amazing work on the package <3
Currently it's missing the multiple PHP versions management and the valet use
command is disabled.
This PR adds below new commands and enables valet use
to switch between PHP versions.
php:add Add PHP by specifying a path
php:install Reinstall all PHP services from [valet php:list]
php:list List all PHP services
php:remove Remove PHP by specifying a path
php:uninstall Uninstall all PHP services from [valet php:list]
use Change the version of PHP used by valet
Examples:
valet php:add "c:\php-7.3.29"
valet php:remove "c:\php-8.1.2"
valet use 8.0.15
$ valet php:list
Listing PHP services...
+---------+---------------+------+-------------+---------+
| Version | Path | Port | xDebug Port | Default |
+---------+---------------+------+-------------+---------+
| 8.0.15 | C:\php-8.0.15 | 9001 | 9101 | |
| 8.1.2 | C:\php-8.1.2 | 9002 | 9102 | |
| 7.4.27 | C:\php-7.4.27 | 9004 | 9104 | |
| 7.3.29 | C:\php-7.3.29 | 9005 | 9105 | X |
+---------+---------------+------+-------------+---------+
Also added a feature to enable an individual site to use a specific PHP version similar to this original Valet package PR https://github.com/laravel/valet/pull/1192
Example:
valet use "8.1.2" --site="foo"
Thanks! I'll check it latter in the week.
@cretueusebiu any news on this eagerly awaited PR?
@cretueusebiu Any update on this PR?
I really awaiting this massy update which will allow me to run multiple php version for each project. @cretueusebiu are this PR going to be merged or you are planning to use the official valet v3?
@muath-ye It's been a while since I've worked on Valet... For me it worked great so far so that's why I didn't make any updates.
Also these kind of changes require a bit of manual testing both on win 8 and 10.
I'll try to take a look this weekend at both the PR and the official Valet. 🤞
It becomes quite urgent for me to have different versions of PHP for each project.
@iamroi What would be the best way to use your PR as a replacement?
Hi @damsfx you can tell composer to use the forked repository. This might help - https://stackoverflow.com/questions/13498519/how-to-require-a-fork-with-composer
Please note that I still need to do thorough testing to make sure everything works as expected.
@cretueusebiu I'm hoping to add some tests this weekend.
Hey @damsfx Please beware of the below
Currently, if you miss the double quotes from this command or any other similar command for eg. valet php:add "c:\php-7.3.29"
, I think it still runs but stores wrong data in the config. This needs to be resolved.
Hi @damsfx you can tell composer to use the forked repository. This might help - https://stackoverflow.com/questions/13498519/how-to-require-a-fork-with-composer
Please note that I still need to do thorough testing to make sure everything works as expected.
@cretueusebiu I'm hoping to add some tests this weekend.
Yes, I found the solution some time ago:
{
"require": {
...
"cretueusebiu/valet-windows": "dev-master"
},
"repositories": [
{
"type": "git",
"url": "[email protected]:iamroi/valet-windows.git"
}
]
}
I have made some tests ... and suggested you a PR to add PHP version in links table letting us know which version each site is running.
https://github.com/iamroi/valet-windows/pull/1
Too busy at the moment to resume testing, but I will try.
Hi @cretueusebiu , any update on this feature?
Hi @cretueusebiu , any update on this feature?
@cretueusebiu Bump !
this feature held me back to switch from laragon
Hi there! I've install the valet version 2.5, and try to use the command valet php:add "C:\xampp\php81"
, but it shows There are no commands defined in the "php" namespace. . Did I miss something?
Thanks in advance.
@cretueusebiu any possible ETA to have this PR merged, this feature is eagerly required by majority dev's
Hi @damsfx you can tell composer to use the forked repository. This might help - https://stackoverflow.com/questions/13498519/how-to-require-a-fork-with-composer Please note that I still need to do thorough testing to make sure everything works as expected. @cretueusebiu I'm hoping to add some tests this weekend.
Yes, I found the solution some time ago:
{ "require": { ... "cretueusebiu/valet-windows": "dev-master" }, "repositories": [ { "type": "git", "url": "[email protected]:iamroi/valet-windows.git" } ] }
Hi @damsfx . Can you tell me where you've added this please? Is it per project basis (in project's composer.json), or in the global installation of cretueusebiu/valet-windows composer.json?
@cretueusebiu This is a very much needed requirement for developers. This pr has the backing of a multitude of people and should be merged asap. I love the valet windows port but it is muchly lacking in this php version switch mechanic.
Hi @damsfx you can tell composer to use the forked repository. This might help - https://stackoverflow.com/questions/13498519/how-to-require-a-fork-with-composer Please note that I still need to do thorough testing to make sure everything works as expected. @cretueusebiu I'm hoping to add some tests this weekend.
Yes, I found the solution some time ago:
{ "require": { ... "cretueusebiu/valet-windows": "dev-master" }, "repositories": [ { "type": "git", "url": "[email protected]:iamroi/valet-windows.git" } ] }
Hi @damsfx . Can you tell me where you've added this please? Is it per project basis (in project's composer.json), or in the global installation of cretueusebiu/valet-windows composer.json?
@cretueusebiu This is a very much needed requirement for developers. This pr has the backing of a multitude of people and should be merged asap. I love the valet windows port but it is muchly lacking in this php version switch mechanic.
@yCodeTech you need to update the global composer file, usually located at C:\Users(your user)\AppData\Roaming\Composer
and then simply run composer global require cretueusebiu/valet-windows:dev-master
to sync