X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Fdatabase%2FDatabaseMysqli.php;h=a11e936cccb0c75a1c49df420f2b06c76b103e11;hb=74000d80667fa92ee21a6bb91902e1491bf28cae;hp=d32a12eb44006e6dee4379b77ea52d14a79e77a5;hpb=4356572546b2b4e8eefda9bf10943ba1b12526b9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/rdbms/database/DatabaseMysqli.php b/includes/libs/rdbms/database/DatabaseMysqli.php index d32a12eb44..a11e936ccc 100644 --- a/includes/libs/rdbms/database/DatabaseMysqli.php +++ b/includes/libs/rdbms/database/DatabaseMysqli.php @@ -64,9 +64,14 @@ class DatabaseMysqli extends DatabaseMysqlBase { ); } - // Other than mysql_connect, mysqli_real_connect expects an explicit port - // and socket parameters. So we need to parse the port and socket out of - // $realServer + // Other than mysql_connect, mysqli_real_connect expects an explicit port number + // e.g. "localhost:1234" or "127.0.0.1:1234" + // or Unix domain socket path + // e.g. "localhost:/socket_path" or "localhost:/foo/bar:bar:bar" + // colons are known to be used by Google AppEngine, + // see + // + // We need to parse the port or socket path out of $realServer $port = null; $socket = null; $hostAndPort = IP::splitHostAndPort( $realServer ); @@ -75,9 +80,9 @@ class DatabaseMysqli extends DatabaseMysqlBase { if ( $hostAndPort[1] ) { $port = $hostAndPort[1]; } - } elseif ( substr_count( $realServer, ':' ) == 1 ) { - // If we have a colon and something that's not a port number - // inside the hostname, assume it's the socket location + } elseif ( substr_count( $realServer, ':/' ) == 1 ) { + // If we have a colon slash instead of a colon and a port number + // after the ip or hostname, assume it's the Unix domain socket path list( $realServer, $socket ) = explode( ':', $realServer, 2 ); }