modifs.mineures sans commentaires

This commit is contained in:
Jephté Clain 2025-10-01 18:35:06 +04:00
parent bed23c9425
commit 2456a48b38

View File

@ -41,13 +41,19 @@ class ProfileManager {
$this->productionModes = static::PRODUCTION_MODES;
$this->profileMap = static::PROFILE_MAP;
$name = $params["name"] ?? static::NAME;
$configKey = "${name}_profile";
$envKey = strtoupper($configKey);
if ($this->isAppProfile) {
$this->envKeys = [$envKey, "APP_PROFILE"];
if ($name === null) {
$this->configKey = null;
$this->envKeys = ["APP_PROFILE"];
} else {
$this->configKey = $configKey;
$this->envKeys = [$envKey];
$configKey = "${name}_profile";
$envKey = strtoupper($configKey);
if ($this->isAppProfile) {
$this->configKey = null;
$this->envKeys = [$envKey, "APP_PROFILE"];
} else {
$this->configKey = $configKey;
$this->envKeys = [$envKey];
}
}
}
@ -66,14 +72,14 @@ class ProfileManager {
return $this->profileMap[$profile] ?? $profile;
}
protected ?string $configKey = null;
protected ?string $configKey;
function getConfigProfile(): ?string {
if ($this->configKey === null) return null;
return config::k($this->configKey);
}
protected array $envKeys = [];
protected array $envKeys;
function getEnvProfile(): ?string {
foreach ($this->envKeys as $envKey) {