v1.2修复优化
This commit is contained in:
@@ -19,7 +19,8 @@ class Database
|
||||
|
||||
$config = json_decode(file_get_contents($configPath), true);
|
||||
|
||||
$dsn = "mysql:host={$config['host']};port={$config['port']};dbname={$config['dbname']};charset=utf8mb4";
|
||||
$dbname = $config['database'] ?? $config['dbname'] ?? '';
|
||||
$dsn = "mysql:host={$config['host']};port={$config['port']};dbname={$dbname};charset=utf8mb4";
|
||||
|
||||
self::$instance = new PDO($dsn, $config['user'], $config['password'], [
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
|
||||
Reference in New Issue
Block a user