Skip to content

Commit 7674c94

Browse files
committed
Compressed protocol support + extensibility for mysqlnd
1 parent 4e958fb commit 7674c94

15 files changed

+840
-353
lines changed

ext/mysqlnd/config.w32

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,10 @@ if (PHP_MYSQLND != "no") {
2121
"mysqlnd_wireprotocol.c " +
2222
"php_mysqlnd.c";
2323
EXTENSION("mysqlnd", mysqlnd_source, false);
24+
if (((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "mysqlnd", PHP_MYSQLND))) ||
25+
(PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "mysqlnd", PHP_MYSQLND)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED)))
26+
{
27+
AC_DEFINE("MYSQLND_COMPRESSION_ENABLED", 1, "Compression support");
28+
}
2429
}
25-
}
30+
}

ext/mysqlnd/config9.m4

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,21 @@ dnl
22
dnl $Id$
33
dnl config.m4 for mysqlnd driver
44

5+
56
PHP_ARG_ENABLE(mysqlnd_threading, whether to enable threaded fetch in mysqlnd,
67
[ --enable-mysqlnd-threading
78
EXPERIMENTAL: Enable mysqlnd threaded fetch.
89
Note: This forces ZTS on!], no, no)
910

11+
PHP_ARG_ENABLE(disable_mysqlnd_compression_support, whether to disable compressed protocol support in mysqlnd,
12+
[ --disable-mysqlnd-compression-support
13+
Enable support for the MySQL compressed protocol in mysqlnd], yes)
14+
15+
if test -z "$PHP_ZLIB_DIR"; then
16+
PHP_ARG_WITH(zlib-dir, for the location of libz,
17+
[ --with-zlib-dir[=DIR] mysqlnd: Set the path to libz install prefix], no, no)
18+
fi
19+
1020
dnl If some extension uses mysqlnd it will get compiled in PHP core
1121
if test "$PHP_MYSQLND_ENABLED" = "yes"; then
1222
mysqlnd_sources="mysqlnd.c mysqlnd_charset.c mysqlnd_wireprotocol.c \
@@ -23,6 +33,17 @@ if test "$PHP_MYSQLND_ENABLED" = "yes"; then
2333
PHP_BUILD_THREAD_SAFE
2434
AC_DEFINE([MYSQLND_THREADED], 1, [Use mysqlnd internal threading])
2535
fi
36+
37+
if test "$PHP_MYSQLND_COMPRESSION_SUPPORT" != "no"; then
38+
AC_DEFINE([MYSQLND_COMPRESSION_ENABLED], 1, [Enable compressed protocol support])
39+
if test "$PHP_ZLIB_DIR" != "no"; then
40+
PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR, MYSQLND_SHARED_LIBADD)
41+
MYSQLND_LIBS="$MYSQLND_LIBS -L$PHP_ZLIB_DIR/$PHP_LIBDIR -lz"
42+
else
43+
PHP_ADD_LIBRARY(z,, MYSQLND_SHARED_LIBADD)
44+
MYSQLND_LIBS="$MYSQLND_LIBS -lz"
45+
fi
46+
fi
2647
fi
2748

2849
if test "$PHP_MYSQLND_ENABLED" = "yes" || test "$PHP_MYSQLI" != "no"; then

0 commit comments

Comments
 (0)