mirror of
https://github.com/laravel/valet.git
synced 2026-02-04 08:10:07 +01:00
Allow Valet to uninstall itself
`valet uninstall` only displays information about how to manually uninstall and clean up after Valet. This PR adds a `--force` parameter, which will forcefully remove Valet and the Homebrew services it installs, as well as clean up the config files and log files. But for a few post-uninstall composer dependencies, cleanup is very thorough. This brings idempotency to both `valet install` and `valet uninstall --force` (There may still be edge cases where other Homebrew or composer packages might create interference with install/uninstall, but this makes things much easier to self-troubleshoot.)
This commit is contained in:
@@ -45,6 +45,18 @@ function install()
|
||||
$this->restart();
|
||||
}
|
||||
|
||||
/**
|
||||
* Forcefully uninstall all of Valet's supported PHP versions and configurations
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function uninstall()
|
||||
{
|
||||
$this->brew->uninstallAllPhpVersions();
|
||||
rename('/usr/local/etc/php', '/usr/local/etc/php-valet-bak'.time());
|
||||
$this->cli->run('rm -rf /usr/local/var/log/php-fpm.log');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the PHP FPM configuration.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user