mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 20:10:08 +02:00
🏗 Add feature flag based on Valet version
This commit is contained in:
@ -1207,7 +1207,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 = 717;
|
CURRENT_PROJECT_VERSION = 720;
|
||||||
DEBUG = YES;
|
DEBUG = YES;
|
||||||
DEVELOPMENT_TEAM = 8M54J5J787;
|
DEVELOPMENT_TEAM = 8M54J5J787;
|
||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
@ -1217,7 +1217,7 @@
|
|||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MARKETING_VERSION = 5.1.1;
|
MARKETING_VERSION = 5.2;
|
||||||
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 = "";
|
||||||
@ -1233,7 +1233,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 = 717;
|
CURRENT_PROJECT_VERSION = 720;
|
||||||
DEBUG = NO;
|
DEBUG = NO;
|
||||||
DEVELOPMENT_TEAM = 8M54J5J787;
|
DEVELOPMENT_TEAM = 8M54J5J787;
|
||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
@ -1243,7 +1243,7 @@
|
|||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||||
MARKETING_VERSION = 5.1.1;
|
MARKETING_VERSION = 5.2;
|
||||||
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 = "";
|
||||||
|
@ -10,6 +10,10 @@ import Foundation
|
|||||||
|
|
||||||
class Valet {
|
class Valet {
|
||||||
|
|
||||||
|
enum FeatureFlag {
|
||||||
|
case isolatedSites
|
||||||
|
}
|
||||||
|
|
||||||
static let shared = Valet()
|
static let shared = Valet()
|
||||||
|
|
||||||
/// The version of Valet that was detected.
|
/// The version of Valet that was detected.
|
||||||
@ -24,6 +28,9 @@ class Valet {
|
|||||||
/// Whether we're busy with some blocking operation.
|
/// Whether we're busy with some blocking operation.
|
||||||
var isBusy: Bool = false
|
var isBusy: Bool = false
|
||||||
|
|
||||||
|
/// Various feature flags. Enabled based on the installed Valet version.
|
||||||
|
var features: [FeatureFlag] = []
|
||||||
|
|
||||||
/// When initialising the Valet singleton assume no sites loaded. We will load the version later.
|
/// When initialising the Valet singleton assume no sites loaded. We will load the version later.
|
||||||
init() {
|
init() {
|
||||||
self.version = nil
|
self.version = nil
|
||||||
@ -85,6 +92,8 @@ class Valet {
|
|||||||
public func validateVersion() -> Void {
|
public func validateVersion() -> Void {
|
||||||
if version.versionCompare("3.0") == .orderedAscending {
|
if version.versionCompare("3.0") == .orderedAscending {
|
||||||
Log.warn("This version of Valet does not support isolation yet. Disabling isolation checks.")
|
Log.warn("This version of Valet does not support isolation yet. Disabling isolation checks.")
|
||||||
|
} else {
|
||||||
|
self.features.append(FeatureFlag.isolatedSites)
|
||||||
}
|
}
|
||||||
|
|
||||||
if version.versionCompare(Constants.MinimumRecommendedValetVersion) == .orderedAscending {
|
if version.versionCompare(Constants.MinimumRecommendedValetVersion) == .orderedAscending {
|
||||||
|
Reference in New Issue
Block a user