9 changed files with 200 additions and 156 deletions
-
2ext/mysql/php_mysql.c
-
115ext/mysql/php_mysql.h
-
151ext/mysql/php_mysql_structs.h
-
36ext/mysqlnd/config.w32
-
21ext/mysqlnd/mysqlnd_debug.c
-
14ext/mysqlnd/mysqlnd_debug.h
-
6ext/mysqlnd/mysqlnd_palloc.c
-
1ext/mysqlnd/mysqlnd_portability.h
-
10ext/mysqlnd/mysqlnd_priv.h
@ -0,0 +1,151 @@ |
|||
/* |
|||
+----------------------------------------------------------------------+ |
|||
| PHP Version 5 | |
|||
+----------------------------------------------------------------------+ |
|||
| Copyright (c) 1997-2007 The PHP Group | |
|||
+----------------------------------------------------------------------+ |
|||
| This source file is subject to version 3.01 of the PHP license, | |
|||
| that is bundled with this package in the file LICENSE, and is | |
|||
| available through the world-wide-web at the following url: | |
|||
| http://www.php.net/license/3_01.txt | |
|||
| If you did not receive a copy of the PHP license and are unable to | |
|||
| obtain it through the world-wide-web, please send a note to | |
|||
| license@php.net so we can mail you a copy immediately. | |
|||
+----------------------------------------------------------------------+ |
|||
| Author: Zeev Suraski <zeev@zend.com> | |
|||
| Andrey Hristov <andrey@php.net> | |
|||
+----------------------------------------------------------------------+ |
|||
*/ |
|||
|
|||
/* $Id$ */ |
|||
|
|||
#ifndef PHP_MYSQL_STRUCTS_H |
|||
#define PHP_MYSQL_STRUCTS_H |
|||
|
|||
#ifdef PHP_WIN32 |
|||
#define PHP_MYSQL_API __declspec(dllexport) |
|||
#else |
|||
#define PHP_MYSQL_API |
|||
#endif |
|||
|
|||
#if HAVE_MYSQL |
|||
|
|||
#ifdef ZTS |
|||
#include "TSRM.h" |
|||
#endif |
|||
|
|||
#ifndef TRUE |
|||
#define TRUE 1 |
|||
#endif |
|||
|
|||
#ifndef FALSE |
|||
#define FALSE 0 |
|||
#endif |
|||
|
|||
#if defined(HAVE_MYSQLND) |
|||
#include "ext/mysqlnd/mysqlnd.h" |
|||
#include "ext/mysql/mysql_mysqlnd.h" |
|||
#else |
|||
#include <mysql.h> |
|||
#endif |
|||
|
|||
#if (MYSQL_VERSION_ID >= 40113 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID >= 50007 || HAVE_MYSQLND |
|||
#define MYSQL_HAS_SET_CHARSET |
|||
#endif |
|||
|
|||
extern zend_module_entry mysql_module_entry; |
|||
|
|||
#define mysql_module_ptr &mysql_module_entry |
|||
|
|||
PHP_MINIT_FUNCTION(mysql); |
|||
PHP_RINIT_FUNCTION(mysql); |
|||
PHP_MSHUTDOWN_FUNCTION(mysql); |
|||
PHP_RSHUTDOWN_FUNCTION(mysql); |
|||
PHP_MINFO_FUNCTION(mysql); |
|||
|
|||
PHP_FUNCTION(mysql_connect); |
|||
PHP_FUNCTION(mysql_pconnect); |
|||
PHP_FUNCTION(mysql_close); |
|||
PHP_FUNCTION(mysql_select_db); |
|||
#if MYSQL_VERSION_ID < 40000 |
|||
PHP_FUNCTION(mysql_create_db); |
|||
PHP_FUNCTION(mysql_drop_db); |
|||
#endif |
|||
PHP_FUNCTION(mysql_query); |
|||
PHP_FUNCTION(mysql_unbuffered_query); |
|||
PHP_FUNCTION(mysql_db_query); |
|||
PHP_FUNCTION(mysql_list_dbs); |
|||
PHP_FUNCTION(mysql_list_tables); |
|||
PHP_FUNCTION(mysql_list_fields); |
|||
PHP_FUNCTION(mysql_list_processes); |
|||
PHP_FUNCTION(mysql_error); |
|||
PHP_FUNCTION(mysql_errno); |
|||
PHP_FUNCTION(mysql_affected_rows); |
|||
PHP_FUNCTION(mysql_insert_id); |
|||
PHP_FUNCTION(mysql_result); |
|||
PHP_FUNCTION(mysql_num_rows); |
|||
PHP_FUNCTION(mysql_num_fields); |
|||
PHP_FUNCTION(mysql_fetch_row); |
|||
PHP_FUNCTION(mysql_fetch_array); |
|||
PHP_FUNCTION(mysql_fetch_assoc); |
|||
PHP_FUNCTION(mysql_fetch_object); |
|||
PHP_FUNCTION(mysql_data_seek); |
|||
PHP_FUNCTION(mysql_fetch_lengths); |
|||
PHP_FUNCTION(mysql_fetch_field); |
|||
PHP_FUNCTION(mysql_field_seek); |
|||
PHP_FUNCTION(mysql_free_result); |
|||
PHP_FUNCTION(mysql_field_name); |
|||
PHP_FUNCTION(mysql_field_table); |
|||
PHP_FUNCTION(mysql_field_len); |
|||
PHP_FUNCTION(mysql_field_type); |
|||
PHP_FUNCTION(mysql_field_flags); |
|||
PHP_FUNCTION(mysql_escape_string); |
|||
PHP_FUNCTION(mysql_real_escape_string); |
|||
PHP_FUNCTION(mysql_get_client_info); |
|||
PHP_FUNCTION(mysql_get_host_info); |
|||
PHP_FUNCTION(mysql_get_proto_info); |
|||
PHP_FUNCTION(mysql_get_server_info); |
|||
PHP_FUNCTION(mysql_info); |
|||
PHP_FUNCTION(mysql_stat); |
|||
PHP_FUNCTION(mysql_thread_id); |
|||
PHP_FUNCTION(mysql_client_encoding); |
|||
PHP_FUNCTION(mysql_ping); |
|||
PHP_FUNCTION(mysql_set_charset); |
|||
|
|||
ZEND_BEGIN_MODULE_GLOBALS(mysql) |
|||
long default_link; |
|||
long num_links,num_persistent; |
|||
long max_links,max_persistent; |
|||
long allow_persistent; |
|||
long default_port; |
|||
char *default_host, *default_user, *default_password; |
|||
char *default_socket; |
|||
char *connect_error; |
|||
long connect_errno; |
|||
long connect_timeout; |
|||
long result_allocated; |
|||
long trace_mode; |
|||
long allow_local_infile; |
|||
#ifdef HAVE_MYSQLND |
|||
MYSQLND_THD_ZVAL_PCACHE *mysqlnd_thd_zval_cache; |
|||
MYSQLND_QCACHE *mysqlnd_qcache; |
|||
long cache_size; |
|||
#endif |
|||
ZEND_END_MODULE_GLOBALS(mysql) |
|||
|
|||
#ifdef ZTS |
|||
# define MySG(v) TSRMG(mysql_globals_id, zend_mysql_globals *, v) |
|||
#else |
|||
# define MySG(v) (mysql_globals.v) |
|||
#endif |
|||
|
|||
|
|||
#else |
|||
|
|||
#define mysql_module_ptr NULL |
|||
|
|||
#endif |
|||
|
|||
#define phpext_mysql_ptr mysql_module_ptr |
|||
|
|||
#endif /* PHP_MYSQL_STRUCTS_H */ |
|||
@ -1,26 +1,20 @@ |
|||
// $Id$ |
|||
// vim:ft=javascript |
|||
|
|||
ARG_WITH("mysqli", "MySQLi support", "no"); |
|||
ARG_ENABLE("mysqlnd", "MySQLi with mysqlnd support", "no"); |
|||
|
|||
if (PHP_MYSQLI == "mysqlnd" || PHP_MYSQL == "mysqlnd") { |
|||
mysqld_source = ""; |
|||
if (CHECK_LIB("ws2_32.lib", "mysqlnd")) { |
|||
mysqlnd_source = |
|||
"mysqlnd.c " + |
|||
"mysqlnd_debug.c " + |
|||
"mysqlnd_charset.c " + |
|||
"mysqlnd_loaddata.c " + |
|||
"mysqlnd_palloc.c " + |
|||
"mysqlnd_ps.c " + |
|||
"mysqlnd_ps_codec.c " + |
|||
"mysqlnd_qcache.c " + |
|||
"mysqlnd_result.c " + |
|||
"mysqlnd_result_meta.c " + |
|||
"mysqlnd_statistics.c " + |
|||
"mysqlnd_wireprotocol.c"; |
|||
if (CHECK_LIB("ws2_32.lib", "mysqlnd")) { |
|||
EXTENSION("mysqlnd", mysqlnd_source); |
|||
AC_DEFINE('HAVE_MYSQLND', 1, 'MySQL native driver support enabled'); |
|||
} |
|||
"mysqlnd.c " + |
|||
"mysqlnd_debug.c " + |
|||
"mysqlnd_charset.c " + |
|||
"mysqlnd_loaddata.c " + |
|||
"mysqlnd_palloc.c " + |
|||
"mysqlnd_ps.c " + |
|||
"mysqlnd_ps_codec.c " + |
|||
"mysqlnd_qcache.c " + |
|||
"mysqlnd_result.c " + |
|||
"mysqlnd_result_meta.c " + |
|||
"mysqlnd_statistics.c " + |
|||
"mysqlnd_wireprotocol.c"; |
|||
EXTENSION("mysqlnd", mysqlnd_source, false); |
|||
} |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue