diff --git a/cli/ValetPlus/Rabbitmq.php b/cli/ValetPlus/Rabbitmq.php index 852a985a..33e33dc0 100644 --- a/cli/ValetPlus/Rabbitmq.php +++ b/cli/ValetPlus/Rabbitmq.php @@ -69,5 +69,8 @@ public function uninstall(): void if (file_exists(BREW_PREFIX . '/var/lib/rabbitmq')) { $this->files->rmDirAndContents(BREW_PREFIX . '/var/lib/rabbitmq'); } + if (file_exists(BREW_PREFIX . '/var/log/rabbitmq')) { + $this->files->rmDirAndContents(BREW_PREFIX . '/var/log/rabbitmq'); + } } } diff --git a/cli/ValetPlus/Redis.php b/cli/ValetPlus/Redis.php index b5f81b9c..c015aa65 100644 --- a/cli/ValetPlus/Redis.php +++ b/cli/ValetPlus/Redis.php @@ -62,5 +62,7 @@ public function uninstall(): void { $this->stop(); $this->brew->uninstallFormula(static::SERVICE_NAME); + + $this->files->unlink(BREW_PREFIX . '/var/log/redis.log'); } } diff --git a/cli/valet.php b/cli/valet.php index 0143a4d3..4ddb7353 100755 --- a/cli/valet.php +++ b/cli/valet.php @@ -291,7 +291,7 @@ */ $app ->command('varnish', function (OutputInterface $output, string $mode = null) { - $modes = ['install', 'on', 'enable', 'off', 'disable']; + $modes = ['install', 'on', 'enable', 'off', 'disable', 'uninstall']; if (!in_array($mode, $modes)) { throw new Exception('Mode not found. Available modes: ' . implode(', ', $modes)); @@ -301,28 +301,32 @@ case 'install': Varnish::install(); - return; + break; case 'enable': case 'on': Varnish::enable(); - return; + break; case 'disable': case 'off': Varnish::disable(); - return; + break; + case 'uninstall': + Varnish::uninstall(); + + break; } }) ->descriptions('Enable/disable Varnish') - ->addArgument('mode', InputArgument::REQUIRED, 'Available modes: ' . implode(', ', ['install', 'on', 'enable', 'off', 'disable'])); + ->addArgument('mode', InputArgument::REQUIRED, 'Available modes: ' . implode(', ', ['install', 'on', 'enable', 'off', 'disable', 'uninstall'])); /** * Redis services. */ $app ->command('redis', function (OutputInterface $output, string $mode = null) { - $modes = ['install', 'on', 'enable', 'off', 'disable']; + $modes = ['install', 'on', 'enable', 'off', 'disable', 'uninstall']; if (!in_array($mode, $modes)) { throw new Exception('Mode not found. Available modes: ' . implode(', ', $modes)); @@ -332,28 +336,32 @@ case 'install': Redis::install(); - return; + break; case 'enable': case 'on': Redis::enable(); - return; + break; case 'disable': case 'off': Redis::disable(); - return; + break; + case 'uninstall': + Redis::uninstall(); + + break; } }) ->descriptions('Enable/disable Redis') - ->addArgument('mode', InputArgument::REQUIRED, 'Available modes: ' . implode(', ', ['install', 'on', 'enable', 'off', 'disable'])); + ->addArgument('mode', InputArgument::REQUIRED, 'Available modes: ' . implode(', ', ['install', 'on', 'enable', 'off', 'disable', 'uninstall'])); /** * Rabbitmq services. */ $app ->command('rabbitmq', function (OutputInterface $output, string $mode = null) { - $modes = ['install', 'on', 'enable', 'off', 'disable']; + $modes = ['install', 'on', 'enable', 'off', 'disable', 'uninstall']; if (!in_array($mode, $modes)) { throw new Exception('Mode not found. Available modes: ' . implode(', ', $modes)); @@ -363,21 +371,25 @@ case 'install': Rabbitmq::install(); - return; + break; case 'enable': case 'on': Rabbitmq::enable(); - return; + break; case 'disable': case 'off': Rabbitmq::disable(); - return; + break; + case 'uninstall': + Rabbitmq::uninstall(); + + break; } }) ->descriptions('Enable/disable Rabbitmq') - ->addArgument('mode', InputArgument::REQUIRED, 'Available modes: ' . implode(', ', ['install', 'on', 'enable', 'off', 'disable'])); + ->addArgument('mode', InputArgument::REQUIRED, 'Available modes: ' . implode(', ', ['install', 'on', 'enable', 'off', 'disable', 'uninstall'])); /** * Database services and commands.