File tree Expand file tree Collapse file tree 2 files changed +21
-12
lines changed Expand file tree Collapse file tree 2 files changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -525,12 +525,11 @@ static struct pdo_dbh_methods mysql_methods = {
525
525
pdo_mysql_check_liveness
526
526
};
527
527
/* }}} */
528
- #ifdef PDO_USE_MYSQLND
529
- # ifdef PHP_WIN32
530
- # define MYSQL_UNIX_ADDR "MySQL"
531
- # else
532
- # define MYSQL_UNIX_ADDR PDO_MYSQL_G(default_socket)
533
- # endif
528
+
529
+ #ifdef PHP_WIN32
530
+ # define MYSQL_UNIX_ADDR NULL
531
+ #else
532
+ # define MYSQL_UNIX_ADDR PDO_MYSQL_G(default_socket)
534
533
#endif
535
534
536
535
/* {{{ pdo_mysql_handle_factory */
Original file line number Diff line number Diff line change @@ -37,12 +37,22 @@ ZEND_GET_MODULE(pdo_mysql)
37
37
38
38
ZEND_DECLARE_MODULE_GLOBALS (pdo_mysql );
39
39
40
- #ifndef PHP_WIN32
41
- # ifndef PDO_MYSQL_UNIX_ADDR
42
- # ifdef PHP_MYSQL_UNIX_SOCK_ADDR
43
- # define PDO_MYSQL_UNIX_ADDR PHP_MYSQL_UNIX_SOCK_ADDR
44
- # else
40
+ /*
41
+ The default socket location is sometimes defined by configure.
42
+ With libmysql `mysql_config --socket` will fill PDO_MYSQL_UNIX_ADDR
43
+ and the user can use --with-mysql-sock=SOCKET which will fill
44
+ PDO_MYSQL_UNIX_ADDR. If both aren't set we're using mysqlnd and use
45
+ /tmp/mysql.sock as default on *nix and NULL for Windows (default
46
+ named pipe name is set in mysqlnd).
47
+ */
48
+ #ifndef PDO_MYSQL_UNIX_ADDR
49
+ # ifdef PHP_MYSQL_UNIX_SOCK_ADDR
50
+ # define PDO_MYSQL_UNIX_ADDR PHP_MYSQL_UNIX_SOCK_ADDR
51
+ # else
52
+ # if !PHP_WIN32
45
53
# define PDO_MYSQL_UNIX_ADDR "/tmp/mysql.sock"
54
+ # else
55
+ # define PDO_MYSQL_UNIX_ADDR NULL
46
56
# endif
47
57
# endif
48
58
#endif
@@ -141,7 +151,7 @@ static PHP_MINFO_FUNCTION(pdo_mysql)
141
151
142
152
php_info_print_table_end ();
143
153
144
- #ifdef PDO_USE_MYSQLND
154
+ #ifndef PHP_WIN32
145
155
DISPLAY_INI_ENTRIES ();
146
156
#endif
147
157
}
You can’t perform that action at this time.
0 commit comments