diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mysql.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/mysql.php b/lib/mysql.php index 215e045..a0ebb5a 100644 --- a/lib/mysql.php +++ b/lib/mysql.php @@ -54,6 +54,13 @@ namespace { $password = ini_get('mysqli.default_pw') ?: null; } + $socket = ''; + if (strpos($hostname, ':/') === 0) { + // it's a unix socket + $socket = $hostname; + $hostname = 'localhost'; + } + $hash = sha1($hostname . $username . $flags); /* persistent connections start with p: */ /* don't use a cached link for those */ @@ -95,7 +102,7 @@ namespace { $password, '', $port, - '', + $socket, $flags ); |