Skip to content

Commit a730dc0

Browse files
committed
Generate class entries for snmp, soap, sockets, sodium, sqlite3, sysv*, tidy
Closes GH-6696
1 parent f01ad22 commit a730dc0

29 files changed

+263
-99
lines changed

ext/skeleton/skeleton.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
/** @generate-function-entries */
3+
/** @generate-class-entries */
44

55
function test1(): void {}
66

ext/skeleton/skeleton_arginfo.h

Lines changed: 2 additions & 1 deletion
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: 7eb3fd4083c98e6dffc8b02b6373b7ce9cbf228d */
2+
* Stub hash: efdd79c2c8ccff694699c86fdd6248a13839c744 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_test1, 0, 0, IS_VOID, 0)
55
ZEND_END_ARG_INFO()
@@ -18,3 +18,4 @@ static const zend_function_entry ext_functions[] = {
1818
ZEND_FE(test2, arginfo_test2)
1919
ZEND_FE_END
2020
};
21+

ext/snmp/snmp.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,7 +1959,6 @@ const php_snmp_prop_handler php_snmp_property_entries[] = {
19591959
PHP_MINIT_FUNCTION(snmp)
19601960
{
19611961
netsnmp_log_handler *logh;
1962-
zend_class_entry ce, cex;
19631962

19641963
init_snmp("snmpapp");
19651964
/* net-snmp corrupts the CTYPE locale during initialization. */
@@ -1985,12 +1984,11 @@ PHP_MINIT_FUNCTION(snmp)
19851984
php_snmp_object_handlers.get_gc = php_snmp_get_gc;
19861985

19871986
/* Register SNMP Class */
1988-
INIT_CLASS_ENTRY(ce, "SNMP", class_SNMP_methods);
1989-
ce.create_object = php_snmp_object_new;
1987+
php_snmp_ce = register_class_SNMP();
1988+
php_snmp_ce->create_object = php_snmp_object_new;
19901989
php_snmp_object_handlers.offset = XtOffsetOf(php_snmp_object, zo);
19911990
php_snmp_object_handlers.clone_obj = NULL;
19921991
php_snmp_object_handlers.free_obj = php_snmp_object_free_storage;
1993-
php_snmp_ce = zend_register_internal_class(&ce);
19941992

19951993
/* Register SNMP Class properties */
19961994
zend_hash_init(&php_snmp_properties, 0, NULL, free_php_snmp_properties, 1);
@@ -2035,8 +2033,7 @@ PHP_MINIT_FUNCTION(snmp)
20352033
REGISTER_SNMP_CLASS_CONST_LONG("ERRNO_MULTIPLE_SET_QUERIES", PHP_SNMP_ERRNO_MULTIPLE_SET_QUERIES);
20362034

20372035
/* Register SNMPException class */
2038-
INIT_CLASS_ENTRY(cex, "SNMPException", NULL);
2039-
php_snmp_exception_ce = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException);
2036+
php_snmp_exception_ce = register_class_SNMPException(spl_ce_RuntimeException);
20402037

20412038
return SUCCESS;
20422039
}

ext/snmp/snmp.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
/** @generate-function-entries */
3+
/** @generate-class-entries */
44

55
function snmpget(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): stdClass|array|string|bool {}
66

ext/snmp/snmp_arginfo.h

