Skip to content

Commit b4cda15

Browse files
🚀 Version 25.10.1
2 parents d4e395f + d7b7f96 commit b4cda15

File tree

11 files changed

+38
-72
lines changed

11 files changed

+38
-72
lines changed

PHP Monitor.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3920,7 +3920,7 @@
39203920
CODE_SIGN_IDENTITY = "Apple Development";
39213921
CODE_SIGN_STYLE = Automatic;
39223922
COMBINE_HIDPI_IMAGES = YES;
3923-
CURRENT_PROJECT_VERSION = 1685;
3923+
CURRENT_PROJECT_VERSION = 1690;
39243924
DEAD_CODE_STRIPPING = YES;
39253925
DEBUG = YES;
39263926
ENABLE_APP_SANDBOX = NO;
@@ -3939,7 +3939,7 @@
39393939
"@executable_path/../Frameworks",
39403940
);
39413941
MACOSX_DEPLOYMENT_TARGET = 13.5;
3942-
MARKETING_VERSION = 25.10;
3942+
MARKETING_VERSION = 25.10.1;
39433943
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
39443944
PRODUCT_MODULE_NAME = PHP_Monitor;
39453945
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -3964,7 +3964,7 @@
39643964
CODE_SIGN_IDENTITY = "Apple Development";
39653965
CODE_SIGN_STYLE = Automatic;
39663966
COMBINE_HIDPI_IMAGES = YES;
3967-
CURRENT_PROJECT_VERSION = 1685;
3967+
CURRENT_PROJECT_VERSION = 1690;
39683968
DEAD_CODE_STRIPPING = YES;
39693969
DEBUG = NO;
39703970
ENABLE_APP_SANDBOX = NO;
@@ -3983,7 +3983,7 @@
39833983
"@executable_path/../Frameworks",
39843984
);
39853985
MACOSX_DEPLOYMENT_TARGET = 13.5;
3986-
MARKETING_VERSION = 25.10;
3986+
MARKETING_VERSION = 25.10.1;
39873987
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
39883988
PRODUCT_MODULE_NAME = PHP_Monitor;
39893989
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -4146,7 +4146,7 @@
41464146
CODE_SIGN_IDENTITY = "Apple Development";
41474147
CODE_SIGN_STYLE = Automatic;
41484148
COMBINE_HIDPI_IMAGES = YES;
4149-
CURRENT_PROJECT_VERSION = 1685;
4149+
CURRENT_PROJECT_VERSION = 1690;
41504150
DEAD_CODE_STRIPPING = YES;
41514151
DEBUG = YES;
41524152
ENABLE_APP_SANDBOX = NO;
@@ -4165,7 +4165,7 @@
41654165
"@executable_path/../Frameworks",
41664166
);
41674167
MACOSX_DEPLOYMENT_TARGET = 13.5;
4168-
MARKETING_VERSION = 25.10;
4168+
MARKETING_VERSION = 25.10.1;
41694169
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon.eap;
41704170
PRODUCT_MODULE_NAME = PHP_Monitor;
41714171
PRODUCT_NAME = "$(TARGET_NAME) EAP";
@@ -4339,7 +4339,7 @@
43394339
CODE_SIGN_IDENTITY = "Apple Development";
43404340
CODE_SIGN_STYLE = Automatic;
43414341
COMBINE_HIDPI_IMAGES = YES;
4342-
CURRENT_PROJECT_VERSION = 1685;
4342+
CURRENT_PROJECT_VERSION = 1690;
43434343
DEAD_CODE_STRIPPING = YES;
43444344
DEBUG = NO;
43454345
ENABLE_APP_SANDBOX = NO;
@@ -4358,7 +4358,7 @@
43584358
"@executable_path/../Frameworks",
43594359
);
43604360
MACOSX_DEPLOYMENT_TARGET = 13.5;
4361-
MARKETING_VERSION = 25.10;
4361+
MARKETING_VERSION = 25.10.1;
43624362
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon.eap;
43634363
PRODUCT_MODULE_NAME = PHP_Monitor;
43644364
PRODUCT_NAME = "$(TARGET_NAME) EAP";

