From: Andrey Hristov Date: Fri, 2 Oct 2015 13:47:43 +0000 (+0200) Subject: MNDR: X-Git-Tag: php-7.1.0alpha1~806 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ea4891e7586974382da9a2cf0efb010c5878a6e;p=php MNDR: - rename mysqlnd_init to mysqlnd_connection_init - rename mysqlnd_connect to mysqlnd_connection_connect - created macros for BC --- diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index eede5a5800..3ca8b1114b 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -1148,14 +1148,14 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn_handle, /* {{{ mysqlnd_connect */ -PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn_handle, - const char * host, const char * user, - const char * passwd, unsigned int passwd_len, - const char * db, unsigned int db_len, - unsigned int port, - const char * socket_or_pipe, - unsigned int mysql_flags, - unsigned int client_api_flags +PHPAPI MYSQLND * mysqlnd_connection_connect(MYSQLND * conn_handle, + const char * host, const char * user, + const char * passwd, unsigned int passwd_len, + const char * db, unsigned int db_len, + unsigned int port, + const char * socket_or_pipe, + unsigned int mysql_flags, + unsigned int client_api_flags ) { enum_func_status ret = FAIL; @@ -1166,7 +1166,7 @@ PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn_handle, if (!conn_handle) { self_alloced = TRUE; - if (!(conn_handle = mysqlnd_init(client_api_flags, FALSE))) { + if (!(conn_handle = mysqlnd_connection_init(client_api_flags, FALSE))) { /* OOM */ DBG_RETURN(NULL); } @@ -3161,15 +3161,15 @@ MYSQLND_CLASS_METHODS_START(mysqlnd_conn) MYSQLND_CLASS_METHODS_END; -/* {{{ mysqlnd_init */ +/* {{{ mysqlnd_connection_init */ PHPAPI MYSQLND * -mysqlnd_init(unsigned int flags, zend_bool persistent) +mysqlnd_connection_init(unsigned int client_flags, zend_bool persistent) { MYSQLND * ret; - DBG_ENTER("mysqlnd_init"); + DBG_ENTER("mysqlnd_connection_init"); ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_connection(persistent); if (ret && ret->data) { - ret->data->m->negotiate_client_api_capabilities(ret->data, flags); + ret->data->m->negotiate_client_api_capabilities(ret->data, client_flags); } DBG_RETURN(ret); } diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h index 7e72f9690b..0fb13d57d9 100644 --- a/ext/mysqlnd/mysqlnd.h +++ b/ext/mysqlnd/mysqlnd.h @@ -83,18 +83,22 @@ PHPAPI const MYSQLND_CHARSET * mysqlnd_find_charset_name(const char * const char /* Connect */ -PHPAPI MYSQLND * mysqlnd_init(unsigned int client_flags, zend_bool persistent); -PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn, - const char * host, const char * user, - const char * passwd, unsigned int passwd_len, - const char * db, unsigned int db_len, - unsigned int port, - const char * socket_or_pipe, - unsigned int mysql_flags, - unsigned int client_api_flags - ); - -#define mysqlnd_change_user(conn, user, passwd, db, silent) ((conn)->data)->m->change_user((conn)->data, (user), (passwd), (db), (silent), strlen((passwd))) +#define mysqlnd_init(flags, persistent) mysqlnd_connection_init((flags), (persistent)) +#define mysqlnd_connect(conn, host, user, pass, pass_len, db, db_len, port, socket, mysql_flags, client_api_flags) \ + mysqlnd_connection_connect((conn), (host), (user), (pass), (pass_len), (db), (db_len), (port), (socket), (mysql_flags), (client_api_flags)) + +PHPAPI MYSQLND * mysqlnd_connection_init(unsigned int client_flags, zend_bool persistent); +PHPAPI MYSQLND * mysqlnd_connection_connect(MYSQLND * conn, + const char * host, const char * user, + const char * passwd, unsigned int passwd_len, + const char * db, unsigned int db_len, + unsigned int port, + const char * socket_or_pipe, + unsigned int mysql_flags, + unsigned int client_api_flags + ); + +#define mysqlnd_change_user(conn, user, passwd, db, silent) ((conn)->data)->m->change_user((conn)->data, (user), (passwd), (db), (silent), strlen((passwd))) #define mysqlnd_change_user_ex(conn, user, passwd, db, silent, passwd_len) ((conn)->data)->m->change_user((conn)->data, (user), (passwd), (db), (silent), (passwd_len)) PHPAPI void mysqlnd_debug(const char *mode); diff --git a/ext/mysqlnd/mysqlnd_libmysql_compat.h b/ext/mysqlnd/mysqlnd_libmysql_compat.h index 377cf37cc3..4685c2c673 100644 --- a/ext/mysqlnd/mysqlnd_libmysql_compat.h +++ b/ext/mysqlnd/mysqlnd_libmysql_compat.h @@ -59,7 +59,7 @@ #define mysql_field_count(r) mysqlnd_field_count((r)) #define mysql_field_seek(r,o) mysqlnd_field_seek((r), (o)) #define mysql_field_tell(r) mysqlnd_field_tell((r)) -#define mysql_init(a) mysqlnd_init((a)) +#define mysql_init(a) mysqlnd_connection_init((a), false) #define mysql_insert_id(r) mysqlnd_insert_id((r)) #define mysql_kill(r,n) mysqlnd_kill((r), (n)) #define mysql_list_dbs(c, wild) mysqlnd_list_dbs((c), (wild))