Lines changed: 22 additions & 1 deletion
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: 32433e63feea7cc46737000498e248da713ab5a3 */
2+
* Stub hash: 08192d87d2ac5d35092cfcf4a2cdcc50f7ec4ada */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_snmpget, 0, 3, stdClass, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_BOOL)
55
ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0)
@@ -241,3 +241,24 @@ static const zend_function_entry class_SNMP_methods[] = {
241241
static const zend_function_entry class_SNMPException_methods[] = {
242242
ZEND_FE_END
243243
};
244+
245+
zend_class_entry *register_class_SNMP()
246+
{
247+
zend_class_entry ce, *class_entry;
248+
249+
INIT_CLASS_ENTRY(ce, "SNMP", class_SNMP_methods);
250+
class_entry = zend_register_internal_class_ex(&ce, NULL);
251+
252+
return class_entry;
253+
}
254+
255+
zend_class_entry *register_class_SNMPException(zend_class_entry *class_entry_RuntimeException)
256+
{
257+
zend_class_entry ce, *class_entry;
258+
259+
INIT_CLASS_ENTRY(ce, "SNMPException", class_SNMPException_methods);
260+
class_entry = zend_register_internal_class_ex(&ce, class_entry_RuntimeException);
261+
262+
return class_entry;
263+
}
264+

ext/soap/soap.c

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,6 @@ ZEND_DECLARE_MODULE_GLOBALS(soap)
166166

167167
static void (*old_error_handler)(int, const char *, const uint32_t, zend_string *);
168168

169-
#define PHP_SOAP_SERVER_CLASSNAME "SoapServer"
170-
#define PHP_SOAP_CLIENT_CLASSNAME "SoapClient"
171-
#define PHP_SOAP_VAR_CLASSNAME "SoapVar"
172-
#define PHP_SOAP_FAULT_CLASSNAME "SoapFault"
173-
#define PHP_SOAP_PARAM_CLASSNAME "SoapParam"
174-
#define PHP_SOAP_HEADER_CLASSNAME "SoapHeader"
175-
176169
PHP_RINIT_FUNCTION(soap);
177170
PHP_MINIT_FUNCTION(soap);
178171
PHP_MSHUTDOWN_FUNCTION(soap);
@@ -361,39 +354,27 @@ static void delete_hashtable_res(zend_resource *res)
361354

362355
PHP_MINIT_FUNCTION(soap)
363356
{
364-
zend_class_entry ce;
365-
366357
/* TODO: add ini entry for always use soap errors */
367358
php_soap_prepare_globals();
368359
ZEND_INIT_MODULE_GLOBALS(soap, php_soap_init_globals, NULL);
369360
REGISTER_INI_ENTRIES();
370361

371362
/* Register SoapClient class */
372-
/* BIG NOTE : THIS EMITS AN COMPILATION WARNING UNDER ZE2 - handle_function_call deprecated.
373-
soap_call_function_handler should be of type zend_function, not (*handle_function_call).
374-
*/
375-
{
376-
INIT_CLASS_ENTRY(ce, PHP_SOAP_CLIENT_CLASSNAME, class_SoapClient_methods);
377-
soap_class_entry = zend_register_internal_class(&ce);
378-
}
363+
soap_class_entry = register_class_SoapClient();
364+
379365
/* Register SoapVar class */
380-
INIT_CLASS_ENTRY(ce, PHP_SOAP_VAR_CLASSNAME, class_SoapVar_methods);
381-
soap_var_class_entry = zend_register_internal_class(&ce);
366+
soap_var_class_entry = register_class_SoapVar();
382367

383368
/* Register SoapServer class */
384-
INIT_CLASS_ENTRY(ce, PHP_SOAP_SERVER_CLASSNAME, class_SoapServer_methods);
385-
soap_server_class_entry = zend_register_internal_class(&ce);
369+
soap_server_class_entry = register_class_SoapServer();
386370

387371
/* Register SoapFault class */
388-
INIT_CLASS_ENTRY(ce, PHP_SOAP_FAULT_CLASSNAME, class_SoapFault_methods);
389-
soap_fault_class_entry = zend_register_internal_class_ex(&ce, zend_ce_exception);
372+
soap_fault_class_entry = register_class_SoapFault(zend_ce_exception);
390373

391374
/* Register SoapParam class */
392-
INIT_CLASS_ENTRY(ce, PHP_SOAP_PARAM_CLASSNAME, class_SoapParam_methods);
393-
soap_param_class_entry = zend_register_internal_class(&ce);
375+
soap_param_class_entry = register_class_SoapParam();
394376

395-
INIT_CLASS_ENTRY(ce, PHP_SOAP_HEADER_CLASSNAME, class_SoapHeader_methods);
396-
soap_header_class_entry = zend_register_internal_class(&ce);
377+
soap_header_class_entry = register_class_SoapHeader();
397378

398379
le_sdl = zend_register_list_destructors_ex(delete_sdl_res, NULL, "SOAP SDL", module_number);
399380
le_url = zend_register_list_destructors_ex(delete_url_res, NULL, "SOAP URL", module_number);

ext/soap/soap.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
/** @generate-function-entries */
3+
/** @generate-class-entries */
44

55
function use_soap_error_handler(bool $enable = true): bool {}
66

ext/soap/soap_arginfo.h

Lines changed: 62 additions & 1 deletion
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: c0d32b2d8f3c39203b437a01dc79cd4e934dc9f7 */
2+
* Stub hash: b4f2354707bc7b992a3574f820edb329b16dd49e */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_use_soap_error_handler, 0, 0, _IS_BOOL, 0)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enable, _IS_BOOL, 0, "true")
@@ -230,3 +230,64 @@ static const zend_function_entry class_SoapClient_methods[] = {
230230
ZEND_ME(SoapClient, __setLocation, arginfo_class_SoapClient___setLocation, ZEND_ACC_PUBLIC)
231231
ZEND_FE_END
232232
};
233+
234+
zend_class_entry *register_class_SoapParam()
235+
{
236+
zend_class_entry ce, *class_entry;
237+
238+
INIT_CLASS_ENTRY(ce, "SoapParam", class_SoapParam_methods);
239+
class_entry = zend_register_internal_class_ex(&ce, NULL);
240+
241+
return class_entry;
242+
}
243+
244+
zend_class_entry *register_class_SoapHeader()
245+
{
246+
zend_class_entry ce, *class_entry;
247+
248+
INIT_CLASS_ENTRY(ce, "SoapHeader", class_SoapHeader_methods);
249+
class_entry = zend_register_internal_class_ex(&ce, NULL);
250+
251+
return class_entry;
252+
}
253+
254+
zend_class_entry *register_class_SoapFault(zend_class_entry *class_entry_Exception)
255+
{
256+
zend_class_entry ce, *class_entry;
257+
258+
INIT_CLASS_ENTRY(ce, "SoapFault", class_SoapFault_methods);
259+
class_entry = zend_register_internal_class_ex(&ce, class_entry_Exception);
260+
261+
return class_entry;
262+
}
263+
264+
zend_class_entry *register_class_SoapVar()
265+
{
266+
zend_class_entry ce, *class_entry;
267+
268+
INIT_CLASS_ENTRY(ce, "SoapVar", class_SoapVar_methods);
269+
class_entry = zend_register_internal_class_ex(&ce, NULL);
270+
271+
return class_entry;
272+
}
273+
274+
zend_class_entry *register_class_SoapServer()
275+
{
276+
zend_class_entry ce, *class_entry;
277+
278+
INIT_CLASS_ENTRY(ce, "SoapServer", class_SoapServer_methods);
279+
class_entry = zend_register_internal_class_ex(&ce, NULL);
280+
281+
return class_entry;
282+
}
283+
284+
zend_class_entry *register_class_SoapClient()
285+
{
286+
zend_class_entry ce, *class_entry;
287+
288+
INIT_CLASS_ENTRY(ce, "SoapClient", class_SoapClient_methods);
289+
class_entry = zend_register_internal_class_ex(&ce, NULL);
290+
291+
return class_entry;
292+
}
293+

