From f9a74f77ea1bdce93dfe19fae9edd141bfe23b9b Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 8 Oct 2020 14:01:28 +0200 Subject: more fix for 8 --- .gitignore | 2 ++ 463.patch | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ php-pecl-memcached.spec | 14 ++++------- 3 files changed, 69 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 1ab5c4f..01f0400 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ +clog package-*.xml *.tgz +*.tar.bz2 *.tar.gz *.tar.xz *.tar.xz.asc diff --git a/463.patch b/463.patch index 756880e..37bb169 100644 --- a/463.patch +++ b/463.patch @@ -1649,3 +1649,65 @@ index 0000000..c8af231 +OK +From baa6bfda6fbf4c1c75b5a7492db4cc40e6aa81f3 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Thu, 8 Oct 2020 13:45:49 +0200 +Subject: [PATCH] cleanup HAVE_SPL, removed in 8 as always there + +--- + php_memcached.c | 13 ++++--------- + 1 file changed, 4 insertions(+), 9 deletions(-) + +diff --git a/php_memcached.c b/php_memcached.c +index 147cb4a..8d9040e 100644 +--- a/php_memcached.c ++++ b/php_memcached.c +@@ -55,6 +55,8 @@ + # include "ext/msgpack/php_msgpack.h" + #endif + ++# include "ext/spl/spl_exceptions.h" ++ + static int le_memc; + + static int php_memc_list_entry(void) { +@@ -251,10 +253,6 @@ static zend_class_entry *memcached_ce = NULL; + static zend_class_entry *memcached_exception_ce = NULL; + static zend_object_handlers memcached_object_handlers; + +-#ifdef HAVE_SPL +-static zend_class_entry *spl_ce_RuntimeException = NULL; +-#endif +- + ZEND_DECLARE_MODULE_GLOBALS(php_memcached) + + #ifdef COMPILE_DL_MEMCACHED +@@ -3764,7 +3762,6 @@ zend_class_entry *php_memc_get_exception(void) + PHP_MEMCACHED_API + zend_class_entry *php_memc_get_exception_base(int root) + { +-#ifdef HAVE_SPL + if (!root) { + if (!spl_ce_RuntimeException) { + zend_class_entry *pce; +@@ -3781,7 +3778,7 @@ zend_class_entry *php_memc_get_exception_base(int root) + return spl_ce_RuntimeException; + } + } +-#endif ++ + return zend_exception_get_default(); + } + +@@ -3877,10 +3874,8 @@ static const zend_module_dep memcached_deps[] = { + #ifdef HAVE_MEMCACHED_MSGPACK + ZEND_MOD_REQUIRED("msgpack") + #endif +-#ifdef HAVE_SPL + ZEND_MOD_REQUIRED("spl") +-#endif +- {NULL, NULL, NULL} ++ ZEND_MOD_END + }; + #endif + diff --git a/php-pecl-memcached.spec b/php-pecl-memcached.spec index 3061fcd..288a3a2 100644 --- a/php-pecl-memcached.spec +++ b/php-pecl-memcached.spec @@ -31,7 +31,7 @@ Summary: Extension to work with the Memcached caching daemon Name: %{?sub_prefix}php-pecl-memcached Version: 3.1.5 -Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP URL: https://pecl.php.net/package/%{pecl_name} @@ -302,9 +302,6 @@ OPT="-n" %endif %if %{with_tests} -# XFAIL and very slow so no value -rm ?TS/tests/expire.phpt - ret=0 : Launch the Memcached service @@ -314,29 +311,28 @@ sed -e "s/11211/$port/" -i ?TS/tests/* : Run the upstream test Suite for NTS extension pushd NTS -rm tests/flush_buffers.phpt tests/touch_binary.phpt TEST_PHP_EXECUTABLE=%{__php} \ TEST_PHP_ARGS="$OPT -d extension=$PWD/modules/%{pecl_name}.so" \ NO_INTERACTION=1 \ REPORT_EXIT_STATUS=1 \ -%{__php} -n run-tests.php --show-diff || ret=1 +%{__php} -n run-tests.php -x --show-diff || ret=1 popd %if %{with_zts} : Run the upstream test Suite for ZTS extension pushd ZTS -rm tests/flush_buffers.phpt tests/touch_binary.phpt TEST_PHP_EXECUTABLE=%{__ztsphp} \ TEST_PHP_ARGS="$OPT -d extension=$PWD/modules/%{pecl_name}.so" \ NO_INTERACTION=1 \ REPORT_EXIT_STATUS=1 \ -%{__ztsphp} -n run-tests.php --show-diff || ret=1 +%{__ztsphp} -n run-tests.php -x --show-diff || ret=1 popd %endif # Cleanup if [ -f memcached.pid ]; then kill $(cat memcached.pid) + sleep 1 fi exit $ret @@ -358,7 +354,7 @@ exit $ret %changelog -* Thu Oct 8 2020 Remi Collet - 3.1.5-2 +* Thu Oct 8 2020 Remi Collet - 3.1.5-3 - add patches for PHP 8 from https://github.com/php-memcached-dev/php-memcached/pull/461 https://github.com/php-memcached-dev/php-memcached/pull/463 -- cgit