diff options
Diffstat (limited to 'ext/com_dotnet')
38 files changed, 159 insertions, 125 deletions
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index 3282bd9e50..0c4a3d82ed 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -279,7 +279,7 @@ PHP_FUNCTION(com_get_active_object) char *module_name; size_t module_name_len; zend_long code_page; - zend_bool code_page_is_null = 1; + bool code_page_is_null = 1; IUnknown *unk = NULL; IDispatch *obj = NULL; HRESULT res; @@ -751,7 +751,7 @@ PHP_FUNCTION(com_print_typeinfo) char *ifacename = NULL; char *typelibname = NULL; size_t ifacelen; - zend_bool wantsink = 0; + bool wantsink = 0; php_com_dotnet_object *obj = NULL; ITypeInfo *typeinfo; @@ -814,7 +814,7 @@ PHP_FUNCTION(com_load_typelib) char *name; size_t namelen; ITypeLib *pTL = NULL; - zend_bool cs = TRUE; + bool cs = TRUE; int codepage = COMG(code_page); if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &name, &namelen, &cs)) { diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c index 5e2c1f69de..6c256e7fc0 100644 --- a/ext/com_dotnet/com_extension.c +++ b/ext/com_dotnet/com_extension.c @@ -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; diff --git a/ext/com_dotnet/com_extension.stub.php b/ext/com_dotnet/com_extension.stub.php index e3194efe06..8c46f319b9 100644 --- a/ext/com_dotnet/com_extension.stub.php +++ b/ext/com_dotnet/com_extension.stub.php @@ -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 { } diff --git a/ext/com_dotnet/com_extension_arginfo.h b/ext/com_dotnet/com_extension_arginfo.h index d290161fd0..cf9a08e711 100644 --- a/ext/com_dotnet/com_extension_arginfo.h +++ b/ext/com_dotnet/com_extension_arginfo.h @@ -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; +} diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index fb4af4efec..c0e335a165 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -335,7 +335,7 @@ static zend_function *com_method_get(zend_object **object_ptr, zend_string *name f.arg_info = ecalloc(bindptr.lpfuncdesc->cParams, sizeof(zend_arg_info)); for (i = 0; i < bindptr.lpfuncdesc->cParams; i++) { - zend_bool by_ref = (bindptr.lpfuncdesc->lprgelemdescParam[i].paramdesc.wParamFlags & PARAMFLAG_FOUT) != 0; + bool by_ref = (bindptr.lpfuncdesc->lprgelemdescParam[i].paramdesc.wParamFlags & PARAMFLAG_FOUT) != 0; f.arg_info[i].type = (zend_type) ZEND_TYPE_INIT_NONE(_ZEND_ARG_INFO_FLAGS(by_ref, 0)); } diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c index 3bde7175d8..2c2cc4226e 100644 --- a/ext/com_dotnet/com_persist.c +++ b/ext/com_dotnet/com_persist.c @@ -363,7 +363,7 @@ CPH_METHOD(SaveToFile) HRESULT res; char *filename, *fullpath = NULL; size_t filename_len; - zend_bool remember = TRUE; + bool remember = TRUE; OLECHAR *olefilename = NULL; CPH_FETCH(); @@ -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); diff --git a/ext/com_dotnet/com_persist.stub.php b/ext/com_dotnet/com_persist.stub.php index b0e9ef6b5c..2a2b7ac5cb 100644 --- a/ext/com_dotnet/com_persist.stub.php +++ b/ext/com_dotnet/com_persist.stub.php @@ -1,6 +1,6 @@ <?php -/** @generate-function-entries */ +/** @generate-class-entries */ final class COMPersistHelper { diff --git a/ext/com_dotnet/com_persist_arginfo.h b/ext/com_dotnet/com_persist_arginfo.h index dc8bd6fa48..410782098d 100644 --- a/ext/com_dotnet/com_persist_arginfo.h +++ b/ext/com_dotnet/com_persist_arginfo.h @@ -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; +} diff --git a/ext/com_dotnet/php_com_dotnet.h b/ext/com_dotnet/php_com_dotnet.h index 025e1a7dd0..7a554d7268 100644 --- a/ext/com_dotnet/php_com_dotnet.h +++ b/ext/com_dotnet/php_com_dotnet.h @@ -36,13 +36,13 @@ PHP_RSHUTDOWN_FUNCTION(com_dotnet); PHP_MINFO_FUNCTION(com_dotnet); ZEND_BEGIN_MODULE_GLOBALS(com_dotnet) - zend_bool allow_dcom; - zend_bool autoreg_verbose; - zend_bool autoreg_on; - zend_bool autoreg_case_sensitive; + bool allow_dcom; + bool autoreg_verbose; + bool autoreg_on; + bool autoreg_case_sensitive; void *dotnet_runtime_stuff; /* opaque to avoid cluttering up other modules */ int code_page; /* default code_page if left unspecified */ - zend_bool rshutdown_started; + bool rshutdown_started; ZEND_END_MODULE_GLOBALS(com_dotnet) #if defined(ZTS) && defined(COMPILE_DL_COM_DOTNET) diff --git a/ext/com_dotnet/php_com_dotnet_internal.h b/ext/com_dotnet/php_com_dotnet_internal.h index e80bf6e312..d2b772e063 100644 --- a/ext/com_dotnet/php_com_dotnet_internal.h +++ b/ext/com_dotnet/php_com_dotnet_internal.h @@ -51,9 +51,9 @@ typedef struct _php_com_dotnet_object { static inline int php_com_is_valid_object(zval *zv) { zend_class_entry *ce = Z_OBJCE_P(zv); - return strcmp("com", ce->name->val) == 0 || - strcmp("dotnet", ce->name->val) == 0 || - strcmp("variant", ce->name->val) == 0; + return zend_string_equals_literal(ce->name, "com") || + zend_string_equals_literal(ce->name, "dotnet") || + zend_string_equals_literal(ce->name, "variant"); } #define CDNO_FETCH(zv) (php_com_dotnet_object*)Z_OBJ_P(zv) diff --git a/ext/com_dotnet/tests/27974.phpt b/ext/com_dotnet/tests/27974.phpt index c76dda9ed5..ca7735a829 100644 --- a/ext/com_dotnet/tests/27974.phpt +++ b/ext/com_dotnet/tests/27974.phpt @@ -1,8 +1,7 @@ --TEST-- COM: mapping a safearray ---SKIPIF-- -<?php -if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php error_reporting(E_ALL); diff --git a/ext/com_dotnet/tests/bug33386.phpt b/ext/com_dotnet/tests/bug33386.phpt index 7f305d2eb5..10e9021a0b 100644 --- a/ext/com_dotnet/tests/bug33386.phpt +++ b/ext/com_dotnet/tests/bug33386.phpt @@ -1,8 +1,9 @@ --TEST-- Bug #33386 (ScriptControl only sees last function of class) +--EXTENSIONS-- +com_dotnet --SKIPIF-- <?php -if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; if (4 != PHP_INT_SIZE) print "skip MSScriptControl isn't available under x64"; ?> --FILE-- diff --git a/ext/com_dotnet/tests/bug34272.phpt b/ext/com_dotnet/tests/bug34272.phpt index ce8a552dfd..27dc5142d3 100644 --- a/ext/com_dotnet/tests/bug34272.phpt +++ b/ext/com_dotnet/tests/bug34272.phpt @@ -1,8 +1,7 @@ --TEST-- Bug #34272 (empty array onto COM object blows up) ---SKIPIF-- -<?php -if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php error_reporting(E_ALL); diff --git a/ext/com_dotnet/tests/bug39596.phpt b/ext/com_dotnet/tests/bug39596.phpt index 1510db49cf..d6215f0596 100644 --- a/ext/com_dotnet/tests/bug39596.phpt +++ b/ext/com_dotnet/tests/bug39596.phpt @@ -1,8 +1,7 @@ --TEST-- Bug #39596 (Creating Variant of type VT_ARRAY) ---SKIPIF-- -<?php -if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php error_reporting(E_ALL); diff --git a/ext/com_dotnet/tests/bug39606.phpt b/ext/com_dotnet/tests/bug39606.phpt index f646c6a7c3..6f01acd471 100644 --- a/ext/com_dotnet/tests/bug39606.phpt +++ b/ext/com_dotnet/tests/bug39606.phpt @@ -1,8 +1,7 @@ --TEST-- COM: Loading typelib corrupts memory ---SKIPIF-- -<?php -if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php error_reporting(E_ALL); diff --git a/ext/com_dotnet/tests/bug45280.phpt b/ext/com_dotnet/tests/bug45280.phpt index 393799e374..a461871f2f 100644 --- a/ext/com_dotnet/tests/bug45280.phpt +++ b/ext/com_dotnet/tests/bug45280.phpt @@ -1,9 +1,7 @@ --TEST-- Bug #45280 (Reflection of instantiated COM classes causes PHP to crash) ---SKIPIF-- -<?php -if (!extension_loaded("com_dotnet")){ echo "skip COM/.Net support not present"; } -?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php $dict = new COM("Scripting.Dictionary"); diff --git a/ext/com_dotnet/tests/bug49192.phpt b/ext/com_dotnet/tests/bug49192.phpt index cd85a9a64c..519ac21180 100644 --- a/ext/com_dotnet/tests/bug49192.phpt +++ b/ext/com_dotnet/tests/bug49192.phpt @@ -1,8 +1,7 @@ --TEST-- Bug #49192 (PHP crashes when GC invoked on COM object) ---SKIPIF-- -<?php -if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php diff --git a/ext/com_dotnet/tests/bug62474.phpt b/ext/com_dotnet/tests/bug62474.phpt index cc8e252224..531ba9a640 100644 --- a/ext/com_dotnet/tests/bug62474.phpt +++ b/ext/com_dotnet/tests/bug62474.phpt @@ -1,9 +1,7 @@ --TEST-- Bug #62474 (com_event_sink crashes on certain arguments) ---SKIPIF-- -<?php -if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available'); -?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php var_dump(com_event_sink(new variant, function() {}, array())); diff --git a/ext/com_dotnet/tests/bug63208.phpt b/ext/com_dotnet/tests/bug63208.phpt index ae62dbba98..67ea9f50f9 100644 --- a/ext/com_dotnet/tests/bug63208.phpt +++ b/ext/com_dotnet/tests/bug63208.phpt @@ -1,9 +1,7 @@ --TEST-- Bug #63208 (BSTR to PHP string conversion not binary safe) ---SKIPIF-- -<?php -if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available'); -?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php $string = "\u{0905}b\0cd"; diff --git a/ext/com_dotnet/tests/bug64130.phpt b/ext/com_dotnet/tests/bug64130.phpt index 0f8e083295..ba47c85322 100644 --- a/ext/com_dotnet/tests/bug64130.phpt +++ b/ext/com_dotnet/tests/bug64130.phpt @@ -1,8 +1,9 @@ --TEST-- Bug #64130 (COM obj parameters passed by reference are not updated) +--EXTENSIONS-- +com_dotnet --SKIPIF-- <?php -if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available'); if (PHP_INT_SIZE != 4) die('skip for 32bit platforms only'); try { $ie = new com('InternetExplorer.Application'); diff --git a/ext/com_dotnet/tests/bug66322.phpt b/ext/com_dotnet/tests/bug66322.phpt index de37e4fa75..56988a82cc 100644 --- a/ext/com_dotnet/tests/bug66322.phpt +++ b/ext/com_dotnet/tests/bug66322.phpt @@ -1,8 +1,9 @@ --TEST-- Bug #66322 (COMPersistHelper::SaveToFile can save to wrong location) +--EXTENSIONS-- +com_dotnet --SKIPIF-- <?php -if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available'); try { new COM('Word.Application'); } catch (com_exception $ex) { diff --git a/ext/com_dotnet/tests/bug66431_0.phpt b/ext/com_dotnet/tests/bug66431_0.phpt index 5f9bc5c0b0..ef4d63f441 100644 --- a/ext/com_dotnet/tests/bug66431_0.phpt +++ b/ext/com_dotnet/tests/bug66431_0.phpt @@ -1,9 +1,7 @@ --TEST-- Bug #66431 Special Character via COM Interface (CP_UTF8), Scripting.FileSystemObject ---SKIPIF-- -<?php -if (!extension_loaded("com_dotnet")){ echo "skip COM/.Net support not present"; } -?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php diff --git a/ext/com_dotnet/tests/bug66431_1.phpt b/ext/com_dotnet/tests/bug66431_1.phpt index 7ebf16a10d..7f783dbf64 100644 --- a/ext/com_dotnet/tests/bug66431_1.phpt +++ b/ext/com_dotnet/tests/bug66431_1.phpt @@ -1,9 +1,9 @@ --TEST-- Bug #66431 Special Character via COM Interface (CP_UTF8), Application.Word +--EXTENSIONS-- +com_dotnet --SKIPIF-- <?php -if (!extension_loaded("com_dotnet")){ echo "skip COM/.Net support not present"; } - try { new COM("word.application", NULL, CP_UTF8); } catch (Exception $e) { diff --git a/ext/com_dotnet/tests/bug69939.phpt b/ext/com_dotnet/tests/bug69939.phpt index 49ad20787a..d650382d93 100644 --- a/ext/com_dotnet/tests/bug69939.phpt +++ b/ext/com_dotnet/tests/bug69939.phpt @@ -1,8 +1,7 @@ --TEST-- Bug #69939 (Casting object to bool returns false) ---SKIPIF-- -<?php -if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php var_dump((bool) new COM('WScript.Shell')); diff --git a/ext/com_dotnet/tests/bug72498.phpt b/ext/com_dotnet/tests/bug72498.phpt index b9bd498af3..67285e8523 100644 --- a/ext/com_dotnet/tests/bug72498.phpt +++ b/ext/com_dotnet/tests/bug72498.phpt @@ -1,9 +1,7 @@ --TEST-- Bug #72498 variant_date_from_timestamp null dereference ---SKIPIF-- -<?php -if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; -?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php diff --git a/ext/com_dotnet/tests/bug73679.phpt b/ext/com_dotnet/tests/bug73679.phpt index 235fd3e33e..9815cdcaac 100644 --- a/ext/com_dotnet/tests/bug73679.phpt +++ b/ext/com_dotnet/tests/bug73679.phpt @@ -1,8 +1,9 @@ --TEST-- Bug #73679 DOTNET read access violation using invalid codepage +--EXTENSIONS-- +com_dotnet --SKIPIF-- <?php -if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only"); ?> --FILE-- diff --git a/ext/com_dotnet/tests/bug77177.phpt b/ext/com_dotnet/tests/bug77177.phpt index 8fcfd5a378..19e4c11995 100644 --- a/ext/com_dotnet/tests/bug77177.phpt +++ b/ext/com_dotnet/tests/bug77177.phpt @@ -1,9 +1,7 @@ --TEST-- Bug #77177 (Serializing or unserializing COM objects crashes) ---SKIPIF-- -<?php -if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available'); -?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php $com = new COM("WScript.Shell"); diff --git a/ext/com_dotnet/tests/bug77578.phpt b/ext/com_dotnet/tests/bug77578.phpt index 910f24909b..2bf2cbf2c0 100644 --- a/ext/com_dotnet/tests/bug77578.phpt +++ b/ext/com_dotnet/tests/bug77578.phpt @@ -1,9 +1,7 @@ --TEST-- Bug #77578 (Crash when php unload) ---SKIPIF-- -<?php -if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available'); -?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php // To actually be able to verify the crash during shutdown on Windows, we have diff --git a/ext/com_dotnet/tests/bug77621.phpt b/ext/com_dotnet/tests/bug77621.phpt index 32e879dcd0..74972749e5 100644 --- a/ext/com_dotnet/tests/bug77621.phpt +++ b/ext/com_dotnet/tests/bug77621.phpt @@ -1,9 +1,7 @@ --TEST-- Bug #77621 (Already defined constants are not properly reported) ---SKIPIF-- -<?php -if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available'); -?> +--EXTENSIONS-- +com_dotnet --INI-- com.autoregister_verbose=1 --FILE-- diff --git a/ext/com_dotnet/tests/bug78650.phpt b/ext/com_dotnet/tests/bug78650.phpt index c362de95bb..ca2a235af2 100644 --- a/ext/com_dotnet/tests/bug78650.phpt +++ b/ext/com_dotnet/tests/bug78650.phpt @@ -1,9 +1,7 @@ --TEST-- Bug #78650 (new COM Crash) ---SKIPIF-- -<?php -if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available'); -?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php $fname = __DIR__ . '/bug78650/foo/bar'; diff --git a/ext/com_dotnet/tests/bug78694.phpt b/ext/com_dotnet/tests/bug78694.phpt index adf0c828ca..f44b00a4f4 100644 --- a/ext/com_dotnet/tests/bug78694.phpt +++ b/ext/com_dotnet/tests/bug78694.phpt @@ -1,9 +1,7 @@ --TEST-- Bug #78694 (Appending to a variant array causes segfault) ---SKIPIF-- -<?php -if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available'); -?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php foreach ([new com('WScript.Shell'), new variant([])] as $var) { diff --git a/ext/com_dotnet/tests/bug79242.phpt b/ext/com_dotnet/tests/bug79242.phpt index 46c5d8af3b..cda4d58ff9 100644 --- a/ext/com_dotnet/tests/bug79242.phpt +++ b/ext/com_dotnet/tests/bug79242.phpt @@ -1,8 +1,9 @@ --TEST-- Bug #79242 (COM error constants don't match com_exception codes) +--EXTENSIONS-- +com_dotnet --SKIPIF-- <?php -if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available'); if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platforms only"); ?> --FILE-- diff --git a/ext/com_dotnet/tests/bug79247.phpt b/ext/com_dotnet/tests/bug79247.phpt index 55e24b1796..2cda351d54 100644 --- a/ext/com_dotnet/tests/bug79247.phpt +++ b/ext/com_dotnet/tests/bug79247.phpt @@ -1,9 +1,7 @@ --TEST-- Bug #79247 (Garbage collecting variant objects segfaults) ---SKIPIF-- -<?php -if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available'); -?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php $keep = new variant(null); diff --git a/ext/com_dotnet/tests/bug79248.phpt b/ext/com_dotnet/tests/bug79248.phpt index fda67551a7..c43c1f5338 100644 --- a/ext/com_dotnet/tests/bug79248.phpt +++ b/ext/com_dotnet/tests/bug79248.phpt @@ -1,9 +1,7 @@ --TEST-- Bug #79248 (Traversing empty VT_ARRAY throws com_exception) ---SKIPIF-- -<?php -if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available'); -?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php $v = new variant([], VT_ARRAY); diff --git a/ext/com_dotnet/tests/bug79299.phpt b/ext/com_dotnet/tests/bug79299.phpt index 99c1a99742..ac4a94cd77 100644 --- a/ext/com_dotnet/tests/bug79299.phpt +++ b/ext/com_dotnet/tests/bug79299.phpt @@ -1,9 +1,7 @@ --TEST-- Bug #79299 (com_print_typeinfo prints duplicate variables) ---SKIPIF-- -<?php -if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available'); -?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php $dict = new COM("Scripting.Dictionary"); diff --git a/ext/com_dotnet/tests/bug79332.phpt b/ext/com_dotnet/tests/bug79332.phpt index 93add95d15..28443478d9 100644 --- a/ext/com_dotnet/tests/bug79332.phpt +++ b/ext/com_dotnet/tests/bug79332.phpt @@ -1,9 +1,7 @@ --TEST-- Bug #79332 (php_istreams are never freed) ---SKIPIF-- -<?php -if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available'); -?> +--EXTENSIONS-- +com_dotnet --FILE-- <?php $ph = new COMPersistHelper(null); diff --git a/ext/com_dotnet/tests/variants.phpt b/ext/com_dotnet/tests/variants.phpt index e28823c3ad..8547e65efb 100644 --- a/ext/com_dotnet/tests/variants.phpt +++ b/ext/com_dotnet/tests/variants.phpt @@ -1,8 +1,9 @@ --TEST-- COM: General variant tests +--EXTENSIONS-- +com_dotnet --SKIPIF-- <?php -if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; if (4 != PHP_INT_SIZE) print "skip x86 only"; ?> --FILE-- <?php diff --git a/ext/com_dotnet/tests/variants_x64.phpt b/ext/com_dotnet/tests/variants_x64.phpt index 1ca93c5709..0017ec64fd 100644 --- a/ext/com_dotnet/tests/variants_x64.phpt +++ b/ext/com_dotnet/tests/variants_x64.phpt @@ -1,8 +1,9 @@ --TEST-- COM: General variant tests +--EXTENSIONS-- +com_dotnet --SKIPIF-- <?php -if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; if (8 != PHP_INT_SIZE) print "skip x64 only"; if ((string) variant_cat(new VARIANT(false), new VARIANT(0.5)) != 'False0.5') print "skip English locale only"; |