FIX Make deprecation enabled check faster

This commit is contained in:
Guy Sartorelli 2023-11-17 10:41:02 +13:00
parent 4c76ec6102
commit 05f1d9ab86
No known key found for this signature in database
GPG Key ID: F313E3B9504D496A

View File

@ -234,13 +234,13 @@ class Deprecation
public static function isEnabled(): bool public static function isEnabled(): bool
{ {
if (!Director::isDev()) {
return false;
}
if (Environment::hasEnv('SS_DEPRECATION_ENABLED')) { if (Environment::hasEnv('SS_DEPRECATION_ENABLED')) {
$envVar = Environment::getEnv('SS_DEPRECATION_ENABLED'); $envVar = Environment::getEnv('SS_DEPRECATION_ENABLED');
return self::varAsBoolean($envVar); return self::varAsBoolean($envVar);
} }
if (!Director::isDev()) {
return false;
}
return static::$currentlyEnabled; return static::$currentlyEnabled;
} }