Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Connection through socket

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@607 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
commit d204a6ea1530f270adb553594dccefda0ef4019d 1 parent 1b97f48
jakubvrana authored
Showing with 6 additions and 2 deletions.
  1. +3 −0  changes.txt
  2. +3 −2 mysql.inc.php
View
3  changes.txt
@@ -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)
View
5 mysql.inc.php
@@ -14,7 +14,8 @@ function connect($server, $username, $password) {
(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 @@ class Min_PDO_MySQL extends Min_PDO {
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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.