Set app env to dev even config.php does not exist

This commit is contained in:
huangzhhui 2020-05-25 02:25:29 +08:00
parent 2cdccdaf55
commit 0e91af80f1

View File

@ -148,6 +148,7 @@ final class ScanConfig
{
$config = [];
$configFromProviders = [];
$appEnv = 'dev';
if (class_exists(ProviderConfig::class)) {
$configFromProviders = ProviderConfig::load();
}
@ -169,7 +170,7 @@ final class ScanConfig
// Load the config/config.php and merge the config
if (file_exists($configDir . '/config.php')) {
$configContent = include $configDir . '/config.php';
$appEnv = $configContent['app_env'] ?? 'dev';
$appEnv = $configContent['app_env'] ?? $appEnv;
if (isset($configContent['annotations'])) {
$config = static::allocateConfigValue($configContent['annotations'], $config);
}