From 9c3f2bd9db54eae1ccac0207155e209e92935754 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 8 Jun 2020 09:04:21 +0200 Subject: fix encode parameter is option --- php-pecl-zip.spec | 9 ++++++++- zip-php8.patch | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 zip-php8.patch diff --git a/php-pecl-zip.spec b/php-pecl-zip.spec index 11e70b8..fab3678 100644 --- a/php-pecl-zip.spec +++ b/php-pecl-zip.spec @@ -35,13 +35,15 @@ Summary: A ZIP archive management extension Summary(fr): Une extension de gestion des ZIP Name: %{?scl_prefix}php-pecl-zip Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}} -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP Group: Development/Languages URL: https://pecl.php.net/package/zip Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz +Patch0: %{pecl_name}-php8.patch + BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel # Version 1.2.0 for encryption support @@ -132,6 +134,8 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS +%patch0 -p1 + # Sanity check, really often broken extver=$(sed -n '/#define PHP_ZIP_VERSION/{s/.* "//;s/".*$//;p}' php7/php_zip.h) if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then @@ -264,6 +268,9 @@ fi #### TODO: SCLs on EL-8 still use libzip from default stream (7.2 => 1.5.1) %changelog +* Fri Jun 5 2020 Remi Collet - 1.19.0-2 +- fix encode parameter is option + * Fri Jun 5 2020 Remi Collet - 1.19.0-1 - update to 1.19.0 diff --git a/zip-php8.patch b/zip-php8.patch new file mode 100644 index 0000000..45e9940 --- /dev/null +++ b/zip-php8.patch @@ -0,0 +1,42 @@ +From a6154ce1512755b061848bc1e549118279765dc1 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 5 Jun 2020 17:08:21 +0200 +Subject: [PATCH] encode param is optional + +--- + php8/php_zip.stub.php | 4 ++-- + php8/php_zip_arginfo.h | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/php8/php_zip.stub.php b/php8/php_zip.stub.php +index da8e373..f85464a 100644 +--- a/php8/php_zip.stub.php ++++ b/php8/php_zip.stub.php +@@ -194,9 +194,9 @@ public function registerCancelCallback(callable $callback) {} + + #ifdef HAVE_METHOD_SUPPORTED + /** @return bool */ +- public static function isCompressionMethodSupported(int $method, bool $enc): bool {} ++ public static function isCompressionMethodSupported(int $method, bool $enc = true): bool {} + + /** @return bool */ +- public static function isEncryptionMethodSupported(int $method, bool $enc): bool {} ++ public static function isEncryptionMethodSupported(int $method, bool $enc = true): bool {} + #endif + } +diff --git a/php8/php_zip_arginfo.h b/php8/php_zip_arginfo.h +index c1e8f24..5f150b9 100644 +--- a/php8/php_zip_arginfo.h ++++ b/php8/php_zip_arginfo.h +@@ -271,9 +271,9 @@ ZEND_END_ARG_INFO() + #endif + + #if defined(HAVE_METHOD_SUPPORTED) +-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_isCompressionMethodSupported, 0, 2, _IS_BOOL, 0) ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ZipArchive_isCompressionMethodSupported, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, method, IS_LONG, 0) +- ZEND_ARG_TYPE_INFO(0, enc, _IS_BOOL, 0) ++ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enc, _IS_BOOL, 0, "true") + ZEND_END_ARG_INFO() + #endif + -- cgit