only do this magic on non-win32 platforms

This commit is contained in:
Wez Furlong 2005-02-10 01:34:39 +00:00
parent 042f9081a8
commit e9f5fb53f3

View File

@ -272,12 +272,15 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
}
}
if (vars[2].optval && strcmp("localhost", vars[2].optval)) {
host = vars[2].optval;
port = atoi(vars[3].optval);
} else {
#ifndef PHP_WIN32
if (vars[2].optval && !strcmp("localhost", vars[2].optval)) {
host = ".";
unix_socket = vars[4].optval;
} else
#endif
{
host = vars[2].optval;
port = atoi(vars[3].optval);
}
dbname = vars[1].optval;
if (mysql_real_connect(H->server, host, dbh->username, dbh->password, dbname, port, unix_socket, 0) == NULL) {