mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-08 12:29:54 +02:00
👌 Tweak order of operations to speed up boot
This commit is contained in:
@@ -793,7 +793,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 = 125;
|
CURRENT_PROJECT_VERSION = 130;
|
||||||
DEVELOPMENT_TEAM = 8M54J5J787;
|
DEVELOPMENT_TEAM = 8M54J5J787;
|
||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
INFOPLIST_FILE = phpmon/Info.plist;
|
INFOPLIST_FILE = phpmon/Info.plist;
|
||||||
@@ -802,7 +802,7 @@
|
|||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MARKETING_VERSION = "4.1-rc2";
|
MARKETING_VERSION = "4.1-rc3";
|
||||||
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 = "";
|
||||||
@@ -818,7 +818,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 = 125;
|
CURRENT_PROJECT_VERSION = 130;
|
||||||
DEVELOPMENT_TEAM = 8M54J5J787;
|
DEVELOPMENT_TEAM = 8M54J5J787;
|
||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
INFOPLIST_FILE = phpmon/Info.plist;
|
INFOPLIST_FILE = phpmon/Info.plist;
|
||||||
@@ -827,7 +827,7 @@
|
|||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MARKETING_VERSION = "4.1-rc2";
|
MARKETING_VERSION = "4.1-rc3";
|
||||||
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 = "";
|
||||||
|
@@ -20,7 +20,7 @@ extension App {
|
|||||||
func loadGlobalHotkey() {
|
func loadGlobalHotkey() {
|
||||||
// Make sure we can retrieve the hotkey from preferences
|
// Make sure we can retrieve the hotkey from preferences
|
||||||
guard let hotkey = Preferences.preferences[.globalHotkey] as? String else {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -32,13 +32,6 @@ class App {
|
|||||||
return App.shared.busy
|
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
|
// MARK: Variables
|
||||||
|
|
||||||
/** The list of preferences that are currently active. */
|
/** The list of preferences that are currently active. */
|
||||||
|
@@ -17,9 +17,7 @@ extension AppDelegate {
|
|||||||
let notificationCenter = UNUserNotificationCenter.current()
|
let notificationCenter = UNUserNotificationCenter.current()
|
||||||
notificationCenter.delegate = self
|
notificationCenter.delegate = self
|
||||||
notificationCenter.requestAuthorization(options: [.alert], completionHandler: { granted, error in
|
notificationCenter.requestAuthorization(options: [.alert], completionHandler: { granted, error in
|
||||||
if granted {
|
if !granted {
|
||||||
print("PHP Monitor has permission to show notifications.")
|
|
||||||
} else {
|
|
||||||
print("PHP Monitor does not have permission to show notifications.")
|
print("PHP Monitor does not have permission to show notifications.")
|
||||||
}
|
}
|
||||||
if let error = error {
|
if let error = error {
|
||||||
|
@@ -33,6 +33,10 @@ class Valet {
|
|||||||
from: try! String(contentsOf: file, encoding: .utf8).data(using: .utf8)!
|
from: try! String(contentsOf: file, encoding: .utf8).data(using: .utf8)!
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.sites = []
|
||||||
|
}
|
||||||
|
|
||||||
|
public func startPreloadingSites() {
|
||||||
if self.sites.count <= 10 {
|
if self.sites.count <= 10 {
|
||||||
// Preload the sites and their drivers
|
// Preload the sites and their drivers
|
||||||
print("Fewer than or 11 sites found, preloading list of sites...")
|
print("Fewer than or 11 sites found, preloading list of sites...")
|
||||||
|
@@ -68,9 +68,13 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate {
|
|||||||
}
|
}
|
||||||
print("Detected applications: \(appNames)")
|
print("Detected applications: \(appNames)")
|
||||||
|
|
||||||
|
// Load the global hotkey
|
||||||
|
App.shared.loadGlobalHotkey()
|
||||||
|
|
||||||
// Attempt to find out more info about Valet
|
// Attempt to find out more info about 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.shared.version)")
|
||||||
Valet.shared.validateVersion()
|
Valet.shared.validateVersion()
|
||||||
|
Valet.shared.startPreloadingSites()
|
||||||
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
|
||||||
|
@@ -33,8 +33,6 @@ class Paths {
|
|||||||
print("This usually means we're in trouble... (no Homebrew?)")
|
print("This usually means we're in trouble... (no Homebrew?)")
|
||||||
baseDir = .usr
|
baseDir = .usr
|
||||||
}
|
}
|
||||||
|
|
||||||
print("Homebrew directory: \(baseDir)")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - MARK: Binaries
|
// - MARK: Binaries
|
||||||
|
Reference in New Issue
Block a user