mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-03-22 00:02:45 -04:00
Fix MySQL UNIX socket support (#5166)
MySQL uses different parameters for passing UNIX socket pathts (unix_socket) and TCP sockets (host) in contrast to PosgreSQL which uses one for both (host). Signed-off-by: Konrad Gräfe <kgraefe@paktolos.net>
This commit is contained in:
@@ -51,7 +51,13 @@ class Minz_ModelPdo {
|
||||
|
||||
switch ($db['type']) {
|
||||
case 'mysql':
|
||||
$dsn = 'mysql:host=' . (empty($dbServer['host']) ? $db['host'] : $dbServer['host']) . ';charset=utf8mb4';
|
||||
$dsn = 'mysql:';
|
||||
if (empty($dbServer['host'])) {
|
||||
$dsn .= 'unix_socket=' . $db['host'];
|
||||
} else {
|
||||
$dsn .= 'host=' . $dbServer['host'];
|
||||
}
|
||||
$dsn .= ';charset=utf8mb4';
|
||||
if (!empty($db['base'])) {
|
||||
$dsn .= ';dbname=' . $db['base'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user