Generate class entries from stubs for com, standard, xmlreader, xmlwriter, xsl, zip, Zend

Closes GH-6706
This commit is contained in:
Máté Kocsis 2021-02-17 13:42:42 +01:00
parent d03be8bf86
commit 4c6533c257
No known key found for this signature in database
GPG key ID: FD055E41728BF310
39 changed files with 345 additions and 125 deletions

View file

@ -32,10 +32,7 @@
/* }}} */
ZEND_MINIT_FUNCTION(core) { /* {{{ */
zend_class_entry class_entry;
INIT_CLASS_ENTRY(class_entry, "stdClass", NULL);
zend_standard_class_def = zend_register_internal_class(&class_entry);
zend_standard_class_def = register_class_stdClass();
zend_register_default_classes();

View file

@ -2,6 +2,10 @@
/** @generate-class-entries */
class stdClass
{
}
function zend_version(): string {}
function func_num_args(): int {}

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: b2216a294367f50c8b6208653ebf6fa43dc106d1 */
* Stub hash: 429fc9b22054348101d0b9d6746494e52dc04edf */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_version, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
@ -333,3 +333,18 @@ static const zend_function_entry ext_functions[] = {
ZEND_FE(gc_status, arginfo_gc_status)
ZEND_FE_END
};
static const zend_function_entry class_stdClass_methods[] = {
ZEND_FE_END
};
static zend_class_entry *register_class_stdClass(void)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "stdClass", class_stdClass_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
return class_entry;
}

View file

@ -159,40 +159,33 @@ static PHP_GINIT_FUNCTION(com_dotnet)
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(com_dotnet)
{
zend_class_entry ce, *tmp;
zend_class_entry *tmp;
php_com_wrapper_minit(INIT_FUNC_ARGS_PASSTHRU);
php_com_persist_minit(INIT_FUNC_ARGS_PASSTHRU);
INIT_CLASS_ENTRY(ce, "com_exception", NULL);
php_com_exception_class_entry = zend_register_internal_class_ex(&ce, zend_ce_exception);
php_com_exception_class_entry->ce_flags |= ZEND_ACC_FINAL;
php_com_exception_class_entry = register_class_com_exception(zend_ce_exception);
/* php_com_exception_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */
INIT_CLASS_ENTRY(ce, "com_safearray_proxy", NULL);
php_com_saproxy_class_entry = zend_register_internal_class(&ce);
php_com_saproxy_class_entry->ce_flags |= ZEND_ACC_FINAL;
php_com_saproxy_class_entry = register_class_com_safearray_proxy();
/* php_com_saproxy_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */
php_com_saproxy_class_entry->get_iterator = php_com_saproxy_iter_get;
INIT_CLASS_ENTRY(ce, "variant", class_variant_methods);
ce.create_object = php_com_object_new;
php_com_variant_class_entry = zend_register_internal_class(&ce);
php_com_variant_class_entry = register_class_variant();
php_com_variant_class_entry->create_object = php_com_object_new;
php_com_variant_class_entry->get_iterator = php_com_iter_get;
php_com_variant_class_entry->serialize = zend_class_serialize_deny;
php_com_variant_class_entry->unserialize = zend_class_unserialize_deny;
INIT_CLASS_ENTRY(ce, "com", class_com_methods);
ce.create_object = php_com_object_new;
tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry);
tmp = register_class_com(php_com_variant_class_entry);
tmp->create_object = php_com_object_new;
tmp->get_iterator = php_com_iter_get;
tmp->serialize = zend_class_serialize_deny;
tmp->unserialize = zend_class_unserialize_deny;
#if HAVE_MSCOREE_H
INIT_CLASS_ENTRY(ce, "dotnet", class_dotnet_methods);
ce.create_object = php_com_object_new;
tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry);
tmp = register_class_dotnet(php_com_variant_class_entry);
tmp->create_object = php_com_object_new;
tmp->get_iterator = php_com_iter_get;
tmp->serialize = zend_class_serialize_deny;
tmp->unserialize = zend_class_unserialize_deny;

