diff options
-rw-r--r-- | UPGRADING | 4 | ||||
-rw-r--r-- | ext/mysqli/config.m4 | 14 | ||||
-rw-r--r-- | ext/mysqli/mysqli.c | 4 | ||||
-rw-r--r-- | ext/mysqli/mysqli_driver.c | 8 | ||||
-rw-r--r-- | ext/mysqli/mysqli_embedded.c | 121 | ||||
-rw-r--r-- | ext/mysqli/mysqli_fe.c | 4 | ||||
-rw-r--r-- | ext/mysqli/mysqli_nonapi.c | 9 |
7 files changed, 6 insertions, 158 deletions
@@ -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 diff --git a/ext/mysqli/config.m4 b/ext/mysqli/config.m4 index 38a130f4cd..095a52f29f 100644 --- a/ext/mysqli/config.m4 +++ b/ext/mysqli/config.m4 @@ -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] @@ -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 @@ -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]) diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index b4a8b27fa4..394a838512 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -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; } /* }}} */ diff --git a/ext/mysqli/mysqli_driver.c b/ext/mysqli/mysqli_driver.c index 5839c14827..7df2eca11b 100644 --- a/ext/mysqli/mysqli_driver.c +++ b/ext/mysqli/mysqli_driver.c @@ -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; } /* }}} */ @@ -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 }; /* }}} */ diff --git a/ext/mysqli/mysqli_embedded.c b/ext/mysqli/mysqli_embedded.c deleted file mode 100644 index efc9a55852..0000000000 --- a/ext/mysqli/mysqli_embedded.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ - | Copyright (c) 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: Georg Richter <georg@php.net> | - +----------------------------------------------------------------------+ - -*/ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <signal.h> - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_mysqli_structs.h" - -/* {{{ proto bool mysqli_embedded_server_start(bool start, array arguments, array groups) - initialize and start embedded server */ -PHP_FUNCTION(mysqli_embedded_server_start) -{ -#ifdef HAVE_EMBEDDED_MYSQLI - zend_long start; - zval *args; - zval *grps; - - int argc = 0; - char **arguments; - char **groups; - HashPosition pos; - int index, rc; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "laa", &start, &args, &grps) == FAILURE) { - return; - } - - if (!start) { - mysql_server_init(-1,NULL, NULL); - RETURN_TRUE; - } - /* get arguments */ - if ((argc = zend_hash_num_elements(Z_ARRVAL_P(args)))) { - arguments = safe_emalloc(sizeof(char *), argc + 1, 0); - arguments[0] = NULL; - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(args), &pos); - - for (index = 0;; zend_hash_move_forward_ex(Z_ARRVAL_P(args), &pos)) { - zval **item; - - if (zend_hash_get_current_data_ex(Z_ARRVAL_P(args), (void **) &item, &pos) == FAILURE) { - break; - } - - convert_to_string_ex(item); - - arguments[++index] = Z_STRVAL_PP(item); - } - argc++; - } - - /* get groups */ - if ((zend_hash_num_elements(Z_ARRVAL_P(grps)))) { - groups = safe_emalloc(sizeof(char *), zend_hash_num_elements(Z_ARRVAL_P(grps)) + 1, 0); - groups[0] = NULL; - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(grps), &pos); - - for (index = 0;; zend_hash_move_forward_ex(Z_ARRVAL_P(grps), &pos)) { - zval ** item; - - if (zend_hash_get_current_data_ex(Z_ARRVAL_P(grps), (void **) &item, &pos) == FAILURE) { - break; - } - - convert_to_string_ex(item); - - groups[++index] = Z_STRVAL_PP(item); - } - groups[index] = NULL; - } else { - groups = safe_emalloc(sizeof(char *), 1, 0); - groups[0] = NULL; - } - - rc = mysql_server_init(argc, arguments, groups); - - if (argc) { - efree(arguments); - } - efree(groups); - - if (rc) { - RETURN_FALSE; - } - RETURN_TRUE; -#endif -} -/* }}} */ - -/* {{{ proto void mysqli_embedded_server_end(void) -*/ -PHP_FUNCTION(mysqli_embedded_server_end) -{ -#ifdef HAVE_MYSQLI_EMBEDDED - mysql_server_end(); -#endif -} -/* }}} */ diff --git a/ext/mysqli/mysqli_fe.c b/ext/mysqli/mysqli_fe.c index 68c79c88dc..f17f009830 100644 --- a/ext/mysqli/mysqli_fe.c +++ b/ext/mysqli/mysqli_fe.c @@ -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) diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index a69fb63d6a..78302a7e6f 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -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; |