diff options
| author | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-04-11 13:27:04 +0200 |
|---|---|---|
| committer | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-04-11 13:28:53 +0200 |
| commit | 3fe49d81f850977db93981cf66ed3057f57fd0c9 (patch) | |
| tree | 431ae5fcb094895cd647d0c0f6904b73315de821 /ext/com_dotnet | |
| parent | ca006e54e30bc5ac96f35af1ed7fd73a8c422cf0 (diff) | |
| download | php-git-3fe49d81f850977db93981cf66ed3057f57fd0c9.tar.gz | |
Generate method entries from stubs for a couple of extensions
Closes GH-5368
Diffstat (limited to 'ext/com_dotnet')
| -rw-r--r-- | ext/com_dotnet/com_extension.c | 21 | ||||
| -rw-r--r-- | ext/com_dotnet/com_extension_arginfo.h | 25 | ||||
| -rw-r--r-- | ext/com_dotnet/com_persist.stub.php | 20 |
3 files changed, 39 insertions, 27 deletions
diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c index b37e4b8ffe..14094aa039 100644 --- a/ext/com_dotnet/com_extension.c +++ b/ext/com_dotnet/com_extension.c @@ -37,21 +37,6 @@ zend_class_entry *php_com_exception_class_entry, *php_com_saproxy_class_entry; -static const zend_function_entry com_variant_funcs[] = { - PHP_ME(variant, __construct, arginfo_class_variant___construct, ZEND_ACC_PUBLIC) - PHP_FE_END -}; - -static const zend_function_entry com_com_funcs[] = { - PHP_ME(com, __construct, arginfo_class_com___construct, ZEND_ACC_PUBLIC) - PHP_FE_END -}; - -static const zend_function_entry com_dotnet_funcs[] = { - PHP_ME(dotnet, __construct, arginfo_class_dotnet___construct, ZEND_ACC_PUBLIC) - PHP_FE_END -}; - /* {{{ com_dotnet_module_entry */ zend_module_entry com_dotnet_module_entry = { @@ -196,14 +181,14 @@ PHP_MINIT_FUNCTION(com_dotnet) /* 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", com_variant_funcs); + 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->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", com_com_funcs); + 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->get_iterator = php_com_iter_get; @@ -211,7 +196,7 @@ PHP_MINIT_FUNCTION(com_dotnet) tmp->unserialize = zend_class_unserialize_deny; #if HAVE_MSCOREE_H - INIT_CLASS_ENTRY(ce, "dotnet", com_dotnet_funcs); + 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->get_iterator = php_com_iter_get; diff --git a/ext/com_dotnet/com_extension_arginfo.h b/ext/com_dotnet/com_extension_arginfo.h index 47e41ef268..f4b924358c 100644 --- a/ext/com_dotnet/com_extension_arginfo.h +++ b/ext/com_dotnet/com_extension_arginfo.h @@ -163,6 +163,11 @@ ZEND_FUNCTION(com_event_sink); ZEND_FUNCTION(com_print_typeinfo); ZEND_FUNCTION(com_message_pump); ZEND_FUNCTION(com_load_typelib); +ZEND_METHOD(variant, __construct); +ZEND_METHOD(com, __construct); +#if HAVE_MSCOREE_H +ZEND_METHOD(dotnet, __construct); +#endif static const zend_function_entry ext_functions[] = { @@ -200,3 +205,23 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(com_load_typelib, arginfo_com_load_typelib) ZEND_FE_END }; + + +static const zend_function_entry class_variant_methods[] = { + ZEND_ME(variant, __construct, arginfo_class_variant___construct, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + + +static const zend_function_entry class_com_methods[] = { + ZEND_ME(com, __construct, arginfo_class_com___construct, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; + + +static const zend_function_entry class_dotnet_methods[] = { +#if HAVE_MSCOREE_H + ZEND_ME(dotnet, __construct, arginfo_class_dotnet___construct, ZEND_ACC_PUBLIC) +#endif + ZEND_FE_END +}; diff --git a/ext/com_dotnet/com_persist.stub.php b/ext/com_dotnet/com_persist.stub.php index 5f183b175a..c4155bceb1 100644 --- a/ext/com_dotnet/com_persist.stub.php +++ b/ext/com_dotnet/com_persist.stub.php @@ -1,21 +1,23 @@ <?php -final class COMPersistHelper { - public function __construct(?VARIANT $com_object); - public function GetCurFileName(): string|false; +final class COMPersistHelper +{ + public function __construct(?VARIANT $com_object) {} - public function SaveToFile(?string $filename, bool $remember = true): bool; + public function GetCurFileName(): string|false {} - public function LoadFromFile(string $path, int $flags = 0): bool; + public function SaveToFile(?string $filename, bool $remember = true): bool {} - public function GetMaxStreamSize(): int; + public function LoadFromFile(string $path, int $flags = 0): bool {} - public function InitNew(): bool; + public function GetMaxStreamSize(): int {} + + public function InitNew(): bool {} /** @param resource $stream */ - public function LoadFromStream($stream): bool; + public function LoadFromStream($stream): bool {} /** @param resource $stream */ - public function SaveToStream($stream): bool; + public function SaveToStream($stream): bool {} } |
