Skip to content

Commit 7be0e06

Browse files
committed
Remove mysqli embedded server support
This code is not compatible with PHP 7.0. The fact that nobody complained that the mysqli embedded server functionality doesn't build anymore seems like a strong signal that we can drop it...
1 parent a5e9861 commit 7be0e06

File tree

7 files changed

+6
-158
lines changed

7 files changed

+6
-158
lines changed

UPGRADING

+4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ PHP 7.4 UPGRADE NOTES
4040
. The default parameter value of idn_to_ascii() and idn_to_utf8() is now
4141
INTL_IDNA_VARIANT_UTS46 instead of the deprecated INTL_IDNA_VARIANT_2003.
4242

43+
- MySQLi:
44+
. The embedded server functionality has been removed. It was broken since
45+
at least PHP 7.0.
46+
4347
- Openssl:
4448
. The openssl_random_pseudo_bytes() function will now throw an exception in
4549
error situations, similar to random_bytes(). In particular, an Error is

ext/mysqli/config.m4

+2-12
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ PHP_ARG_WITH(mysqli, for MySQLi support,
3232
to mysql_config. If no value or mysqlnd is passed
3333
as FILE, the MySQL native driver will be used])
3434

35-
PHP_ARG_ENABLE(embedded_mysqli, whether to enable embedded MySQLi support,
36-
[ --enable-embedded-mysqli
37-
MYSQLi: Enable embedded support
38-
Note: Does not work with MySQL native driver!], no, no)
39-
4035
dnl ext/pdo_mysql/config.m4 also depends on this configure option.
4136
PHP_ARG_WITH(mysql-sock, for specified location of the MySQL UNIX socket,
4237
[ --with-mysql-sock[=SOCKPATH]
@@ -52,12 +47,7 @@ elif test "$PHP_MYSQLI" != "no"; then
5247
MYSQL_CONFIG=$PHP_MYSQLI
5348

5449
MYSQL_LIB_NAME='mysqlclient'
55-
if test "$PHP_EMBEDDED_MYSQLI" = "yes"; then
56-
AC_DEFINE(HAVE_EMBEDDED_MYSQLI, 1, [embedded MySQL support enabled])
57-
MYSQL_LIB_CFG='--libmysqld-libs'
58-
dnl mysqlnd doesn't support embedded, so we have to add some extra stuff
59-
mysqli_extra_sources="mysqli_embedded.c"
60-
elif test "$enable_maintainer_zts" = "yes"; then
50+
if test "$enable_maintainer_zts" = "yes"; then
6151
MYSQL_LIB_CFG='--libs_r'
6252
MYSQL_LIB_NAME='mysqlclient_r'
6353
else
@@ -116,7 +106,7 @@ if test "$PHP_MYSQLI" != "no"; then
116106

117107
mysqli_sources="mysqli.c mysqli_api.c mysqli_prop.c mysqli_nonapi.c \
118108
mysqli_fe.c mysqli_report.c mysqli_driver.c mysqli_warning.c \
119-
mysqli_exception.c mysqli_result_iterator.c $mysqli_extra_sources"
109+
mysqli_exception.c mysqli_result_iterator.c"
120110
PHP_NEW_EXTENSION(mysqli, $mysqli_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
121111
PHP_SUBST(MYSQLI_SHARED_LIBADD)
122112
PHP_INSTALL_HEADERS([ext/mysqli/php_mysqli_structs.h])

ext/mysqli/mysqli.c

-4
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,7 @@ static PHP_GINIT_FUNCTION(mysqli)
546546
mysqli_globals->report_mode = 0;
547547
mysqli_globals->report_ht = 0;
548548
mysqli_globals->allow_local_infile = 0;
549-
#ifdef HAVE_EMBEDDED_MYSQLI
550-
mysqli_globals->embedded = 1;
551-
#else
552549
mysqli_globals->embedded = 0;
553-
#endif
554550
mysqli_globals->rollback_on_cached_plink = FALSE;
555551
}
556552
/* }}} */

ext/mysqli/mysqli_driver.c

-8
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,7 @@ static int driver_report_write(mysqli_object *obj, zval *value)
8484
/* {{{ property driver_embedded_read */
8585
static zval *driver_embedded_read(mysqli_object *obj, zval *retval)
8686
{
87-
#ifdef HAVE_EMBEDDED_MYSQLI
88-
ZVAL_TRUE(retval);
89-
#else
9087
ZVAL_FALSE(retval);
91-
#endif
9288
return retval;
9389
}
9490
/* }}} */
@@ -146,10 +142,6 @@ const mysqli_property_entry mysqli_driver_property_entries[] = {
146142
/* {{{ mysqli_driver_methods[]
147143
*/
148144
const zend_function_entry mysqli_driver_methods[] = {
149-
#if defined(HAVE_EMBEDDED_MYSQLI)
150-
PHP_FALIAS(embedded_server_start, mysqli_embedded_server_start, NULL)
151-
PHP_FALIAS(embedded_server_end, mysqli_embedded_server_end, NULL)
152-
#endif
153145
PHP_FE_END
154146
};
155147
/* }}} */

ext/mysqli/mysqli_embedded.c

-121
This file was deleted.

ext/mysqli/mysqli_fe.c

-4
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,6 @@ const zend_function_entry mysqli_functions[] = {
420420
PHP_FE(mysqli_data_seek, arginfo_mysqli_data_seek)
421421
PHP_FE(mysqli_dump_debug_info, arginfo_mysqli_only_link)
422422
PHP_FE(mysqli_debug, arginfo_mysqli_debug)
423-
#if defined(HAVE_EMBEDDED_MYSQLI)
424-
PHP_FE(mysqli_embedded_server_end, NULL)
425-
PHP_FE(mysqli_embedded_server_start, NULL)
426-
#endif
427423
PHP_FE(mysqli_errno, arginfo_mysqli_only_link)
428424
PHP_FE(mysqli_error, arginfo_mysqli_only_link)
429425
PHP_FE(mysqli_error_list, arginfo_mysqli_only_link)

ext/mysqli/mysqli_nonapi.c

-9
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,6 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
219219
new_connection = TRUE;
220220
}
221221

222-
#ifdef HAVE_EMBEDDED_MYSQLI
223-
if (hostname_len) {
224-
unsigned int external=1;
225-
mysql_options(mysql->mysql, MYSQL_OPT_USE_REMOTE_CONNECTION, (char *)&external);
226-
} else {
227-
mysql_options(mysql->mysql, MYSQL_OPT_USE_EMBEDDED_CONNECTION, 0);
228-
}
229-
#endif
230-
231222
#if !defined(MYSQLI_USE_MYSQLND)
232223
/* BC for prior to bug fix #53425 */
233224
flags |= CLIENT_MULTI_RESULTS;

0 commit comments

Comments
 (0)