Skip to content

Commit

Permalink
Remove mysqli embedded server support
Browse files Browse the repository at this point in the history
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...
  • Loading branch information
nikic committed Feb 28, 2019
1 parent a5e9861 commit 7be0e06
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 158 deletions.
4 changes: 4 additions & 0 deletions UPGRADING
Expand Up @@ -40,6 +40,10 @@ PHP 7.4 UPGRADE NOTES
. The default parameter value of idn_to_ascii() and idn_to_utf8() is now
INTL_IDNA_VARIANT_UTS46 instead of the deprecated INTL_IDNA_VARIANT_2003.

- MySQLi:
. The embedded server functionality has been removed. It was broken since
at least PHP 7.0.

- Openssl:
. The openssl_random_pseudo_bytes() function will now throw an exception in
error situations, similar to random_bytes(). In particular, an Error is
Expand Down
14 changes: 2 additions & 12 deletions ext/mysqli/config.m4
Expand Up @@ -32,11 +32,6 @@ PHP_ARG_WITH(mysqli, for MySQLi support,
to mysql_config. If no value or mysqlnd is passed
as FILE, the MySQL native driver will be used])

PHP_ARG_ENABLE(embedded_mysqli, whether to enable embedded MySQLi support,
[ --enable-embedded-mysqli
MYSQLi: Enable embedded support
Note: Does not work with MySQL native driver!], no, no)

dnl ext/pdo_mysql/config.m4 also depends on this configure option.
PHP_ARG_WITH(mysql-sock, for specified location of the MySQL UNIX socket,
[ --with-mysql-sock[=SOCKPATH]
Expand All @@ -52,12 +47,7 @@ elif test "$PHP_MYSQLI" != "no"; then
MYSQL_CONFIG=$PHP_MYSQLI

MYSQL_LIB_NAME='mysqlclient'
if test "$PHP_EMBEDDED_MYSQLI" = "yes"; then
AC_DEFINE(HAVE_EMBEDDED_MYSQLI, 1, [embedded MySQL support enabled])
MYSQL_LIB_CFG='--libmysqld-libs'
dnl mysqlnd doesn't support embedded, so we have to add some extra stuff
mysqli_extra_sources="mysqli_embedded.c"
elif test "$enable_maintainer_zts" = "yes"; then
if test "$enable_maintainer_zts" = "yes"; then
MYSQL_LIB_CFG='--libs_r'
MYSQL_LIB_NAME='mysqlclient_r'
else
Expand Down Expand Up @@ -116,7 +106,7 @@ if test "$PHP_MYSQLI" != "no"; then

mysqli_sources="mysqli.c mysqli_api.c mysqli_prop.c mysqli_nonapi.c \
mysqli_fe.c mysqli_report.c mysqli_driver.c mysqli_warning.c \
mysqli_exception.c mysqli_result_iterator.c $mysqli_extra_sources"
mysqli_exception.c mysqli_result_iterator.c"
PHP_NEW_EXTENSION(mysqli, $mysqli_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(MYSQLI_SHARED_LIBADD)
PHP_INSTALL_HEADERS([ext/mysqli/php_mysqli_structs.h])
Expand Down
4 changes: 0 additions & 4 deletions ext/mysqli/mysqli.c
Expand Up @@ -546,11 +546,7 @@ static PHP_GINIT_FUNCTION(mysqli)
mysqli_globals->report_mode = 0;
mysqli_globals->report_ht = 0;
mysqli_globals->allow_local_infile = 0;
#ifdef HAVE_EMBEDDED_MYSQLI
mysqli_globals->embedded = 1;
#else
mysqli_globals->embedded = 0;
#endif
mysqli_globals->rollback_on_cached_plink = FALSE;
}
/* }}} */
Expand Down
8 changes: 0 additions & 8 deletions ext/mysqli/mysqli_driver.c
Expand Up @@ -84,11 +84,7 @@ static int driver_report_write(mysqli_object *obj, zval *value)
/* {{{ property driver_embedded_read */
static zval *driver_embedded_read(mysqli_object *obj, zval *retval)
{
#ifdef HAVE_EMBEDDED_MYSQLI
ZVAL_TRUE(retval);
#else
ZVAL_FALSE(retval);
#endif
return retval;
}
/* }}} */
Expand Down Expand Up @@ -146,10 +142,6 @@ const mysqli_property_entry mysqli_driver_property_entries[] = {
/* {{{ mysqli_driver_methods[]
*/
const zend_function_entry mysqli_driver_methods[] = {
#if defined(HAVE_EMBEDDED_MYSQLI)
PHP_FALIAS(embedded_server_start, mysqli_embedded_server_start, NULL)
PHP_FALIAS(embedded_server_end, mysqli_embedded_server_end, NULL)
#endif
PHP_FE_END
};
/* }}} */
121 changes: 0 additions & 121 deletions ext/mysqli/mysqli_embedded.c

This file was deleted.

4 changes: 0 additions & 4 deletions ext/mysqli/mysqli_fe.c
Expand Up @@ -420,10 +420,6 @@ const zend_function_entry mysqli_functions[] = {
PHP_FE(mysqli_data_seek, arginfo_mysqli_data_seek)
PHP_FE(mysqli_dump_debug_info, arginfo_mysqli_only_link)
PHP_FE(mysqli_debug, arginfo_mysqli_debug)
#if defined(HAVE_EMBEDDED_MYSQLI)
PHP_FE(mysqli_embedded_server_end, NULL)
PHP_FE(mysqli_embedded_server_start, NULL)
#endif
PHP_FE(mysqli_errno, arginfo_mysqli_only_link)
PHP_FE(mysqli_error, arginfo_mysqli_only_link)
PHP_FE(mysqli_error_list, arginfo_mysqli_only_link)
Expand Down
9 changes: 0 additions & 9 deletions ext/mysqli/mysqli_nonapi.c
Expand Up @@ -219,15 +219,6 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
new_connection = TRUE;
}

#ifdef HAVE_EMBEDDED_MYSQLI
if (hostname_len) {
unsigned int external=1;
mysql_options(mysql->mysql, MYSQL_OPT_USE_REMOTE_CONNECTION, (char *)&external);
} else {
mysql_options(mysql->mysql, MYSQL_OPT_USE_EMBEDDED_CONNECTION, 0);
}
#endif

#if !defined(MYSQLI_USE_MYSQLND)
/* BC for prior to bug fix #53425 */
flags |= CLIENT_MULTI_RESULTS;
Expand Down

1 comment on commit 7be0e06

@staabm
Copy link
Contributor

@staabm staabm commented on 7be0e06 Feb 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh wow, never heard such a feature existed.

I guess it would have made things easier in some cases, but seems not been known/adopted enough tonbe worthwhile

Please sign in to comment.