From 4c6533c257cfabd5dd78988bb277f410b2778140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Wed, 17 Feb 2021 13:42:42 +0100 Subject: Generate class entries from stubs for com, standard, xmlreader, xmlwriter, xsl, zip, Zend Closes GH-6706 --- ext/zlib/zlib.c | 10 ++-------- ext/zlib/zlib.stub.php | 4 +++- ext/zlib/zlib_arginfo.h | 24 +++++++++++++++++++++++- 3 files changed, 28 insertions(+), 10 deletions(-) (limited to 'ext/zlib') diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 628f04f2f4..02fb4dd207 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -1337,10 +1337,7 @@ static PHP_MINIT_FUNCTION(zlib) php_output_handler_conflict_register(ZEND_STRL("ob_gzhandler"), php_zlib_output_conflict_check); php_output_handler_conflict_register(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME), php_zlib_output_conflict_check); - zend_class_entry inflate_ce; - INIT_CLASS_ENTRY(inflate_ce, "InflateContext", class_InflateContext_methods); - inflate_context_ce = zend_register_internal_class(&inflate_ce); - inflate_context_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES; + inflate_context_ce = register_class_InflateContext(); inflate_context_ce->create_object = inflate_context_create_object; inflate_context_ce->serialize = zend_class_serialize_deny; inflate_context_ce->unserialize = zend_class_unserialize_deny; @@ -1352,10 +1349,7 @@ static PHP_MINIT_FUNCTION(zlib) inflate_context_object_handlers.clone_obj = NULL; inflate_context_object_handlers.compare = zend_objects_not_comparable; - zend_class_entry deflate_ce; - INIT_CLASS_ENTRY(deflate_ce, "DeflateContext", class_DeflateContext_methods); - deflate_context_ce = zend_register_internal_class(&deflate_ce); - deflate_context_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES; + deflate_context_ce = register_class_DeflateContext(); deflate_context_ce->create_object = deflate_context_create_object; deflate_context_ce->serialize = zend_class_serialize_deny; deflate_context_ce->unserialize = zend_class_unserialize_deny; diff --git a/ext/zlib/zlib.stub.php b/ext/zlib/zlib.stub.php index c047a53541..1aaafcdce2 100644 --- a/ext/zlib/zlib.stub.php +++ b/ext/zlib/zlib.stub.php @@ -1,11 +1,13 @@ ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + + return class_entry; +} + +static zend_class_entry *register_class_DeflateContext(void) +{ + zend_class_entry ce, *class_entry; + + INIT_CLASS_ENTRY(ce, "DeflateContext", class_DeflateContext_methods); + class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + + return class_entry; +} -- cgit v1.2.1