View file

@ -1,6 +1,6 @@
<?php
/** @generate-function-entries */
/** @generate-class-entries */
function variant_set(variant $variant, mixed $value): void {}
@ -71,18 +71,22 @@ class variant
public function __construct(mixed $value = null, int $type = VT_EMPTY, int $codepage = CP_ACP) {}
}
class com
class com extends variant
{
public function __construct(string $module_name, array|string|null $server_name = null, int $codepage = CP_ACP, string $typelib = "") {}
}
#if HAVE_MSCOREE_H
class dotnet
class dotnet extends variant
{
public function __construct(string $assembly_name, string $datatype_name, int $codepage = CP_ACP) {}
}
#endif
final class com_exception extends exception
final class com_safearray_proxy
{
}
final class com_exception extends Exception
{
}

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 6b162963bcceb90144fdd3165137fb567f916812 */
* Stub hash: ba77cee0a718bcbe7ac280f07a41f9e97a8e2246 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_variant_set, 0, 2, IS_VOID, 0)
ZEND_ARG_OBJ_INFO(0, variant, variant, 0)
@ -228,6 +228,63 @@ static const zend_function_entry class_dotnet_methods[] = {
};
static const zend_function_entry class_com_safearray_proxy_methods[] = {
ZEND_FE_END
};
static const zend_function_entry class_com_exception_methods[] = {
ZEND_FE_END
};
static zend_class_entry *register_class_variant(void)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "variant", class_variant_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
return class_entry;
}
static zend_class_entry *register_class_com(zend_class_entry *class_entry_variant)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "com", class_com_methods);
class_entry = zend_register_internal_class_ex(&ce, class_entry_variant);
return class_entry;
}
static zend_class_entry *register_class_dotnet(zend_class_entry *class_entry_variant)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "dotnet", class_dotnet_methods);
class_entry = zend_register_internal_class_ex(&ce, class_entry_variant);
return class_entry;
}
static zend_class_entry *register_class_com_safearray_proxy(void)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "com_safearray_proxy", class_com_safearray_proxy_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
class_entry->ce_flags |= ZEND_ACC_FINAL;
return class_entry;
}
static zend_class_entry *register_class_com_exception(zend_class_entry *class_entry_Exception)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "com_exception", class_com_exception_methods);
class_entry = zend_register_internal_class_ex(&ce, class_entry_Exception);
class_entry->ce_flags |= ZEND_ACC_FINAL;
return class_entry;
}

View file

@ -721,16 +721,12 @@ static zend_object* helper_new(zend_class_entry *ce)
int php_com_persist_minit(INIT_FUNC_ARGS)
{
zend_class_entry ce;
memcpy(&helper_handlers, &std_object_handlers, sizeof(helper_handlers));
helper_handlers.free_obj = helper_free_storage;
helper_handlers.clone_obj = helper_clone;
INIT_CLASS_ENTRY(ce, "COMPersistHelper", class_COMPersistHelper_methods);
ce.create_object = helper_new;
helper_ce = zend_register_internal_class(&ce);
helper_ce->ce_flags |= ZEND_ACC_FINAL;
helper_ce = register_class_COMPersistHelper();
helper_ce->create_object = helper_new;
le_istream = zend_register_list_destructors_ex(istream_dtor,
NULL, "com_dotnet_istream_wrapper", module_number);

View file

@ -1,6 +1,6 @@
<?php
/** @generate-function-entries */
/** @generate-class-entries */
final class COMPersistHelper
{

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 2c2759e6c1894713439e3ee8da7f56810d00d8cf */
* Stub hash: d14d30fb232f08da37ba0df0b9186eb8bac5e1a4 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_COMPersistHelper___construct, 0, 0, 0)
ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, variant, variant, 1, "null")
@ -52,3 +52,14 @@ static const zend_function_entry class_COMPersistHelper_methods[] = {
ZEND_ME(COMPersistHelper, SaveToStream, arginfo_class_COMPersistHelper_SaveToStream, ZEND_ACC_PUBLIC)
ZEND_FE_END
};
static zend_class_entry *register_class_COMPersistHelper(void)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "COMPersistHelper", class_COMPersistHelper_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
class_entry->ce_flags |= ZEND_ACC_FINAL;
return class_entry;
}

