]> git.joonet.de Git - adminer.git/commitdiff
Connection through socket
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Tue, 19 May 2009 12:06:49 +0000 (12:06 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Tue, 19 May 2009 12:06:49 +0000 (12:06 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@607 7c3ca157-0c34-0410-bff1-cbf682f78f5c

changes.txt
mysql.inc.php

index 332969fa03c5968816e2e609ada0c8979342accc..15f0e5d89194018298ed28085bf1ab9d881da938 100644 (file)
@@ -1,3 +1,6 @@
+phpMinAdmin 1.10.2:
+Connection through socket by server :/path/to/socket
+
 phpMinAdmin 1.10.1:
 Highlight odd and hover rows
 Partition editing comfort (bug #2783446)
index 257c9d1b79942fce36b0a7a61fda7e9c97fbb968..5d1a0083b3fe6ebf894be2f997c51e11404f0bd5 100644 (file)
@@ -14,7 +14,8 @@ if (extension_loaded("mysqli")) {
                                (strlen("$server$username") ? $username : ini_get("mysqli.default_user")),
                                (strlen("$server$username$password") ? $password : ini_get("mysqli.default_pw")),
                                null,
-                               (strlen($port) ? $port : ini_get("mysqli.default_port"))
+                               (is_numeric($port) ? $port : ini_get("mysqli.default_port")),
+                               (!is_numeric($port) ? $port : null)
                        );
                }
                
@@ -175,7 +176,7 @@ if (extension_loaded("mysqli")) {
                var $extension = "PDO_MySQL";
                
                function connect($server, $username, $password) {
-                       $this->dsn("mysql:host=" . str_replace(":", ";port=", $server), $username, $password);
+                       $this->dsn("mysql:host=" . str_replace(":", ";unix_socket=", preg_replace('~:([0-9])~', ';port=\\1', $server)), $username, $password);
                        $this->server_info = $this->result($this->query("SELECT VERSION()"));
                        return true;
                }