From 47dcbe79beffae527f07eb15c550cf7a58996de6 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 11 Sep 2023 10:46:13 +0200 Subject: drop support for PHP 7 --- package.xml | 3 ++- 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 PHP-3.01 - add optional operator to rpmcmpver for consistency with version_compare +- drop support for PHP 7 @@ -65,7 +66,7 @@ Documentation: https://www.php.net/rpminfo - 7.2.0 + 8.0.0 1.10.0 diff --git a/rpminfo.c b/rpminfo.c index 1ba0123..1212a7e 100644 --- a/rpminfo.c +++ b/rpminfo.c @@ -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)) { -- cgit