View file

@ -132,11 +132,6 @@ void dom_parent_node_after(dom_object *context, zval *nodes, int nodesc);
void dom_parent_node_before(dom_object *context, zval *nodes, int nodesc);
void dom_child_node_remove(dom_object *context);
#define REGISTER_DOM_CLASS(ce, name, parent_ce, funcs, entry) \
INIT_CLASS_ENTRY(ce, name, funcs); \
ce.create_object = dom_objects_new; \
entry = zend_register_internal_class_ex(&ce, parent_ce);
#define DOM_GET_OBJ(__ptr, __id, __prtype, __intern) { \
__intern = Z_DOMOBJ_P(__id); \
if (__intern->ptr == NULL || !(__ptr = (__prtype)((php_libxml_node_ptr *)__intern->ptr)->node)) { \

View file

@ -7,14 +7,14 @@ Felix De Vliegher <felix.devliegher@gmail.com>
$standard = new ReflectionExtension('standard');
var_dump($standard->getClassNames());
?>
--EXPECTF--
--EXPECT--
array(4) {
[0]=>
%s(22) "__PHP_Incomplete_Class"
string(22) "__PHP_Incomplete_Class"
[1]=>
%s(15) "php_user_filter"
string(14) "AssertionError"
[2]=>
%s(9) "Directory"
string(15) "php_user_filter"
[3]=>
%s(14) "AssertionError"
string(9) "Directory"
}

View file

@ -32,8 +32,6 @@ ZEND_END_MODULE_GLOBALS(assert)
ZEND_DECLARE_MODULE_GLOBALS(assert)
static zend_class_entry *assertion_error_ce;
#define ASSERTG(v) ZEND_MODULE_GLOBALS_ACCESSOR(assert, v)
#define SAFE_STRING(s) ((s)?(s):"")
@ -46,6 +44,8 @@ enum {
ASSERT_EXCEPTION
};
PHPAPI zend_class_entry *assertion_error_ce;
static PHP_INI_MH(OnChangeCallback) /* {{{ */
{
if (EG(current_execute_data)) {
@ -89,8 +89,6 @@ static void php_assert_init_globals(zend_assert_globals *assert_globals_p) /* {{
PHP_MINIT_FUNCTION(assert) /* {{{ */
{
zend_class_entry ce;
ZEND_INIT_MODULE_GLOBALS(assert, php_assert_init_globals, NULL);
REGISTER_INI_ENTRIES();
@ -101,9 +99,6 @@ PHP_MINIT_FUNCTION(assert) /* {{{ */
REGISTER_LONG_CONSTANT("ASSERT_WARNING", ASSERT_WARNING, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("ASSERT_EXCEPTION", ASSERT_EXCEPTION, CONST_CS|CONST_PERSISTENT);
INIT_CLASS_ENTRY(ce, "AssertionError", NULL);
assertion_error_ce = zend_register_internal_class_ex(&ce, zend_ce_error);
return SUCCESS;
}
/* }}} */

View file

@ -283,7 +283,10 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */
#endif
#endif
php_register_incomplete_class();
php_ce_incomplete_class = register_class___PHP_Incomplete_Class();
php_register_incomplete_class_handlers();
assertion_error_ce = register_class_AssertionError(zend_ce_error);
REGISTER_LONG_CONSTANT("CONNECTION_ABORTED", PHP_CONNECTION_ABORTED, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CONNECTION_NORMAL", PHP_CONNECTION_NORMAL, CONST_CS | CONST_PERSISTENT);

View file

@ -1,6 +1,14 @@
<?php
/** @generate-function-entries */
/** @generate-class-entries */
final class __PHP_Incomplete_Class
{
}
class AssertionError extends Error
{
}
/* main/main.c */

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: e9f39cbc595f0f2cdd84e58d4857f9fdb03ff7b7 */
* Stub hash: 97edf8c87780c892984099e52ad1c6c745b919f8 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0)
@ -3491,3 +3491,34 @@ static const zend_function_entry ext_functions[] = {
#endif
ZEND_FE_END
};
static const zend_function_entry class___PHP_Incomplete_Class_methods[] = {
ZEND_FE_END
};
static const zend_function_entry class_AssertionError_methods[] = {
ZEND_FE_END
};
static zend_class_entry *register_class___PHP_Incomplete_Class(void)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "__PHP_Incomplete_Class", class___PHP_Incomplete_Class_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
class_entry->ce_flags |= ZEND_ACC_FINAL;
return class_entry;
}
static zend_class_entry *register_class_AssertionError(zend_class_entry *class_entry_Error)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "AssertionError", class_AssertionError_methods);
class_entry = zend_register_internal_class_ex(&ce, class_entry_Error);
return class_entry;
}

View file

@ -112,10 +112,8 @@ PHP_RINIT_FUNCTION(dir)
PHP_MINIT_FUNCTION(dir)
{
static char dirsep_str[2], pathsep_str[2];
zend_class_entry dir_class_entry;
INIT_CLASS_ENTRY(dir_class_entry, "Directory", class_Directory_methods);
dir_class_entry_ptr = zend_register_internal_class(&dir_class_entry);
dir_class_entry_ptr = register_class_Directory();
#ifdef ZTS
ts_allocate_id(&dir_globals_id, sizeof(php_dir_globals), NULL, NULL);

View file

@ -1,6 +1,6 @@
<?php
/** @generate-function-entries */
/** @generate-class-entries */
class Directory
{

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: a715bf6a8d5fe69732623cc17f03bd463f369648 */
* Stub hash: 1fd5cc5147c7272006e59d63d68c12caec84589f */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Directory_close, 0, 0, 0)
ZEND_END_ARG_INFO()
@ -20,3 +20,13 @@ static const zend_function_entry class_Directory_methods[] = {
ZEND_ME_MAPPING(read, readdir, arginfo_class_Directory_read, ZEND_ACC_PUBLIC)
ZEND_FE_END
};
static zend_class_entry *register_class_Directory(void)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "Directory", class_Directory_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
return class_entry;
}

View file

@ -108,14 +108,8 @@ static zend_object *php_create_incomplete_object(zend_class_entry *class_type)
return object;
}
PHPAPI void php_register_incomplete_class(void)
PHPAPI void php_register_incomplete_class_handlers(void)
{
zend_class_entry incomplete_class;
INIT_CLASS_ENTRY(incomplete_class, INCOMPLETE_CLASS, NULL);
incomplete_class.create_object = php_create_incomplete_object;
memcpy(&php_incomplete_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
php_incomplete_object_handlers.read_property = incomplete_class_get_property;
php_incomplete_object_handlers.has_property = incomplete_class_has_property;
@ -124,8 +118,7 @@ PHPAPI void php_register_incomplete_class(void)
php_incomplete_object_handlers.get_property_ptr_ptr = incomplete_class_get_property_ptr_ptr;
php_incomplete_object_handlers.get_method = incomplete_class_get_method;
php_ce_incomplete_class = zend_register_internal_class(&incomplete_class);
php_ce_incomplete_class->ce_flags |= ZEND_ACC_FINAL;
php_ce_incomplete_class->create_object = php_create_incomplete_object;
}
/* }}} */

View file

@ -23,4 +23,6 @@ PHP_RINIT_FUNCTION(assert);
PHP_RSHUTDOWN_FUNCTION(assert);
PHP_MINFO_FUNCTION(assert);
extern PHPAPI zend_class_entry *assertion_error_ce;
#endif /* PHP_ASSERT_H */

View file

@ -49,7 +49,7 @@ extern PHPAPI zend_class_entry *php_ce_incomplete_class;
extern "C" {
#endif
PHPAPI void php_register_incomplete_class(void);
PHPAPI void php_register_incomplete_class_handlers(void);
PHPAPI zend_string *php_lookup_class_name(zend_object *object);
PHPAPI void php_store_class_name(zval *object, zend_string *name);

View file

@ -58,7 +58,7 @@ PHP_METHOD(php_user_filter, onClose)
ZEND_PARSE_PARAMETERS_NONE();
}
static zend_class_entry user_filter_class_entry;
static zend_class_entry *user_filter_class_entry;
static ZEND_RSRC_DTOR_FUNC(php_bucket_dtor)
{
@ -71,14 +71,8 @@ static ZEND_RSRC_DTOR_FUNC(php_bucket_dtor)
PHP_MINIT_FUNCTION(user_filters)
{
zend_class_entry *php_user_filter;
/* init the filter class ancestor */
INIT_CLASS_ENTRY(user_filter_class_entry, "php_user_filter", class_php_user_filter_methods);
if ((php_user_filter = zend_register_internal_class(&user_filter_class_entry)) == NULL) {
return FAILURE;
}
zend_declare_property_string(php_user_filter, "filtername", sizeof("filtername")-1, "", ZEND_ACC_PUBLIC);
zend_declare_property_string(php_user_filter, "params", sizeof("params")-1, "", ZEND_ACC_PUBLIC);
user_filter_class_entry = register_class_php_user_filter();
/* init the filter resource; it has no dtor, as streams will always clean it up
* at the correct time */

View file

@ -1,6 +1,6 @@
<?php
/** @generate-function-entries */
/** @generate-class-entries */
class php_user_filter
{

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: e3ab7a87eb78ef3a7f96ad18f5dff6c6d8032ca2 */
* Stub hash: d0653a1b2a1f33744b41a9b5f047ec4330bac091 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_php_user_filter_filter, 0, 0, 4)
ZEND_ARG_INFO(0, in)
@ -25,3 +25,25 @@ static const zend_function_entry class_php_user_filter_methods[] = {
ZEND_ME(php_user_filter, onClose, arginfo_class_php_user_filter_onClose, ZEND_ACC_PUBLIC)
ZEND_FE_END
};
static zend_class_entry *register_class_php_user_filter(void)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "php_user_filter", class_php_user_filter_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
zval property_filtername_default_value;
ZVAL_EMPTY_STRING(&property_filtername_default_value);
zend_string *property_filtername_name = zend_string_init("filtername", sizeof("filtername") - 1, 1);
zend_declare_property_ex(class_entry, property_filtername_name, &property_filtername_default_value, ZEND_ACC_PUBLIC, NULL);
zend_string_release(property_filtername_name);
zval property_params_default_value;
ZVAL_EMPTY_STRING(&property_params_default_value);
zend_string *property_params_name = zend_string_init("params", sizeof("params") - 1, 1);
zend_declare_property_ex(class_entry, property_params_name, &property_params_default_value, ZEND_ACC_PUBLIC, NULL);
zend_string_release(property_params_name);
return class_entry;
}

View file

@ -1147,8 +1147,6 @@ PHP_METHOD(XMLReader, expand)
PHP_MINIT_FUNCTION(xmlreader)
{
zend_class_entry ce;
memcpy(&xmlreader_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
xmlreader_object_handlers.offset = XtOffsetOf(xmlreader_object, std);
xmlreader_object_handlers.dtor_obj = zend_objects_destroy_object;
@ -1159,9 +1157,8 @@ PHP_MINIT_FUNCTION(xmlreader)
xmlreader_object_handlers.get_method = xmlreader_get_method;
xmlreader_object_handlers.clone_obj = NULL;
INIT_CLASS_ENTRY(ce, "XMLReader", class_XMLReader_methods);
ce.create_object = xmlreader_objects_new;
xmlreader_class_entry = zend_register_internal_class(&ce);
xmlreader_class_entry = register_class_XMLReader();
xmlreader_class_entry->create_object = xmlreader_objects_new;
memcpy(&xmlreader_open_fn, zend_hash_str_find_ptr(&xmlreader_class_entry->function_table, "open", sizeof("open")-1), sizeof(zend_internal_function));
xmlreader_open_fn.fn_flags &= ~ZEND_ACC_STATIC;

View file

@ -1,6 +1,6 @@
<?php
/** @generate-function-entries */
/** @generate-class-entries */
class XMLReader
{

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 0188a53f262d3f8e19b5b64d163bdee84f1be6b8 */
* Stub hash: 44e03e4884bd11843bae3d286a75ef1e6a677c16 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_close, 0, 0, 0)
ZEND_END_ARG_INFO()
@ -138,3 +138,13 @@ static const zend_function_entry class_XMLReader_methods[] = {
ZEND_ME(XMLReader, expand, arginfo_class_XMLReader_expand, ZEND_ACC_PUBLIC)
ZEND_FE_END
};
static zend_class_entry *register_class_XMLReader(void)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "XMLReader", class_XMLReader_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
return class_entry;
}

View file

@ -1032,16 +1032,13 @@ PHP_FUNCTION(xmlwriter_flush)
/* {{{ PHP_MINIT_FUNCTION */
static PHP_MINIT_FUNCTION(xmlwriter)
{
zend_class_entry ce;
memcpy(&xmlwriter_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
xmlwriter_object_handlers.offset = XtOffsetOf(ze_xmlwriter_object, std);
xmlwriter_object_handlers.dtor_obj = xmlwriter_object_dtor;
xmlwriter_object_handlers.free_obj = xmlwriter_object_free_storage;
xmlwriter_object_handlers.clone_obj = NULL;
INIT_CLASS_ENTRY(ce, "XMLWriter", class_XMLWriter_methods);
ce.create_object = xmlwriter_object_new;
xmlwriter_class_entry_ce = zend_register_internal_class(&ce);
xmlwriter_class_entry_ce = register_class_XMLWriter();
xmlwriter_class_entry_ce->create_object = xmlwriter_object_new;
return SUCCESS;
}

View file

@ -1,6 +1,6 @@
<?php
/** @generate-function-entries */
/** @generate-class-entries */
function xmlwriter_open_uri(string $uri): XMLWriter|false {}

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: a0ece6bc77b0a9811cb09a604b175e2295efc7a0 */
* Stub hash: ce5cf4f922e47833033729b2a8941c36fa2b4d6d */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_xmlwriter_open_uri, 0, 1, XMLWriter, MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0)
@ -464,3 +464,13 @@ static const zend_function_entry class_XMLWriter_methods[] = {
ZEND_ME_MAPPING(flush, xmlwriter_flush, arginfo_class_XMLWriter_flush, ZEND_ACC_PUBLIC)
ZEND_FE_END
};
static zend_class_entry *register_class_XMLWriter(void)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "XMLWriter", class_XMLWriter_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
return class_entry;
}

View file

@ -111,16 +111,13 @@ zend_object *xsl_objects_new(zend_class_entry *class_type)
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(xsl)
{
zend_class_entry ce;
memcpy(&xsl_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
xsl_object_handlers.offset = XtOffsetOf(xsl_object, std);
xsl_object_handlers.clone_obj = NULL;
xsl_object_handlers.free_obj = xsl_objects_free_storage;
INIT_CLASS_ENTRY(ce, "XSLTProcessor", class_XSLTProcessor_methods);
ce.create_object = xsl_objects_new;
xsl_xsltprocessor_class_entry = zend_register_internal_class(&ce);
xsl_xsltprocessor_class_entry = register_class_XSLTProcessor();
xsl_xsltprocessor_class_entry->create_object = xsl_objects_new;
#ifdef HAVE_XSL_EXSLT
exsltRegisterAll();

View file

@ -1,6 +1,6 @@
<?php
/** @generate-function-entries */
/** @generate-class-entries */
class XSLTProcessor
{

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: a119247725ff61dbd615cb86ee6201ee6603ba51 */
* Stub hash: bcc89ca2603d60a9832704809fd8ab3834e79f74 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_importStylesheet, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, stylesheet, IS_OBJECT, 0)
@ -79,3 +79,13 @@ static const zend_function_entry class_XSLTProcessor_methods[] = {
ZEND_ME(XSLTProcessor, getSecurityPrefs, arginfo_class_XSLTProcessor_getSecurityPrefs, ZEND_ACC_PUBLIC)
ZEND_FE_END
};
static zend_class_entry *register_class_XSLTProcessor(void)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "XSLTProcessor", class_XSLTProcessor_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
return class_entry;
}

View file

@ -831,17 +831,12 @@ static void php_zip_register_prop_handler(HashTable *prop_handler, char *name, z
{
zip_prop_handler hnd;
zend_string *str;
zval tmp;
hnd.read_const_char_func = read_char_func;
hnd.read_int_func = read_int_func;
hnd.type = rettype;
str = zend_string_init_interned(name, strlen(name), 1);
zend_hash_add_mem(prop_handler, str, &hnd, sizeof(zip_prop_handler));
/* Register for reflection */
ZVAL_NULL(&tmp);
zend_declare_property_ex(zip_class_entry, str, &tmp, ZEND_ACC_PUBLIC, NULL);
zend_string_release_ex(str, 1);
}
/* }}} */
@ -3026,8 +3021,6 @@ static void php_zip_free_prop_handler(zval *el) /* {{{ */ {
/* {{{ PHP_MINIT_FUNCTION */
static PHP_MINIT_FUNCTION(zip)
{
zend_class_entry ce;
memcpy(&zip_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
zip_object_handlers.offset = XtOffsetOf(ze_zip_object, zo);
zip_object_handlers.free_obj = php_zip_object_free_storage;
@ -3039,9 +3032,8 @@ static PHP_MINIT_FUNCTION(zip)
zip_object_handlers.read_property = php_zip_read_property;
zip_object_handlers.has_property = php_zip_has_property;
INIT_CLASS_ENTRY(ce, "ZipArchive", class_ZipArchive_methods);
ce.create_object = php_zip_object_new;
zip_class_entry = zend_register_internal_class(&ce);
zip_class_entry = register_class_ZipArchive(zend_ce_countable);
zip_class_entry->create_object = php_zip_object_new;
zend_hash_init(&zip_prop_handlers, 0, NULL, php_zip_free_prop_handler, 1);
php_zip_register_prop_handler(&zip_prop_handlers, "lastId", php_zip_last_id, NULL, IS_LONG);
@ -3050,7 +3042,6 @@ static PHP_MINIT_FUNCTION(zip)
php_zip_register_prop_handler(&zip_prop_handlers, "numFiles", php_zip_get_num_files, NULL, IS_LONG);
php_zip_register_prop_handler(&zip_prop_handlers, "filename", NULL, php_zipobj_get_filename, IS_STRING);
php_zip_register_prop_handler(&zip_prop_handlers, "comment", NULL, php_zipobj_get_zip_comment, IS_STRING);
zend_class_implements(zip_class_entry, 1, zend_ce_countable);
REGISTER_ZIP_CLASS_CONST_LONG("CREATE", ZIP_CREATE);
REGISTER_ZIP_CLASS_CONST_LONG("EXCL", ZIP_EXCL);

View file

@ -1,6 +1,6 @@
<?php
/** @generate-function-entries */
/** @generate-class-entries */
/**
* @return resource|int|false
@ -64,10 +64,25 @@ function zip_entry_filesize($zip_entry): int|false {}
*/
function zip_entry_compressionmethod($zip_entry): string|false {}
class ZipArchive
class ZipArchive implements Countable
{
/** @var int|null */
public $lastId;
/** @var int|null */
public $status;
/** @var int|null */
public $statusSys;
/** @var int|null */
public $numFiles;
/** @var string|null */
public $name;
public $filename;
/** @var string|null */
public $comment;
/** @return bool|int */
public function open(string $filename, int $flags = 0) {}

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: a5b8a10dbaeddf5d0d1ac751ff64a5d7ff235562 */
* Stub hash: a50da348df01027594efd7c8ab7427c05ffea39e */
ZEND_BEGIN_ARG_INFO_EX(arginfo_zip_open, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
@ -453,3 +453,50 @@ static const zend_function_entry class_ZipArchive_methods[] = {
#endif
ZEND_FE_END
};
static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry_Countable)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "ZipArchive", class_ZipArchive_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
zend_class_implements(class_entry, 1, class_entry_Countable);
zval property_lastId_default_value;
ZVAL_NULL(&property_lastId_default_value);
zend_string *property_lastId_name = zend_string_init("lastId", sizeof("lastId") - 1, 1);
zend_declare_property_ex(class_entry, property_lastId_name, &property_lastId_default_value, ZEND_ACC_PUBLIC, NULL);
zend_string_release(property_lastId_name);
zval property_status_default_value;
ZVAL_NULL(&property_status_default_value);
zend_string *property_status_name = zend_string_init("status", sizeof("status") - 1, 1);
zend_declare_property_ex(class_entry, property_status_name, &property_status_default_value, ZEND_ACC_PUBLIC, NULL);
zend_string_release(property_status_name);
zval property_statusSys_default_value;
ZVAL_NULL(&property_statusSys_default_value);
zend_string *property_statusSys_name = zend_string_init("statusSys", sizeof("statusSys") - 1, 1);
zend_declare_property_ex(class_entry, property_statusSys_name, &property_statusSys_default_value, ZEND_ACC_PUBLIC, NULL);
zend_string_release(property_statusSys_name);
zval property_numFiles_default_value;
ZVAL_NULL(&property_numFiles_default_value);
zend_string *property_numFiles_name = zend_string_init("numFiles", sizeof("numFiles") - 1, 1);
zend_declare_property_ex(class_entry, property_numFiles_name, &property_numFiles_default_value, ZEND_ACC_PUBLIC, NULL);
zend_string_release(property_numFiles_name);
zval property_filename_default_value;
ZVAL_NULL(&property_filename_default_value);
zend_string *property_filename_name = zend_string_init("filename", sizeof("filename") - 1, 1);
zend_declare_property_ex(class_entry, property_filename_name, &property_filename_default_value, ZEND_ACC_PUBLIC, NULL);
zend_string_release(property_filename_name);
zval property_comment_default_value;
ZVAL_NULL(&property_comment_default_value);
zend_string *property_comment_name = zend_string_init("comment", sizeof("comment") - 1, 1);
zend_declare_property_ex(class_entry, property_comment_name, &property_comment_default_value, ZEND_ACC_PUBLIC, NULL);
zend_string_release(property_comment_name);
return class_entry;
}

View file

@ -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;

View file

@ -1,11 +1,13 @@
<?php
/** @generate-function-entries */
/** @generate-class-entries */
/** @strict-properties */
final class InflateContext
{
}
/** @strict-properties */
final class DeflateContext
{
}

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 5862b97739c885589779f8ba3d13b4e390d72811 */
* Stub hash: 1aa5f9d6d062280f6148f3e72ceeaca81fb3037e */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ob_gzhandler, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
@ -207,3 +207,25 @@ static const zend_function_entry class_InflateContext_methods[] = {
static const zend_function_entry class_DeflateContext_methods[] = {
ZEND_FE_END
};
static zend_class_entry *register_class_InflateContext(void)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "InflateContext", class_InflateContext_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;
}
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;
}