$this->fetchType = $config['result_type'];
}
try {
if (empty($config['dsn'])) {
$config['dsn'] = $this->parseDsn($config);
}
if ($config['debug']) {
$startTime = microtime(true);
}
$this->links[$linkNum] = new PDO($config['dsn'], $config['username'], $config['password'], $params);
if ($config['debug']) {
// 记录数据库连接信息
Log::record('[ DB ] CONNECT:[ UseTime:' . number_format(microtime(true) - $startTime, 6) . 's ] ' . $config['dsn'], 'sql');
}
} catch (\PDOException $e) {
if ($autoConnection) {
Log::record($e->getMessage(), 'error');
return $this->connect($autoConnection, $linkNum);
} else {
Call Stack
- in Connection.php line 295
- at PDO->__construct() in Connection.php line 295
- at Connection->connect() in Connection.php line 995
- at Connection->initConnect() in Connection.php line 348
- at Connection->query()
- at call_user_func_array() in Db.php line 178
- at Db::__callStatic() in Index.php line 141
- at Index->fanyi_article_content()
- at ReflectionMethod->invokeArgs() in App.php line 343
- at App::invokeMethod() in App.php line 611
- at App::module() in App.php line 456
- at App::exec() in App.php line 139
- at App::run() in start.php line 19
- at require('/data/wwwroot/td.880...') in index.php line 23
Environment Variables
POST Data
Server/Request Data
ThinkPHP Constants
Tag : Finance