diff options
author | Remi Collet <remi@remirepo.net> | 2023-09-11 10:46:13 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2023-09-11 10:46:13 +0200 |
commit | 47dcbe79beffae527f07eb15c550cf7a58996de6 (patch) | |
tree | a6405c0e39cc7d8e6fe9e8b6741a619046225ec4 | |
parent | 64504e8b8fb097d6e849953eb0e4721321c41a27 (diff) |
drop support for PHP 7
-rw-r--r-- | package.xml | 3 | ||||
-rw-r--r-- | rpminfo.c | 45 |
2 files changed, 2 insertions, 46 deletions
diff --git a/package.xml b/package.xml index 4756ce4..34627ee 100644 --- a/package.xml +++ b/package.xml @@ -25,6 +25,7 @@ Documentation: https://www.php.net/rpminfo <license uri="https://www.php.net/license/3_01.txt" filesource="LICENSE">PHP-3.01</license> <notes> - add optional operator to rpmcmpver for consistency with version_compare +- drop support for PHP 7 </notes> <contents> <dir name="/"> @@ -65,7 +66,7 @@ Documentation: https://www.php.net/rpminfo <dependencies> <required> <php> - <min>7.2.0</min> + <min>8.0.0</min> </php> <pearinstaller> <min>1.10.0</min> @@ -32,21 +32,6 @@ #include "php_rpminfo.h" -/* For PHP < 8.0 */ -#ifndef ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE -#define ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(pass_by_ref, name, type_hint, allow_null, default_value) \ - ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) -#endif -/* only used for rpmvercmp */ -#ifndef ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX -#define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(name, return_reference, required_num_args, type) \ - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, IS_LONG, 0) -#endif - -#ifndef RETURN_THROWS -#define RETURN_THROWS() return -#endif - #include "rpminfo_arginfo.h" ZEND_DECLARE_MODULE_GLOBALS(rpminfo) @@ -381,49 +366,29 @@ PHP_FUNCTION(rpmdbsearch) RETURN_THROWS(); } if (rpmTagGetType(crit) == RPM_NULL_TYPE) { -#if PHP_VERSION_ID < 80000 - php_error_docref(NULL, E_WARNING, "Unkown rpmtag"); - RETURN_NULL(); -#else zend_argument_value_error(2, "Unkown rpmtag"); RETURN_THROWS(); -#endif } if (mode != RPMMIRE_DEFAULT && mode != RPMMIRE_STRCMP && mode != RPMMIRE_REGEX && mode != RPMMIRE_GLOB && mode != -1) { -#if PHP_VERSION_ID < 80000 - php_error_docref(NULL, E_WARNING, "Unkown rpmmire"); - RETURN_NULL(); -#else zend_argument_value_error(3, "Unkown rpmmire"); RETURN_THROWS(); -#endif } if (crit == RPMTAG_PKGID) { if (len != 32) { -#if PHP_VERSION_ID < 80000 - php_error_docref(NULL, E_WARNING, "Bad length for PKGID, 32 expected"); - RETURN_NULL(); -#else zend_argument_value_error(1, "Bad length for PKGID, 32 expected"); RETURN_THROWS(); -#endif } len = hex2bin(name, MD5, len); name = MD5; } else if (crit == RPMTAG_HDRID) { if (len != 40) { -#if PHP_VERSION_ID < 80000 - php_error_docref(NULL, E_WARNING, "Bad length for HDRID, 40 expected"); - RETURN_NULL(); -#else zend_argument_value_error(1, "Bad length for HDRID, 40 expected"); RETURN_THROWS(); -#endif } } else if (crit == RPMTAG_INSTALLTID) { tid = atol(name); @@ -555,13 +520,8 @@ PHP_FUNCTION(rpmvercmp) RETURN_BOOL(r != 0); } -#if PHP_VERSION_ID < 80000 - php_error_docref(NULL, E_WARNING, "%s is not a valid comparison operator", op); - RETURN_NULL(); -#else zend_argument_value_error(3, "must be a valid comparison operator"); RETURN_THROWS(); -#endif } /* }}} */ @@ -577,13 +537,8 @@ PHP_FUNCTION(rpmaddtag) } if (rpmTagGetType(tag) == RPM_NULL_TYPE) { -#if PHP_VERSION_ID < 80000 - php_error_docref(NULL, E_WARNING, "Unkown rpmtag"); - RETURN_BOOL(0); -#else zend_argument_value_error(1, "Unkown rpmtag"); RETURN_THROWS(); -#endif } if (RPMINFO_G(tags)) { |