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:
@@ -260,11 +260,16 @@ class Database {
|
|||||||
$attributes = array('ATTR_ERRMODE' => 'ERRMODE_EXCEPTION');
|
$attributes = array('ATTR_ERRMODE' => 'ERRMODE_EXCEPTION');
|
||||||
|
|
||||||
$dbconf["dsn"] = array(
|
$dbconf["dsn"] = array(
|
||||||
'host' => $host,
|
|
||||||
'dbname' => $sql["db"],
|
'dbname' => $sql["db"],
|
||||||
'charset' => 'utf8'
|
'charset' => 'utf8'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!validateDomain($host) && !validate_ip2($host, true)) {
|
||||||
|
$dbconf["dsn"]['unix_socket'] = makeCorrectFile($host);
|
||||||
|
} else {
|
||||||
|
$dbconf["dsn"]['host'] = $host;
|
||||||
|
}
|
||||||
|
|
||||||
self::$_dbname = $sql["db"];
|
self::$_dbname = $sql["db"];
|
||||||
|
|
||||||
// add options to dsn-string
|
// add options to dsn-string
|
||||||
|
|||||||
Reference in New Issue
Block a user