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

Experimental versions can graduate to stable

This commit is contained in:
2023-10-30 19:56:32 +01:00
parent a62ebcff92
commit 8a46b9d374
4 changed files with 30 additions and 4 deletions

View File

@ -20,11 +20,27 @@ struct Constants {
/**
* The PHP versions that are considered pre-release versions.
* Past a certain date, an experimental version "graduates"
* to a release version and is no longer marked as experimental.
*/
static let ExperimentalPhpVersions: Set = [
"8.4"
static var ExperimentalPhpVersions: Set<String> {
let releaseDates = [
"8.4": Date.fromString("2024-12-01"), // PLACEHOLDER DATE
"8.3": Date.fromString("2023-11-23") // OFFICIAL RELEASE
]
return Set(releaseDates
.filter { (_: String, date: Date?) in
guard let date else {
return false
}
return date > Date.now
}.map { (version: String, _: Date?) in
return version
})
}
/**
* The PHP versions supported by this application.
* Any other PHP versions are considered invalid.

View File

@ -15,4 +15,10 @@ extension Date {
return dateFormatter.string(from: self)
}
static func fromString(_ string: String) -> Date? {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd"
return dateFormatter.date(from: string)
}
}

View File

@ -45,7 +45,8 @@ class Brew {
/// Each formula for each PHP version that can be installed.
public static let phpVersionFormulae = [
"8.3": "shivammathur/php/php@8.3",
"8.4": "shivammathur/php/php@8.4",
"8.3": "shivammathur/php/php@8.3", // TODO: when php@8.3 lands in stable, update this
"8.2": "php@8.2",
"8.1": "php@8.1",
"8.0": "php@8.0",

View File

@ -105,6 +105,9 @@ extension MainMenu {
Valet.shared.notifyAboutUnsupportedTLD()
}
// Keep track of which PHP versions are currently about to release
Log.info("Experimental PHP versions: \(Constants.ExperimentalPhpVersions)")
// Find out which services are active
Log.info("The services manager knows about \(ServicesManager.shared.services.count) services.")