]> granicus.if.org Git - php/commitdiff
MNDR:
authorAndrey Hristov <andrey@php.net>
Fri, 2 Oct 2015 13:47:43 +0000 (15:47 +0200)
committerAndrey Hristov <andrey@php.net>
Thu, 12 Nov 2015 15:19:16 +0000 (16:19 +0100)
- rename mysqlnd_init to mysqlnd_connection_init
- rename mysqlnd_connect to mysqlnd_connection_connect
- created macros for BC

ext/mysqlnd/mysqlnd.c
ext/mysqlnd/mysqlnd.h
ext/mysqlnd/mysqlnd_libmysql_compat.h

index eede5a5800a80510f7b8abf2524f6f0aaf388893..3ca8b1114b437a6b80164ff0aa134ff0d902ed93 100644 (file)
@@ -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);
 }
index 7e72f9690b1498a1bead7a637c33a831c0d2f655..0fb13d57d9e1037cad0ccfc59226f423b5ae6211 100644 (file)
@@ -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);
index 377cf37cc3f3fda24894556d0de80933a36bab20..4685c2c673926d430227bb734a10c5c95e95935c 100644 (file)
@@ -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))