From: Nikita Popov Date: Fri, 14 Aug 2020 09:12:41 +0000 (+0200) Subject: Remove dummy aliases for mysqli constructors X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6570fc2cf8a3805a2f11f2cdb26f894e671aabbd;p=php Remove dummy aliases for mysqli constructors These are only available as methods. Directly declare them as such instead of aliasing to functions that don't actually exist. --- diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index 595c39fead..dd39349d14 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -977,13 +977,7 @@ ZEND_GET_MODULE(mysqli) #endif -/* {{{ mixed mysqli_stmt_construct() -constructor for statement object. -Parameters: - object -> mysqli_stmt_init - object, query -> mysqli_prepare -*/ -PHP_FUNCTION(mysqli_stmt_construct) +PHP_METHOD(mysqli_stmt, __construct) { MY_MYSQL *mysql; zval *mysql_link; @@ -1018,14 +1012,8 @@ PHP_FUNCTION(mysqli_stmt_construct) MYSQLI_REGISTER_RESOURCE_EX(mysqli_resource, getThis()); } -/* }}} */ -/* {{{ mixed mysqli_result_construct() -constructor for result object. -Parameters: - object [, mode] -> mysqli_store/use_result -*/ -PHP_FUNCTION(mysqli_result_construct) +PHP_METHOD(mysqli_result, __construct) { MY_MYSQL *mysql; MYSQL_RES *result = NULL; @@ -1071,7 +1059,6 @@ PHP_FUNCTION(mysqli_result_construct) MYSQLI_REGISTER_RESOURCE_EX(mysqli_resource, getThis()); } -/* }}} */ PHP_METHOD(mysqli_result, getIterator) { diff --git a/ext/mysqli/mysqli.stub.php b/ext/mysqli/mysqli.stub.php index 7f6bdf880b..940f3c4fcc 100644 --- a/ext/mysqli/mysqli.stub.php +++ b/ext/mysqli/mysqli.stub.php @@ -8,7 +8,6 @@ final class mysqli_driver class mysqli { - /** @alias mysqli_link_construct */ public function __construct( ?string $host = null, ?string $user = null, @@ -302,7 +301,6 @@ class mysqli class mysqli_result implements IteratorAggregate { - /** @alias mysqli_result_construct */ public function __construct(object $mysqli_link, int $resmode = MYSQLI_STORE_RESULT) {} /** @@ -390,7 +388,6 @@ class mysqli_result implements IteratorAggregate class mysqli_stmt { - /** @alias mysqli_stmt_construct */ public function __construct(mysqli $mysqli_link, ?string $statement = null) {} /** diff --git a/ext/mysqli/mysqli_arginfo.h b/ext/mysqli/mysqli_arginfo.h index 8f82ead3ed..7d7c69e943 100644 --- a/ext/mysqli/mysqli_arginfo.h +++ b/ext/mysqli/mysqli_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 9f7063a0495441cb184f15b895771a32e8ef3195 */ + * Stub hash: a8626c7c42e4d117b08df7f42a7523f60f357b82 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_affected_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING) ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) @@ -791,7 +791,7 @@ ZEND_FUNCTION(mysqli_thread_safe); ZEND_FUNCTION(mysqli_use_result); ZEND_FUNCTION(mysqli_warning_count); ZEND_FUNCTION(mysqli_refresh); -ZEND_FUNCTION(mysqli_link_construct); +ZEND_METHOD(mysqli, __construct); #if defined(MYSQLI_USE_MYSQLND) ZEND_FUNCTION(mysqli_get_connection_stats); #endif @@ -802,12 +802,12 @@ ZEND_FUNCTION(mysqli_poll); #if defined(MYSQLI_USE_MYSQLND) ZEND_FUNCTION(mysqli_reap_async_query); #endif -ZEND_FUNCTION(mysqli_result_construct); +ZEND_METHOD(mysqli_result, __construct); #if defined(MYSQLI_USE_MYSQLND) ZEND_FUNCTION(mysqli_fetch_all); #endif ZEND_METHOD(mysqli_result, getIterator); -ZEND_FUNCTION(mysqli_stmt_construct); +ZEND_METHOD(mysqli_stmt, __construct); #if defined(MYSQLI_USE_MYSQLND) ZEND_FUNCTION(mysqli_stmt_more_results); #endif @@ -936,7 +936,7 @@ static const zend_function_entry class_mysqli_driver_methods[] = { static const zend_function_entry class_mysqli_methods[] = { - ZEND_ME_MAPPING(__construct, mysqli_link_construct, arginfo_class_mysqli___construct, ZEND_ACC_PUBLIC) + ZEND_ME(mysqli, __construct, arginfo_class_mysqli___construct, ZEND_ACC_PUBLIC) ZEND_ME_MAPPING(autocommit, mysqli_autocommit, arginfo_class_mysqli_autocommit, ZEND_ACC_PUBLIC) ZEND_ME_MAPPING(begin_transaction, mysqli_begin_transaction, arginfo_class_mysqli_begin_transaction, ZEND_ACC_PUBLIC) ZEND_ME_MAPPING(change_user, mysqli_change_user, arginfo_class_mysqli_change_user, ZEND_ACC_PUBLIC) @@ -990,7 +990,7 @@ static const zend_function_entry class_mysqli_methods[] = { static const zend_function_entry class_mysqli_result_methods[] = { - ZEND_ME_MAPPING(__construct, mysqli_result_construct, arginfo_class_mysqli_result___construct, ZEND_ACC_PUBLIC) + ZEND_ME(mysqli_result, __construct, arginfo_class_mysqli_result___construct, ZEND_ACC_PUBLIC) ZEND_ME_MAPPING(close, mysqli_free_result, arginfo_class_mysqli_result_close, ZEND_ACC_PUBLIC) ZEND_ME_MAPPING(free, mysqli_free_result, arginfo_class_mysqli_result_free, ZEND_ACC_PUBLIC) ZEND_ME_MAPPING(data_seek, mysqli_data_seek, arginfo_class_mysqli_result_data_seek, ZEND_ACC_PUBLIC) @@ -1012,7 +1012,7 @@ static const zend_function_entry class_mysqli_result_methods[] = { static const zend_function_entry class_mysqli_stmt_methods[] = { - ZEND_ME_MAPPING(__construct, mysqli_stmt_construct, arginfo_class_mysqli_stmt___construct, ZEND_ACC_PUBLIC) + ZEND_ME(mysqli_stmt, __construct, arginfo_class_mysqli_stmt___construct, ZEND_ACC_PUBLIC) ZEND_ME_MAPPING(attr_get, mysqli_stmt_attr_get, arginfo_class_mysqli_stmt_attr_get, ZEND_ACC_PUBLIC) ZEND_ME_MAPPING(attr_set, mysqli_stmt_attr_set, arginfo_class_mysqli_stmt_attr_set, ZEND_ACC_PUBLIC) ZEND_ME_MAPPING(bind_param, mysqli_stmt_bind_param, arginfo_class_mysqli_stmt_bind_param, ZEND_ACC_PUBLIC) diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 5dc16b9552..9b675bb526 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -376,12 +376,10 @@ PHP_FUNCTION(mysqli_connect) } /* }}} */ -/* {{{ */ -PHP_FUNCTION(mysqli_link_construct) +PHP_METHOD(mysqli, __construct) { mysqli_common_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, FALSE, TRUE); } -/* }}} */ /* {{{ Returns the numerical value of the error message from last connect command */ PHP_FUNCTION(mysqli_connect_errno)