mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-08 04:20:07 +02:00
👌 Rename "Force Load PHP" to "Fix My Valet" (#111)
This commit is contained in:
@ -88,7 +88,7 @@ class Actions {
|
||||
return URL(string: "file:///private/tmp/phpmon_phpinfo.html")!
|
||||
}
|
||||
|
||||
// MARK: - Quick Fix
|
||||
// MARK: - Fix My Valet
|
||||
|
||||
/**
|
||||
Detects all currently available PHP versions,
|
||||
@ -100,7 +100,7 @@ class Actions {
|
||||
If this does not solve the issue, the user may need to install additional
|
||||
extensions and/or run `composer global update`.
|
||||
*/
|
||||
public static func fixMyPhp()
|
||||
public static func fixMyValet()
|
||||
{
|
||||
brew("services restart dnsmasq", sudo: true)
|
||||
|
||||
|
@ -234,21 +234,26 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
@objc func forceRestartLatestPhp() {
|
||||
@objc func fixMyValet() {
|
||||
// Tell the user the switch is about to occur
|
||||
Alert.notify(
|
||||
message: "alert.force_reload.title".localized,
|
||||
info: "alert.force_reload.info".localized
|
||||
)
|
||||
|
||||
// Start switching
|
||||
waitAndExecute {
|
||||
Actions.fixMyPhp()
|
||||
} completion: {
|
||||
Alert.notify(
|
||||
message: "alert.force_reload_done.title".localized,
|
||||
info: "alert.force_reload_done.info".localized
|
||||
)
|
||||
if Alert.present(
|
||||
messageText: "alert.fix_my_valet.title".localized,
|
||||
informativeText: "alert.fix_my_valet.info".localized(PhpEnv.brewPhpVersion),
|
||||
buttonTitle: "alert.fix_my_valet.ok".localized,
|
||||
secondButtonTitle: "alert.fix_my_valet.cancel".localized,
|
||||
style: .warning
|
||||
) {
|
||||
// Start the fix
|
||||
waitAndExecute {
|
||||
Actions.fixMyValet()
|
||||
} completion: {
|
||||
Alert.notify(
|
||||
message: "alert.fix_my_valet_done.title".localized,
|
||||
info: "alert.fix_my_valet_done.info".localized
|
||||
)
|
||||
}
|
||||
} else {
|
||||
Log.info("The user has chosen to abort Fix My Valet")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,13 +45,13 @@ class StatusMenu : NSMenu {
|
||||
|
||||
if !PhpEnv.shared.availablePhpVersions.contains(PhpEnv.brewPhpVersion) {
|
||||
servicesMenu.addItem(NSMenuItem(
|
||||
title: "mi_force_load_latest_unavailable".localized(PhpEnv.brewPhpVersion),
|
||||
title: "mi_fix_my_valet_unavailable".localized(PhpEnv.brewPhpVersion),
|
||||
action: nil, keyEquivalent: "f"
|
||||
))
|
||||
} else {
|
||||
servicesMenu.addItem(NSMenuItem(
|
||||
title: "mi_force_load_latest".localized(PhpEnv.brewPhpVersion),
|
||||
action: #selector(MainMenu.forceRestartLatestPhp), keyEquivalent: "f"))
|
||||
title: "mi_fix_my_valet".localized(PhpEnv.brewPhpVersion),
|
||||
action: #selector(MainMenu.fixMyValet), keyEquivalent: "f"))
|
||||
}
|
||||
|
||||
servicesMenu.addItem(NSMenuItem(title: "mi_services".localized, action: nil, keyEquivalent: ""))
|
||||
@ -95,7 +95,11 @@ class StatusMenu : NSMenu {
|
||||
self.addItem(NSMenuItem.separator())
|
||||
self.addItem(HeaderView.asMenuItem(text: "mi_composer".localized))
|
||||
self.addItem(NSMenuItem(title: "mi_global_composer".localized, action: #selector(MainMenu.openGlobalComposerFolder), keyEquivalent: "g"))
|
||||
self.addItem(NSMenuItem(title: "mi_update_global_composer".localized, action: PhpEnv.shared.isBusy ? nil : #selector(MainMenu.updateGlobalComposerDependencies), keyEquivalent: ""))
|
||||
|
||||
let composerMenuItem = NSMenuItem(title: "mi_update_global_composer".localized, action: PhpEnv.shared.isBusy ? nil : #selector(MainMenu.updateGlobalComposerDependencies), keyEquivalent: "g")
|
||||
composerMenuItem.keyEquivalentModifierMask = .shift
|
||||
|
||||
self.addItem(composerMenuItem)
|
||||
|
||||
if (PhpEnv.shared.isBusy) {
|
||||
return
|
||||
|
@ -25,8 +25,8 @@
|
||||
"mi_manage_services" = "Manage Services";
|
||||
"mi_restart_all_services" = "Restart All Services";
|
||||
"mi_stop_all_services" = "Stop All Services";
|
||||
"mi_force_load_latest" = "Force Load (Latest) PHP %@";
|
||||
"mi_force_load_latest_unavailable" = "Force Load Unavailable (PHP %@ Not Installed)";
|
||||
"mi_fix_my_valet" = "Fix My Valet (PHP & Services)";
|
||||
"mi_fix_my_valet_unavailable" = "Fix My Valet Unavailable";
|
||||
"mi_php_refresh" = "Refresh Information";
|
||||
|
||||
"mi_configuration" = "PHP Configuration";
|
||||
@ -191,13 +191,15 @@ problem manually, using your own Terminal app (this just shows you the output)."
|
||||
"alert.composer_php_requirement.title" = "`%@` has the following PHP requirement: \"php\":\n\"%@\".";
|
||||
"alert.composer_php_requirement.info" = "This required PHP version was determined by checking the `%@` field in the `composer.json` file when the site list was last refreshed.";
|
||||
|
||||
// Force Reload Started
|
||||
"alert.force_reload.title" = "PHP Monitor will force reload the latest version of PHP";
|
||||
"alert.force_reload.info" = "This can take a while. You'll get another alert when the force reload has completed.";
|
||||
// Fix My Valet Started
|
||||
"alert.fix_my_valet.title" = "Having issues? Fix My Valet is ready to commence!";
|
||||
"alert.fix_my_valet.info" = "This can take a while. Please be patient.\n\nWhen this is done, all other services will be halted and PHP %@ will be linked. You will be able to switch to your desired version of PHP once this operation has completed.\n\n(You'll get another alert once Fix My Valet is done.)";
|
||||
"alert.fix_my_valet.ok" = "Continue";
|
||||
"alert.fix_my_valet.cancel" = "Abort";
|
||||
|
||||
// Force Reload Done
|
||||
"alert.force_reload_done.title" = "PHP has been force reloaded";
|
||||
"alert.force_reload_done.info" = "All appropriate services have been stopped and the correct ones restarted, and the latest version of PHP should now be active. You can now try switching to another version of PHP.\n\nIf visiting sites still does not work, you may try running `valet install` again, this can fix a 502 issue (Bad Gateway).";
|
||||
// Fix My Valet Done
|
||||
"alert.fix_my_valet_done.title" = "Fix My Valet has completed its operations.";
|
||||
"alert.fix_my_valet_done.info" = "All appropriate services have been stopped and the correct ones restarted, and the latest version of PHP should now be active. You can now try switching to another version of PHP.\n\nIf visiting sites still does not work, you may try running `valet install` again, this can fix a 502 issue (Bad Gateway).\n\nIf Valet is broken and you cannot run `valet install`, you may need to run `composer global update`. Please consult the FAQ on GitHub if you have further issues.";
|
||||
|
||||
// PHP FPM Broken
|
||||
"alert.php_fpm_broken.title" = "PHP-FPM configuration is incorrect";
|
||||
|
Reference in New Issue
Block a user