PHP Monitor.xcodeproj/xcshareddata/xcschemes/PHP Monitor EAP.xcscheme

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
</TestAction>
6868
<LaunchAction
6969
buildConfiguration = "Debug.EA"
70-
selectedDebuggerIdentifier = ""
71-
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
70+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
71+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
7272
launchStyle = "0"
7373
useCustomWorkingDirectory = "NO"
7474
ignoresPersistentStateOnLaunch = "NO"

PHP Monitor.xcodeproj/xcshareddata/xcschemes/PHP Monitor.xcscheme

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
</TestAction>
7171
<LaunchAction
7272
buildConfiguration = "Debug"
73-
selectedDebuggerIdentifier = ""
74-
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
73+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
74+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
7575
launchStyle = "0"
7676
useCustomWorkingDirectory = "NO"
7777
ignoresPersistentStateOnLaunch = "NO"

phpmon/Common/Extensions/StringExtension.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import SwiftUI
99

1010
struct Localization {
1111
static var preferredLanguage: String? {
12-
if Preferences.shared == nil {
12+
if App.shared.preferences == nil {
1313
return nil
1414
}
1515

phpmon/Common/Testables/TestableConfiguration.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,9 @@ public struct TestableConfiguration: Codable {
126126
let container = App.shared.container
127127
container.overrideWith(config: self)
128128

129-
Preferences.shared = Preferences(container)
130129
Log.info("Applying temporary preference overrides...")
131130
preferenceOverrides.forEach { (key: PreferenceName, value: Any?) in
132-
Preferences.shared.cachedPreferences[key] = value
131+
container.preferences.cachedPreferences[key] = value
133132
}
134133

135134
if Valet.shared.installed {

phpmon/Container/Container.swift

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@
77
//
88

99
class Container {
10-
// Core abstractions
10+
// Primary
1111
var shell: ShellProtocol!
1212
var filesystem: FileSystemProtocol!
1313
var command: CommandProtocol!
14-
15-
// Extra abstractions
1614
var paths: Paths!
15+
16+
// Secondary (uses primary instances above)
17+
var preferences: Preferences!
1718
var phpEnvs: PhpEnvironments!
1819
var favorites: Favorites!
19-
var warningManager: WarningManager! // pending rename?
20+
var warningManager: WarningManager!
2021

2122
///
2223
/// The initializer is empty. You must call `prepare` to enable the container.
@@ -32,13 +33,17 @@ class Container {
3233
/// the container itself and passing the reference on to each component that needs it.
3334
///
3435
public func prepare() {
35-
// Core
36+
// These are the most basic building blocks. We need these before
37+
// any of the other classes can be initialized!
3638
self.shell = RealShell(container: self)
3739
self.filesystem = RealFileSystem(container: self)
3840
self.command = RealCommand()
39-
40-
// Extra
4141
self.paths = Paths(container: self)
42+
43+
// Please note that the order in which these are initialized, matters!
44+
// For example, preferences leverages the Paths instance, so don't just
45+
// swap these around for no reason... the order is very intentional.
46+
self.preferences = Preferences(container: self)
4247
self.phpEnvs = PhpEnvironments(container: self)
4348
self.favorites = Favorites()
4449
self.warningManager = WarningManager(container: self)

phpmon/Domain/App/AppDelegate.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
3535
*/
3636
let brew: Brew
3737

38-
/**
39-
The PhpEnvironments singleton that handles PHP version
40-
detection, as well as switching. It is initialized
41-
when the app is ready and passed all checks.
42-
*/
43-
var phpEnvironments: PhpEnvironments! = nil
44-
4538
/**
4639
The logger is responsible for different levels of logging.
4740
You can tweak the verbosity in the `init` method here.
@@ -96,10 +89,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
9689
super.init()
9790
}
9891

99-
func initializeSwitcher() {
100-
self.phpEnvironments = App.shared.container.phpEnvs
101-
}
102-
10392
static func initializeTestingProfile(_ path: String) {
10493
Log.info("The configuration with path `\(path)` is being requested...")
10594
// Clear for PHP Guard

phpmon/Domain/App/Startup.swift

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Startup {
2222
Log.info("The user is running PHP Monitor with the architecture: \(App.architecture)")
2323

2424
// Set up a "background" timer on the main thread
25-
Task { @MainActor in
25+
await MainActor.run {
2626
startStartupTimer()
2727
}
2828

@@ -47,7 +47,6 @@ class Startup {
4747
}
4848

4949
// If we get here, nothing has gone wrong. That's what we want!
50-
initializeSwitcher()
5150
Log.info("PHP Monitor has determined the application has successfully passed all checks.")
5251

5352
Log.separator(as: .info)
@@ -82,17 +81,6 @@ class Startup {
8281
.show()
8382
}
8483

85-
/**
86-
Because the Switcher requires various environment guarantees, the switcher is only
87-
initialized when it is done working. The switcher must be initialized on the main thread.
88-
*/
89-
private func initializeSwitcher() {
90-
Task { @MainActor in
91-
let appDelegate = NSApplication.shared.delegate as! AppDelegate
92-
appDelegate.initializeSwitcher()
93-
}
94-
}
95-
9684
// MARK: - Check (List)
9785

9886
public var groups: [EnvironmentCheckGroup] = [

phpmon/Domain/Integrations/Packagist/Packagist.swift

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,32 +34,23 @@ class Packagist {
3434
throw PackagistError.unexpectedResponseStructure
3535
}
3636

37-
// Filter for stable versions using the version_normalized string.
38-
// A stable version typically does not have a hyphen (-) indicating a pre-release.
37+
// Packagist v2 API returns versions in descending order (newest first).
38+
// Filter for stable versions - those without a hyphen in version_normalized.
3939
let stableVersions = versionsArray.filter { version in
4040
guard let versionNormalized = version.version_normalized else {
4141
return false
4242
}
43-
44-
// Filter out versions with a hyphen, which are usually unstable.
43+
// Filter out pre-release versions (alpha, beta, RC, etc.)
4544
return !versionNormalized.contains("-")
4645
}
4746

48-
// Sort the filtered versions using version_normalized, which is designed for lexicographical sorting.
49-
let sortedVersions = stableVersions.sorted { (version1, version2) -> Bool in
50-
guard let v1 = version1.version_normalized, let v2 = version2.version_normalized else {
51-
return false
52-
}
53-
return v1.lexicographicallyPrecedes(v2)
54-
}
55-
56-
// The last element of the sorted array is the latest version
57-
guard let latestVersionInfo = sortedVersions.last,
47+
// Get the first stable version (which is the latest)
48+
guard let latestVersionInfo = stableVersions.first,
5849
let latestVersion = latestVersionInfo.version else {
5950
throw PackagistError.noStableVersions
6051
}
6152

62-
return try! VersionNumber.parse(latestVersion)
53+
return try VersionNumber.parse(latestVersion)
6354
} catch {
6455
// Catch any errors that occurred and re-throw them as our custom error type for better diagnostics.
6556
if let decodingError = error as? DecodingError {

phpmon/Domain/Menu/MainMenu+Startup.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extension MainMenu {
1515
*/
1616
func startup() async {
1717
// Start with the icon
18-
Task { @MainActor in
18+
await MainActor.run {
1919
self.setStatusBar(image: NSImage.statusBarIcon)
2020
}
2121

@@ -36,9 +36,6 @@ extension MainMenu {
3636
// Make sure that broken symlinks are removed ASAP
3737
await BrewDiagnostics.shared.checkForOutdatedPhpInstallationSymlinks()
3838

39-
// Initialize preferences
40-
Preferences.shared = Preferences(container)
41-
4239
// Put some useful diagnostics information in log
4340
BrewDiagnostics.shared.logBootInformation()
4441

0 commit comments

Comments
 (0)