From 2bb6ae423b589fb579a34fb1e896c40e2ac75249 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 25 Jun 2017 08:17:51 +0200 Subject: add patch for 7.2 --- 358.patch | 188 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ php-pecl-yaf.spec | 17 ++++- 2 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 358.patch diff --git a/358.patch b/358.patch new file mode 100644 index 0000000..1468b2f --- /dev/null +++ b/358.patch @@ -0,0 +1,188 @@ +From 7c96eeac28e5bf9dcfc63abfbc7fd832247c78ee Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Sun, 25 Jun 2017 08:03:41 +0200 +Subject: [PATCH] fix for PHP 7.2 + +--- + configs/yaf_config_ini.c | 6 ++++-- + configs/yaf_config_simple.c | 6 ++++-- + requests/yaf_request_http.c | 2 +- + requests/yaf_request_simple.c | 2 +- + yaf_application.c | 2 +- + yaf_dispatcher.c | 2 +- + yaf_loader.c | 2 +- + yaf_registry.c | 2 +- + yaf_session.c | 10 ++++++---- + 9 files changed, 20 insertions(+), 14 deletions(-) + +diff --git a/configs/yaf_config_ini.c b/configs/yaf_config_ini.c +index 77e00c6..b7987b9 100644 +--- a/configs/yaf_config_ini.c ++++ b/configs/yaf_config_ini.c +@@ -31,7 +31,7 @@ + + zend_class_entry *yaf_config_ini_ce; + +-#ifdef HAVE_SPL ++#if defined(HAVE_SPL) && PHP_VERSION_ID < 70200 + extern PHPAPI zend_class_entry *spl_ce_Countable; + #endif + +@@ -654,8 +654,10 @@ YAF_STARTUP_FUNCTION(config_ini) { + YAF_INIT_CLASS_ENTRY(ce, "Yaf_Config_Ini", "Yaf\\Config\\Ini", yaf_config_ini_methods); + yaf_config_ini_ce = zend_register_internal_class_ex(&ce, yaf_config_ce); + +-#ifdef HAVE_SPL ++#if defined(HAVE_SPL) && PHP_VERSION_ID < 70200 + zend_class_implements(yaf_config_ini_ce, 3, zend_ce_iterator, zend_ce_arrayaccess, spl_ce_Countable); ++#elif PHP_VERSION_ID >= 70200 ++ zend_class_implements(yaf_config_ini_ce, 3, zend_ce_iterator, zend_ce_arrayaccess, zend_ce_countable); + #else + zend_class_implements(yaf_config_ini_ce, 2, zend_ce_iterator, zend_ce_arrayaccess); + #endif +diff --git a/configs/yaf_config_simple.c b/configs/yaf_config_simple.c +index 8718613..ecf2094 100644 +--- a/configs/yaf_config_simple.c ++++ b/configs/yaf_config_simple.c +@@ -30,7 +30,7 @@ + + zend_class_entry *yaf_config_simple_ce; + +-#ifdef HAVE_SPL ++#if defined(HAVE_SPL) && PHP_VERSION_ID < 70200 + extern PHPAPI zend_class_entry *spl_ce_Countable; + #endif + +@@ -365,8 +365,10 @@ YAF_STARTUP_FUNCTION(config_simple) { + YAF_INIT_CLASS_ENTRY(ce, "Yaf_Config_Simple", "Yaf\\Config\\Simple", yaf_config_simple_methods); + yaf_config_simple_ce = zend_register_internal_class_ex(&ce, yaf_config_ce); + +-#ifdef HAVE_SPL ++#if defined(HAVE_SPL) && PHP_VERSION_ID < 70200 + zend_class_implements(yaf_config_simple_ce, 3, zend_ce_iterator, zend_ce_arrayaccess, spl_ce_Countable); ++#elif PHP_VERSION_ID >= 70200 ++ zend_class_implements(yaf_config_simple_ce, 3, zend_ce_iterator, zend_ce_arrayaccess, zend_ce_countable); + #else + zend_class_implements(yaf_config_simple_ce, 2, zend_ce_iterator, zend_ce_arrayaccess); + #endif +diff --git a/requests/yaf_request_http.c b/requests/yaf_request_http.c +index 48cede1..2e0b263 100644 +--- a/requests/yaf_request_http.c ++++ b/requests/yaf_request_http.c +@@ -265,7 +265,7 @@ zend_function_entry yaf_request_http_methods[] = { + PHP_ME(yaf_request_http, get, NULL, ZEND_ACC_PUBLIC) + PHP_ME(yaf_request_http, isXmlHttpRequest, NULL, ZEND_ACC_PUBLIC) + PHP_ME(yaf_request_http, __construct, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) +- PHP_ME(yaf_request_http, __clone, NULL, ZEND_ACC_PRIVATE | ZEND_ACC_CLONE) ++ PHP_ME(yaf_request_http, __clone, NULL, ZEND_ACC_PRIVATE) + {NULL, NULL, NULL} + }; + /* }}} */ +diff --git a/requests/yaf_request_simple.c b/requests/yaf_request_simple.c +index 8652117..e4405c7 100644 +--- a/requests/yaf_request_simple.c ++++ b/requests/yaf_request_simple.c +@@ -234,7 +234,7 @@ PHP_METHOD(yaf_request_simple, __clone) { + */ + zend_function_entry yaf_request_simple_methods[] = { + PHP_ME(yaf_request_simple, __construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) +- PHP_ME(yaf_request_simple, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CLONE) ++ PHP_ME(yaf_request_simple, __clone, NULL, ZEND_ACC_PRIVATE) + PHP_ME(yaf_request_simple, getQuery, NULL, ZEND_ACC_PUBLIC) + PHP_ME(yaf_request_simple, getRequest, NULL, ZEND_ACC_PUBLIC) + PHP_ME(yaf_request_simple, getPost, NULL, ZEND_ACC_PUBLIC) +diff --git a/yaf_application.c b/yaf_application.c +index a4bc554..fe7ec77 100644 +--- a/yaf_application.c ++++ b/yaf_application.c +@@ -651,7 +651,7 @@ zend_function_entry yaf_application_methods[] = { + PHP_ME(yaf_application, getLastErrorMsg, yaf_application_void_arginfo, ZEND_ACC_PUBLIC) + PHP_ME(yaf_application, clearLastError, yaf_application_void_arginfo, ZEND_ACC_PUBLIC) + PHP_ME(yaf_application, __destruct, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_DTOR) +- PHP_ME(yaf_application, __clone, NULL, ZEND_ACC_PRIVATE | ZEND_ACC_CLONE) ++ PHP_ME(yaf_application, __clone, NULL, ZEND_ACC_PRIVATE) + PHP_ME(yaf_application, __sleep, NULL, ZEND_ACC_PRIVATE) + PHP_ME(yaf_application, __wakeup, NULL, ZEND_ACC_PRIVATE) + {NULL, NULL, NULL} +diff --git a/yaf_dispatcher.c b/yaf_dispatcher.c +index 9967972..f20b40a 100644 +--- a/yaf_dispatcher.c ++++ b/yaf_dispatcher.c +@@ -1314,7 +1314,7 @@ PHP_METHOD(yaf_dispatcher, __clone) { + */ + zend_function_entry yaf_dispatcher_methods[] = { + PHP_ME(yaf_dispatcher, __construct, NULL, ZEND_ACC_PRIVATE | ZEND_ACC_CTOR) +- PHP_ME(yaf_dispatcher, __clone, NULL, ZEND_ACC_PRIVATE | ZEND_ACC_CLONE) ++ PHP_ME(yaf_dispatcher, __clone, NULL, ZEND_ACC_PRIVATE) + PHP_ME(yaf_dispatcher, __sleep, NULL, ZEND_ACC_PRIVATE) + PHP_ME(yaf_dispatcher, __wakeup, NULL, ZEND_ACC_PRIVATE) + PHP_ME(yaf_dispatcher, enableView, yaf_dispatcher_void_arginfo, ZEND_ACC_PUBLIC) +diff --git a/yaf_loader.c b/yaf_loader.c +index 2010551..62e34e9 100644 +--- a/yaf_loader.c ++++ b/yaf_loader.c +@@ -764,7 +764,7 @@ PHP_FUNCTION(yaf_override_spl_autoload) { + */ + zend_function_entry yaf_loader_methods[] = { + PHP_ME(yaf_loader, __construct, yaf_loader_void_arginfo, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR) +- PHP_ME(yaf_loader, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CLONE) ++ PHP_ME(yaf_loader, __clone, NULL, ZEND_ACC_PRIVATE) + PHP_ME(yaf_loader, __sleep, NULL, ZEND_ACC_PRIVATE) + PHP_ME(yaf_loader, __wakeup, NULL, ZEND_ACC_PRIVATE) + PHP_ME(yaf_loader, autoload, yaf_loader_autoloader_arginfo, ZEND_ACC_PUBLIC) +diff --git a/yaf_registry.c b/yaf_registry.c +index e7649e7..891b47b 100644 +--- a/yaf_registry.c ++++ b/yaf_registry.c +@@ -186,7 +186,7 @@ PHP_METHOD(yaf_registry, getInstance) { + */ + zend_function_entry yaf_registry_methods[] = { + PHP_ME(yaf_registry, __construct, NULL, ZEND_ACC_CTOR|ZEND_ACC_PRIVATE) +- PHP_ME(yaf_registry, __clone, NULL, ZEND_ACC_CLONE|ZEND_ACC_PRIVATE) ++ PHP_ME(yaf_registry, __clone, NULL, ZEND_ACC_PRIVATE) + PHP_ME(yaf_registry, get, yaf_registry_get_arginfo, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(yaf_registry, has, yaf_registry_has_arginfo, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(yaf_registry, set, yaf_registry_set_arginfo, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) +diff --git a/yaf_session.c b/yaf_session.c +index 1b2d05f..ff48291 100644 +--- a/yaf_session.c ++++ b/yaf_session.c +@@ -19,7 +19,7 @@ + #endif + + #include "php.h" +-#include "Zend/zend_interfaces.h" /* for zend_ce_iterator */ ++#include "Zend/zend_interfaces.h" /* for zend_ce_iterator, zend_ce_countable*/ + + #include "php_yaf.h" + #include "yaf_namespace.h" +@@ -28,7 +28,7 @@ + + zend_class_entry *yaf_session_ce; + +-#ifdef HAVE_SPL ++#if defined(HAVE_SPL) && PHP_VERSION_ID < 70200 + extern PHPAPI zend_class_entry *spl_ce_Countable; + #endif + +@@ -320,7 +320,7 @@ PHP_METHOD(yaf_session, valid) { + */ + zend_function_entry yaf_session_methods[] = { + PHP_ME(yaf_session, __construct, NULL, ZEND_ACC_CTOR|ZEND_ACC_PRIVATE) +- PHP_ME(yaf_session, __clone, NULL, ZEND_ACC_CLONE|ZEND_ACC_PRIVATE) ++ PHP_ME(yaf_session, __clone, NULL, ZEND_ACC_PRIVATE) + PHP_ME(yaf_session, __sleep, NULL, ZEND_ACC_PRIVATE) + PHP_ME(yaf_session, __wakeup, NULL, ZEND_ACC_PRIVATE) + PHP_ME(yaf_session, getInstance, yaf_session_void_arginfo, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) +@@ -358,8 +358,10 @@ YAF_STARTUP_FUNCTION(session) { + yaf_session_ce = zend_register_internal_class_ex(&ce, NULL); + yaf_session_ce->ce_flags |= ZEND_ACC_FINAL; + +-#ifdef HAVE_SPL ++#if defined(HAVE_SPL) && PHP_VERSION_ID < 70200 + zend_class_implements(yaf_session_ce, 3, zend_ce_iterator, zend_ce_arrayaccess, spl_ce_Countable); ++#elif PHP_VERSION_ID >= 70200 ++ zend_class_implements(yaf_session_ce, 3, zend_ce_iterator, zend_ce_arrayaccess, zend_ce_countable); + #else + zend_class_implements(yaf_session_ce, 2, zend_ce_iterator, zend_ce_arrayaccess); + #endif diff --git a/php-pecl-yaf.spec b/php-pecl-yaf.spec index af4873a..78aa158 100644 --- a/php-pecl-yaf.spec +++ b/php-pecl-yaf.spec @@ -27,7 +27,7 @@ Version: 3.0.4 Release: 0.9.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz %else -Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz %endif License: PHP @@ -35,6 +35,8 @@ Group: Development/Languages URL: http://pecl.php.net/package/yaf Source1: %{pecl_name}.ini +Patch0: 358.patch + BuildRequires: %{?scl_prefix}php-devel >= 7 BuildRequires: %{?scl_prefix}php-pear BuildRequires: pcre-devel @@ -68,6 +70,10 @@ Obsoletes: php70w-pecl-%{pecl_name} <= %{version} Obsoletes: php71u-pecl-%{pecl_name} <= %{version} Obsoletes: php71w-pecl-%{pecl_name} <= %{version} %endif +%if "%{php_version}" > "7.2" +Obsoletes: php72u-pecl-%{pecl_name} <= %{version} +Obsoletes: php72w-pecl-%{pecl_name} <= %{version} +%endif %endif %if 0%{?fedora} < 20 && 0%{?rhel} < 7 @@ -99,6 +105,7 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS +%patch0 -p1 -b .pr358 # Sanity check, really often broken extver=$(sed -n '/#define PHP_YAF_VERSION/{s/.*\t"//;s/".*$//;p}' php_yaf.h ) @@ -115,6 +122,8 @@ cp -pr NTS ZTS %build +%{?dtsenable} + cd NTS %{_bindir}/phpize %configure --with-php-config=%{_bindir}/php-config @@ -129,6 +138,8 @@ make %{?_smp_mflags} %install +%{?dtsenable} + # Install the NTS stuff make -C NTS install INSTALL_ROOT=%{buildroot} install -D -m 644 %{SOURCE1} %{buildroot}%{php_inidir}/%{ini_name} @@ -218,6 +229,10 @@ fi %changelog +* Sun Jun 25 2017 Remi Collet - 3.0.4-4 +- add patch for PHP 7.2 from + https://github.com/laruence/yaf/pull/358 + * Thu Dec 1 2016 Remi Collet - 3.0.4-3 - rebuild with PHP 7.1.0 GA -- cgit