give possibility to specify a socket-file as 'host' in userdata.inc.php to connect via mysql-socket instead of hostname; not a setting because this might break some other stuff (mysql-access-hosts -> problems when adding mysql-users/databases, etc.)

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2015-01-07 15:13:32 +01:00
parent 10acd16e17
commit 82fdb84e61

View File

@@ -260,11 +260,16 @@ class Database {
$attributes = array('ATTR_ERRMODE' => 'ERRMODE_EXCEPTION');
$dbconf["dsn"] = array(
'host' => $host,
'dbname' => $sql["db"],
'charset' => 'utf8'
);
if (!validateDomain($host) && !validate_ip2($host, true)) {
$dbconf["dsn"]['unix_socket'] = makeCorrectFile($host);
} else {
$dbconf["dsn"]['host'] = $host;
}
self::$_dbname = $sql["db"];
// add options to dsn-string