Skip to content

Commit 6570fc2

Browse files
committed
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.
1 parent 0753968 commit 6570fc2

File tree

4 files changed

+10
-28
lines changed

4 files changed

+10
-28
lines changed

ext/mysqli/mysqli.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -977,13 +977,7 @@ ZEND_GET_MODULE(mysqli)
977977
#endif
978978

979979

980-
/* {{{ mixed mysqli_stmt_construct()
981-
constructor for statement object.
982-
Parameters:
983-
object -> mysqli_stmt_init
984-
object, query -> mysqli_prepare
985-
*/
986-
PHP_FUNCTION(mysqli_stmt_construct)
980+
PHP_METHOD(mysqli_stmt, __construct)
987981
{
988982
MY_MYSQL *mysql;
989983
zval *mysql_link;
@@ -1018,14 +1012,8 @@ PHP_FUNCTION(mysqli_stmt_construct)
10181012

10191013
MYSQLI_REGISTER_RESOURCE_EX(mysqli_resource, getThis());
10201014
}
1021-
/* }}} */
10221015

1023-
/* {{{ mixed mysqli_result_construct()
1024-
constructor for result object.
1025-
Parameters:
1026-
object [, mode] -> mysqli_store/use_result
1027-
*/
1028-
PHP_FUNCTION(mysqli_result_construct)
1016+
PHP_METHOD(mysqli_result, __construct)
10291017
{
10301018
MY_MYSQL *mysql;
10311019
MYSQL_RES *result = NULL;
@@ -1071,7 +1059,6 @@ PHP_FUNCTION(mysqli_result_construct)
10711059

10721060
MYSQLI_REGISTER_RESOURCE_EX(mysqli_resource, getThis());
10731061
}
1074-
/* }}} */
10751062

10761063
PHP_METHOD(mysqli_result, getIterator)
10771064
{

ext/mysqli/mysqli.stub.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ final class mysqli_driver
88

99
class mysqli
1010
{
11-
/** @alias mysqli_link_construct */
1211
public function __construct(
1312
?string $host = null,
1413
?string $user = null,
@@ -302,7 +301,6 @@ public function refresh(int $options) {}
302301

303302
class mysqli_result implements IteratorAggregate
304303
{
305-
/** @alias mysqli_result_construct */
306304
public function __construct(object $mysqli_link, int $resmode = MYSQLI_STORE_RESULT) {}
307305

308306
/**
@@ -390,7 +388,6 @@ public function getIterator(): Iterator;
390388

391389
class mysqli_stmt
392390
{
393-
/** @alias mysqli_stmt_construct */
394391
public function __construct(mysqli $mysqli_link, ?string $statement = null) {}
395392

396393
/**

ext/mysqli/mysqli_arginfo.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 9f7063a0495441cb184f15b895771a32e8ef3195 */
2+
* Stub hash: a8626c7c42e4d117b08df7f42a7523f60f357b82 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_affected_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING)
55
ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0)
@@ -791,7 +791,7 @@ ZEND_FUNCTION(mysqli_thread_safe);
791791
ZEND_FUNCTION(mysqli_use_result);
792792
ZEND_FUNCTION(mysqli_warning_count);
793793
ZEND_FUNCTION(mysqli_refresh);
794-
ZEND_FUNCTION(mysqli_link_construct);
794+
ZEND_METHOD(mysqli, __construct);
795795
#if defined(MYSQLI_USE_MYSQLND)
796796
ZEND_FUNCTION(mysqli_get_connection_stats);
797797
#endif
@@ -802,12 +802,12 @@ ZEND_FUNCTION(mysqli_poll);
802802
#if defined(MYSQLI_USE_MYSQLND)
803803
ZEND_FUNCTION(mysqli_reap_async_query);
804804
#endif
805-
ZEND_FUNCTION(mysqli_result_construct);
805+
ZEND_METHOD(mysqli_result, __construct);
806806
#if defined(MYSQLI_USE_MYSQLND)
807807
ZEND_FUNCTION(mysqli_fetch_all);
808808
#endif
809809
ZEND_METHOD(mysqli_result, getIterator);
810-
ZEND_FUNCTION(mysqli_stmt_construct);
810+
ZEND_METHOD(mysqli_stmt, __construct);
811811
#if defined(MYSQLI_USE_MYSQLND)
812812
ZEND_FUNCTION(mysqli_stmt_more_results);
813813
#endif
@@ -936,7 +936,7 @@ static const zend_function_entry class_mysqli_driver_methods[] = {
936936

937937

938938
static const zend_function_entry class_mysqli_methods[] = {
939-
ZEND_ME_MAPPING(__construct, mysqli_link_construct, arginfo_class_mysqli___construct, ZEND_ACC_PUBLIC)
939+
ZEND_ME(mysqli, __construct, arginfo_class_mysqli___construct, ZEND_ACC_PUBLIC)
940940
ZEND_ME_MAPPING(autocommit, mysqli_autocommit, arginfo_class_mysqli_autocommit, ZEND_ACC_PUBLIC)
941941
ZEND_ME_MAPPING(begin_transaction, mysqli_begin_transaction, arginfo_class_mysqli_begin_transaction, ZEND_ACC_PUBLIC)
942942
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[] = {
990990

991991

992992
static const zend_function_entry class_mysqli_result_methods[] = {
993-
ZEND_ME_MAPPING(__construct, mysqli_result_construct, arginfo_class_mysqli_result___construct, ZEND_ACC_PUBLIC)
993+
ZEND_ME(mysqli_result, __construct, arginfo_class_mysqli_result___construct, ZEND_ACC_PUBLIC)
994994
ZEND_ME_MAPPING(close, mysqli_free_result, arginfo_class_mysqli_result_close, ZEND_ACC_PUBLIC)
995995
ZEND_ME_MAPPING(free, mysqli_free_result, arginfo_class_mysqli_result_free, ZEND_ACC_PUBLIC)
996996
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[] = {
10121012

10131013

10141014
static const zend_function_entry class_mysqli_stmt_methods[] = {
1015-
ZEND_ME_MAPPING(__construct, mysqli_stmt_construct, arginfo_class_mysqli_stmt___construct, ZEND_ACC_PUBLIC)
1015+
ZEND_ME(mysqli_stmt, __construct, arginfo_class_mysqli_stmt___construct, ZEND_ACC_PUBLIC)
10161016
ZEND_ME_MAPPING(attr_get, mysqli_stmt_attr_get, arginfo_class_mysqli_stmt_attr_get, ZEND_ACC_PUBLIC)
10171017
ZEND_ME_MAPPING(attr_set, mysqli_stmt_attr_set, arginfo_class_mysqli_stmt_attr_set, ZEND_ACC_PUBLIC)
10181018
ZEND_ME_MAPPING(bind_param, mysqli_stmt_bind_param, arginfo_class_mysqli_stmt_bind_param, ZEND_ACC_PUBLIC)

ext/mysqli/mysqli_nonapi.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,10 @@ PHP_FUNCTION(mysqli_connect)
376376
}
377377
/* }}} */
378378

379-
/* {{{ */
380-
PHP_FUNCTION(mysqli_link_construct)
379+
PHP_METHOD(mysqli, __construct)
381380
{
382381
mysqli_common_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, FALSE, TRUE);
383382
}
384-
/* }}} */
385383

386384
/* {{{ Returns the numerical value of the error message from last connect command */
387385
PHP_FUNCTION(mysqli_connect_errno)

0 commit comments

Comments
 (0)