mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 12:00:09 +02:00
👌 Calling detectPhpVersions
always immediately caches the info
This commit is contained in:
@ -29,6 +29,9 @@ class Actions {
|
||||
|
||||
print("The PHP versions that were detected are: \(versionsOnly)")
|
||||
|
||||
App.shared.availablePhpVersions = versionsOnly
|
||||
Actions.extractPhpLongVersions()
|
||||
|
||||
return versionsOnly
|
||||
}
|
||||
|
||||
@ -36,7 +39,7 @@ class Actions {
|
||||
This method extracts the PHP full version number after finding the php installation folders.
|
||||
To be refactored at some later point, I'd like to cache the `PhpInstallation` objects instead of just the version number at some point.
|
||||
*/
|
||||
public static func extractPhpLongVersions() -> [String: String]
|
||||
public static func extractPhpLongVersions()
|
||||
{
|
||||
var mappedVersions: [String: String] = [:]
|
||||
App.shared.availablePhpVersions.forEach { version in
|
||||
@ -50,7 +53,8 @@ class Actions {
|
||||
}
|
||||
mappedVersions[version] = longVersion
|
||||
}
|
||||
return mappedVersions
|
||||
|
||||
App.shared.cachedPhpVersionNumbers = mappedVersions
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -41,8 +41,7 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate {
|
||||
When the environment is all clear and the app can run, let's go.
|
||||
*/
|
||||
private func onEnvironmentPass() {
|
||||
App.shared.availablePhpVersions = Actions.detectPhpVersions()
|
||||
App.shared.cachedPhpVersionNumbers = Actions.extractPhpLongVersions()
|
||||
_ = Actions.detectPhpVersions()
|
||||
updatePhpVersionInStatusBar()
|
||||
|
||||
let installation = App.phpInstall!
|
||||
|
Reference in New Issue
Block a user