日志信息隐藏数据库密码

This commit is contained in:
thinkphp
2016-09-02 16:55:07 +08:00
parent 64c3c73d76
commit cf5809838d

View File

@@ -75,7 +75,11 @@ class Db
}
$class = false !== strpos($options['type'], '\\') ? $options['type'] : '\\think\\db\\connector\\' . ucwords($options['type']);
// 记录初始化信息
App::$debug && Log::record('[ DB ] INIT ' . $options['type'] . ':' . var_export($options, true), 'info');
if (App::$debug) {
$info = $options;
$info['password'] = '*****';
Log::record('[ DB ] INIT ' . $options['type'] . ':' . var_export($info, true), 'info');
}
if (true === $name) {
return new $class($options);
} else {