- rename mysqlnd_init to mysqlnd_connection_init
- rename mysqlnd_connect to mysqlnd_connection_connect
- created macros for BC
This commit is contained in:
Andrey Hristov 2015-10-02 15:47:43 +02:00
parent 34a33928d6
commit 2ea4891e75
3 changed files with 29 additions and 25 deletions

View 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);
}

View 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_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))
#define mysqlnd_change_user(conn, user, passwd, db, silent) ((conn)->data)->m->change_user((conn)->data, (user), (passwd), (db), (silent), strlen((passwd)))
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);

View 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))