1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-08 04:20:07 +02:00

👌 Tweak order of operations to speed up boot

This commit is contained in:
2021-12-16 18:56:51 +01:00
parent 8114eef381
commit adc31984a8
7 changed files with 14 additions and 17 deletions

View File

@ -793,7 +793,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 125;
CURRENT_PROJECT_VERSION = 130;
DEVELOPMENT_TEAM = 8M54J5J787;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = phpmon/Info.plist;
@ -802,7 +802,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = "4.1-rc2";
MARKETING_VERSION = "4.1-rc3";
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -818,7 +818,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 125;
CURRENT_PROJECT_VERSION = 130;
DEVELOPMENT_TEAM = 8M54J5J787;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = phpmon/Info.plist;
@ -827,7 +827,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = "4.1-rc2";
MARKETING_VERSION = "4.1-rc3";
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";

View File

@ -20,7 +20,7 @@ extension App {
func loadGlobalHotkey() {
// Make sure we can retrieve the hotkey from preferences
guard let hotkey = Preferences.preferences[.globalHotkey] as? String else {
print("No global hotkey loaded")
print("No global hotkey was saved in preferences. None set.")
return
}

View File

@ -32,13 +32,6 @@ class App {
return App.shared.busy
}
// MARK: - Initializer
/** When the app boots up, this code will run even before the start-up checks. */
init() {
loadGlobalHotkey()
}
// MARK: Variables
/** The list of preferences that are currently active. */

View File

@ -17,9 +17,7 @@ extension AppDelegate {
let notificationCenter = UNUserNotificationCenter.current()
notificationCenter.delegate = self
notificationCenter.requestAuthorization(options: [.alert], completionHandler: { granted, error in
if granted {
print("PHP Monitor has permission to show notifications.")
} else {
if !granted {
print("PHP Monitor does not have permission to show notifications.")
}
if let error = error {

View File

@ -33,6 +33,10 @@ class Valet {
from: try! String(contentsOf: file, encoding: .utf8).data(using: .utf8)!
)
self.sites = []
}
public func startPreloadingSites() {
if self.sites.count <= 10 {
// Preload the sites and their drivers
print("Fewer than or 11 sites found, preloading list of sites...")

View File

@ -68,9 +68,13 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate {
}
print("Detected applications: \(appNames)")
// Load the global hotkey
App.shared.loadGlobalHotkey()
// Attempt to find out more info about Valet
print("PHP Monitor has extracted the version number of Valet: \(Valet.shared.version)")
Valet.shared.validateVersion()
Valet.shared.startPreloadingSites()
print("PHP Monitor is ready to serve!")
// Schedule a request to fetch the PHP version every 60 seconds

View File

@ -33,8 +33,6 @@ class Paths {
print("This usually means we're in trouble... (no Homebrew?)")
baseDir = .usr
}
print("Homebrew directory: \(baseDir)")
}
// - MARK: Binaries