mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2026-04-05 18:50:08 +02:00
🐛 Restart PHP-FPM after managing extensions
This is done to prevent issues like #292.
This commit is contained in:
@@ -20,6 +20,11 @@ class Actions {
|
|||||||
await brew("services restart \(HomebrewFormulae.php)", sudo: HomebrewFormulae.php.elevated)
|
await brew("services restart \(HomebrewFormulae.php)", sudo: HomebrewFormulae.php.elevated)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static func restartPhpFpm(version: String) async {
|
||||||
|
let formula = (version == PhpEnvironments.brewPhpAlias) ? "php" : "php@\(version)"
|
||||||
|
await brew("services restart \(formula)", sudo: HomebrewFormulae.php.elevated)
|
||||||
|
}
|
||||||
|
|
||||||
public static func restartNginx() async {
|
public static func restartNginx() async {
|
||||||
await brew("services restart \(HomebrewFormulae.nginx)", sudo: HomebrewFormulae.nginx.elevated)
|
await brew("services restart \(HomebrewFormulae.nginx)", sudo: HomebrewFormulae.nginx.elevated)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,11 @@ class InstallPhpExtensionCommand: BrewCommand {
|
|||||||
// Reload and restart PHP versions
|
// Reload and restart PHP versions
|
||||||
onProgress(.create(value: 0.95, title: self.getCommandTitle(), description: "phpman.steps.reloading".localized))
|
onProgress(.create(value: 0.95, title: self.getCommandTitle(), description: "phpman.steps.reloading".localized))
|
||||||
|
|
||||||
|
// Restart PHP-FPM
|
||||||
|
if let installed = self.installing.first {
|
||||||
|
await Actions.restartPhpFpm(version: installed.phpVersion)
|
||||||
|
}
|
||||||
|
|
||||||
// Check which version of PHP are now installed
|
// Check which version of PHP are now installed
|
||||||
await PhpEnvironments.detectPhpVersions()
|
await PhpEnvironments.detectPhpVersions()
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ class RemovePhpExtensionCommand: BrewCommand {
|
|||||||
|
|
||||||
await PhpEnvironments.detectPhpVersions()
|
await PhpEnvironments.detectPhpVersions()
|
||||||
|
|
||||||
|
await Actions.restartPhpFpm(version: phpExtension.phpVersion)
|
||||||
|
|
||||||
await MainMenu.shared.refreshActiveInstallation()
|
await MainMenu.shared.refreshActiveInstallation()
|
||||||
|
|
||||||
onProgress(.create(value: 1, title: getCommandTitle(), description: "phpman.steps.success".localized))
|
onProgress(.create(value: 1, title: getCommandTitle(), description: "phpman.steps.success".localized))
|
||||||
|
|||||||
Reference in New Issue
Block a user