mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
自动根据环境变量识别是否调试模式
This commit is contained in:
@@ -61,23 +61,6 @@ class Config
|
||||
return is_file($file) ? self::set(include $file, $name, $range) : self::$config[$range];
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载环境变量配置文件
|
||||
* @param string $file 配置文件名
|
||||
* @param string $name 配置名(如设置即表示二级配置)
|
||||
* @return void
|
||||
*/
|
||||
public static function loadEnv($file, $name = '')
|
||||
{
|
||||
if (is_file($file)) {
|
||||
$env = include $file;
|
||||
foreach ($env as $key => $val) {
|
||||
$name = !empty($name) ? ENV_PREFIX . $name . '_' . $key : ENV_PREFIX . $key;
|
||||
putenv("$name=$val");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测配置是否存在
|
||||
* @param string $name 配置参数名(支持二级配置 .号分割)
|
||||
|
||||
Reference in New Issue
Block a user