mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-02 11:48:08 +08:00
Set app env to dev even config.php does not exist
This commit is contained in:
parent
2cdccdaf55
commit
0e91af80f1
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user