add runtime preferences config dir fallback

This commit is contained in:
sunxyw
2023-03-17 16:37:45 +08:00
parent 61684d1902
commit 5d6d819ca3
2 changed files with 3 additions and 2 deletions

View File

@@ -56,7 +56,8 @@ class RuntimePreferences
public function getConfigDir(): string
{
return $this->config_dir;
// fallback to internal config dir if config_dir not exists
return is_dir($this->config_dir) ? $this->config_dir : FRAMEWORK_ROOT_DIR . '/config';
}
public function withConfigDir(string $config_dir): self