ext/sockets/sockets.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,7 @@ static PHP_MINIT_FUNCTION(sockets)
432432
ZEND_TSRMLS_CACHE_UPDATE();
433433
#endif
434434

435-
zend_class_entry ce_socket;
436-
INIT_CLASS_ENTRY(ce_socket, "Socket", class_Socket_methods);
437-
socket_ce = zend_register_internal_class(&ce_socket);
438-
socket_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
435+
socket_ce = register_class_Socket();
439436
socket_ce->create_object = socket_create_object;
440437
socket_ce->serialize = zend_class_serialize_deny;
441438
socket_ce->unserialize = zend_class_unserialize_deny;
@@ -447,10 +444,7 @@ static PHP_MINIT_FUNCTION(sockets)
447444
socket_object_handlers.clone_obj = NULL;
448445
socket_object_handlers.get_gc = socket_get_gc;
449446

450-
zend_class_entry ce_address_info;
451-
INIT_CLASS_ENTRY(ce_address_info, "AddressInfo", class_AddressInfo_methods);
452-
address_info_ce = zend_register_internal_class(&ce_address_info);
453-
address_info_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
447+
address_info_ce = register_class_AddressInfo();
454448
address_info_ce->create_object = address_info_create_object;
455449
address_info_ce->serialize = zend_class_serialize_deny;
456450
address_info_ce->unserialize = zend_class_unserialize_deny;

ext/sockets/sockets.stub.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
22

3-
/** @generate-function-entries */
3+
/** @generate-class-entries */
44

5+
/** @strict-properties */
56
final class Socket
67
{
78
}
89

10+
/** @strict-properties */
911
final class AddressInfo
1012
{
1113
}

0 commit comments

Comments
 (0)