mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 20:10:08 +02:00
⚡️ Performance fixes
- Avoid preloading list of sites twice - Avoid loading Valet info twice - Preload list of sites if <= 10 sites linked + parked - Added fallback for missing instructions - Improved description
This commit is contained in:
@ -771,7 +771,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 105;
|
CURRENT_PROJECT_VERSION = 110;
|
||||||
DEVELOPMENT_TEAM = 8M54J5J787;
|
DEVELOPMENT_TEAM = 8M54J5J787;
|
||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
INFOPLIST_FILE = phpmon/Info.plist;
|
INFOPLIST_FILE = phpmon/Info.plist;
|
||||||
@ -780,7 +780,7 @@
|
|||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MARKETING_VERSION = "4.1-beta4";
|
MARKETING_VERSION = "4.1-beta5";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
|
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@ -796,7 +796,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 105;
|
CURRENT_PROJECT_VERSION = 110;
|
||||||
DEVELOPMENT_TEAM = 8M54J5J787;
|
DEVELOPMENT_TEAM = 8M54J5J787;
|
||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
INFOPLIST_FILE = phpmon/Info.plist;
|
INFOPLIST_FILE = phpmon/Info.plist;
|
||||||
@ -805,7 +805,7 @@
|
|||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MARKETING_VERSION = "4.1-beta4";
|
MARKETING_VERSION = "4.1-beta5";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
|
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
@ -36,6 +36,12 @@ class Valet {
|
|||||||
Valet.Configuration.self,
|
Valet.Configuration.self,
|
||||||
from: try! String(contentsOf: file, encoding: .utf8).data(using: .utf8)!
|
from: try! String(contentsOf: file, encoding: .utf8).data(using: .utf8)!
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if self.sites.count <= 10 {
|
||||||
|
// Preload the sites and their drivers
|
||||||
|
print("Fewer than or 11 sites found, preloading list of sites...")
|
||||||
|
self.reloadSites()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func reloadSites() {
|
public func reloadSites() {
|
||||||
|
@ -60,8 +60,7 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate {
|
|||||||
installation.notifyAboutBrokenPhpFpm()
|
installation.notifyAboutBrokenPhpFpm()
|
||||||
|
|
||||||
// Attempt to find out more info about Valet
|
// Attempt to find out more info about Valet
|
||||||
let valet = Valet()
|
print("PHP Monitor has extracted the version number of Valet: \(Valet.shared.version)")
|
||||||
print("PHP Monitor has extracted the version number of Valet: \(valet.version)")
|
|
||||||
print("PHP Monitor is ready to serve!")
|
print("PHP Monitor is ready to serve!")
|
||||||
|
|
||||||
// Schedule a request to fetch the PHP version every 60 seconds
|
// Schedule a request to fetch the PHP version every 60 seconds
|
||||||
|
@ -71,7 +71,13 @@ class SiteListVC: NSViewController, NSTableViewDelegate, NSTableViewDataSource {
|
|||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
tableView.doubleAction = #selector(self.doubleClicked(sender:))
|
tableView.doubleAction = #selector(self.doubleClicked(sender:))
|
||||||
reloadSites()
|
if !Valet.shared.sites.isEmpty {
|
||||||
|
// Preloaded list
|
||||||
|
sites = Valet.shared.sites
|
||||||
|
searchedFor(text: lastSearchedFor)
|
||||||
|
} else {
|
||||||
|
reloadSites()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Async Operations
|
// MARK: - Async Operations
|
||||||
@ -308,21 +314,24 @@ class SiteListVC: NSViewController, NSTableViewDelegate, NSTableViewDataSource {
|
|||||||
if editor.hasBinary() {
|
if editor.hasBinary() {
|
||||||
editor.openDirectory(file: selectedSite!.absolutePath!)
|
editor.openDirectory(file: selectedSite!.absolutePath!)
|
||||||
} else {
|
} else {
|
||||||
Alert.confirm(
|
presentAlertForMissingEditorBinary(editor, sender)
|
||||||
onWindow: self.view.window!,
|
|
||||||
messageText: "editors.binary_missing.title"
|
|
||||||
.localized(
|
|
||||||
editor.pathToBinary
|
|
||||||
),
|
|
||||||
informativeText: editor.missingBinaryInstruction ?? "",
|
|
||||||
buttonTitle: "editors.alert.try_again".localized,
|
|
||||||
secondButtonTitle: "editors.alert.cancel".localized,
|
|
||||||
onFirstButtonPressed: {
|
|
||||||
self.openWithEditor(sender: sender)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func presentAlertForMissingEditorBinary(_ editor: Editor, _ sender: EditorMenuItem) {
|
||||||
|
Alert.confirm(
|
||||||
|
onWindow: self.view.window!,
|
||||||
|
messageText: "editors.binary_missing.title".localized(editor.pathToBinary),
|
||||||
|
informativeText:
|
||||||
|
editor.missingBinaryInstruction
|
||||||
|
?? "editors.binary_missing.desc".localized(editor.pathToBinary),
|
||||||
|
buttonTitle: "editors.alert.try_again".localized,
|
||||||
|
secondButtonTitle: "editors.alert.cancel".localized,
|
||||||
|
onFirstButtonPressed: {
|
||||||
|
self.openWithEditor(sender: sender)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - Deinitialization
|
// MARK: - Deinitialization
|
||||||
|
|
||||||
|
@ -75,6 +75,7 @@
|
|||||||
|
|
||||||
// EDITORS
|
// EDITORS
|
||||||
"editors.binary_missing.title" = "`%@` missing";
|
"editors.binary_missing.title" = "`%@` missing";
|
||||||
|
"editors.binary_missing.desc" = "The associated binary (`%@`) is missing. Because of this, PHP Monitor cannot open the domain’s folder.";
|
||||||
"editors.alert.try_again" = "Try Again";
|
"editors.alert.try_again" = "Try Again";
|
||||||
"editors.alert.cancel" = "Cancel";
|
"editors.alert.cancel" = "Cancel";
|
||||||
|
|
||||||
@ -88,6 +89,7 @@ After this is done, PHP Monitor should be able to open the domain’s folder in
|
|||||||
"PHP Monitor makes use of Visual Studio Code‘s helper binary, `code`, but it seems not to exist on your system.
|
"PHP Monitor makes use of Visual Studio Code‘s helper binary, `code`, but it seems not to exist on your system.
|
||||||
|
|
||||||
You can fix this by selecting 'Install `code` command in PATH' in Visual Studio Code’s command palette.
|
You can fix this by selecting 'Install `code` command in PATH' in Visual Studio Code’s command palette.
|
||||||
|
(Type `>code` to find it.)
|
||||||
|
|
||||||
After this is done, PHP Monitor should be able to open the domain’s folder in PhpStorm.";
|
After this is done, PHP Monitor should be able to open the domain’s folder in PhpStorm.";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user