diff --git a/.gitignore b/.gitignore index 86886db..288c25b 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ /modules /missing /.deps +*.dep /.libs /Makefile /Makefile.fragments @@ -36,6 +37,7 @@ /libtool /mkinstalldirs /ltmain.sh +/ltmain.sh.backup /.cproject /.project /.settings diff --git a/rar_error.c b/rar_error.c index 13a742b..6a07186 100644 --- a/rar_error.c +++ b/rar_error.c @@ -247,7 +247,7 @@ void minit_rarerror(TSRMLS_D) /* {{{ */ zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); #else rarexception_ce_ptr = zend_register_internal_class_ex(&ce, - zend_exception_get_default(TSRMLS_C)); + zend_ce_exception); #endif rarexception_ce_ptr->ce_flags |= ZEND_ACC_FINAL; zend_declare_property_bool(rarexception_ce_ptr, "usingExceptions", diff --git a/rararch.c b/rararch.c index 7cbfa26..9cad093 100644 --- a/rararch.c +++ b/rararch.c @@ -970,6 +970,13 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_rararchive_void, 0) ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 80200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_rararchive_tostring, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() +#else +#define arginfo_rararchive_tostring arginfo_rararchive_void +#endif /* }}} */ static zend_function_entry php_rararch_class_functions[] = { @@ -984,7 +991,7 @@ static zend_function_entry php_rararch_class_functions[] = { PHP_ME_MAPPING(isBroken, rar_broken_is, arginfo_rararchive_void, ZEND_ACC_PUBLIC) PHP_ME_MAPPING(setAllowBroken, rar_allow_broken_set, arginfo_rararchive_setallowbroken, ZEND_ACC_PUBLIC) PHP_ME_MAPPING(close, rar_close, arginfo_rararchive_void, ZEND_ACC_PUBLIC) - PHP_ME(rararch, __toString, arginfo_rararchive_void, ZEND_ACC_PUBLIC) + PHP_ME(rararch, __toString, arginfo_rararchive_tostring, ZEND_ACC_PUBLIC) PHP_ME_MAPPING(__construct, rar_bogus_ctor, arginfo_rararchive_void, ZEND_ACC_PRIVATE | ZEND_ACC_CTOR) #if PHP_MAJOR_VERSION >= 8 PHP_ME(rararch, getIterator, arginfo_rararchive_getiterator, ZEND_ACC_PUBLIC) diff --git a/rarentry.c b/rarentry.c index 5e680f6..cb5bdaa 100644 --- a/rarentry.c +++ b/rarentry.c @@ -735,6 +735,13 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_rar_void, 0) ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 80200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_rar_tostring, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() +#else +#define arginfo_rar_tostring arginfo_rar_void +#endif /* }}} */ static zend_function_entry php_rar_class_functions[] = { @@ -755,7 +762,7 @@ static zend_function_entry php_rar_class_functions[] = { PHP_ME(rarentry, getRedirType, arginfo_rar_void, ZEND_ACC_PUBLIC) PHP_ME(rarentry, isRedirectToDirectory, arginfo_rar_void, ZEND_ACC_PUBLIC) PHP_ME(rarentry, getRedirTarget, arginfo_rar_void, ZEND_ACC_PUBLIC) - PHP_ME(rarentry, __toString, arginfo_rar_void, ZEND_ACC_PUBLIC) + PHP_ME(rarentry, __toString, arginfo_rar_tostring, ZEND_ACC_PUBLIC) PHP_ME_MAPPING(__construct, rar_bogus_ctor, arginfo_rar_void, ZEND_ACC_PRIVATE | ZEND_ACC_CTOR) {NULL, NULL, NULL} }; diff --git a/tests/002.phpt b/tests/002.phpt index 5c00904..b4970a7 100644 --- a/tests/002.phpt +++ b/tests/002.phpt @@ -163,5 +163,5 @@ array(2) { Warning: rar_open(): Failed to open %s: ERAR_EOPEN (file open error) in %s on line %d -Warning: rar_list() expects parameter 1 to be RarArchive, boo%s given in %s on line %d +Warning: rar_list() expects parameter 1 to be RarArchive, %s given in %s on line %d Done diff --git a/tests/003.phpt b/tests/003.phpt index 6d614a3..89c871a 100644 --- a/tests/003.phpt +++ b/tests/003.phpt @@ -91,5 +91,5 @@ object(RarEntry)#%d (%d) { Warning: rar_open(): Failed to open %s: ERAR_EOPEN (file open error) in %s on line %d -Warning: rar_entry_get() expects parameter 1 to be RarArchive, boo%s given in %s on line %d +Warning: rar_entry_get() expects parameter 1 to be RarArchive, %s given in %s on line %d Done diff --git a/tests/008.phpt b/tests/008.phpt index 1287f10..1b6c75c 100644 --- a/tests/008.phpt +++ b/tests/008.phpt @@ -31,6 +31,6 @@ bool(false) Warning: rar_open(): Failed to open %s: ERAR_EOPEN (file open error) in %s on line %d -Warning: rar_entry_get() expects parameter 1 to be RarArchive, boo%s given in %s on line %d +Warning: rar_entry_get() expects parameter 1 to be RarArchive, %s given in %s on line %d Done