summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--0001-remove-trailing-space.patch4
-rw-r--r--0002-relax-test-expectations-for-8.4.patch4
-rw-r--r--0003-Fix-for-PHP-8.5.patch129
-rw-r--r--php-pecl-yaf.spec19
4 files changed, 147 insertions, 9 deletions
diff --git a/0001-remove-trailing-space.patch b/0001-remove-trailing-space.patch
index 69f8efe..ad156a9 100644
--- a/0001-remove-trailing-space.patch
+++ b/0001-remove-trailing-space.patch
@@ -1,7 +1,7 @@
From 6553d00c0d103b1abe530c9dfdc2e37a6f8875f9 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Tue, 1 Oct 2024 12:00:16 +0200
-Subject: [PATCH] remove trailing space
+Subject: [PATCH 1/3] remove trailing space
---
config.m4 | 2 +-
@@ -21,5 +21,5 @@ index 73f8097..68f14fa 100644
yaf_loader.c \
yaf_registry.c \
--
-2.46.2
+2.50.1
diff --git a/0002-relax-test-expectations-for-8.4.patch b/0002-relax-test-expectations-for-8.4.patch
index 977d26d..ff26364 100644
--- a/0002-relax-test-expectations-for-8.4.patch
+++ b/0002-relax-test-expectations-for-8.4.patch
@@ -1,7 +1,7 @@
From 5ddaa82f4c43eeac372b8c1ebe606ebff43829a8 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Tue, 1 Oct 2024 12:04:15 +0200
-Subject: [PATCH 2/2] relax test expectations for 8.4
+Subject: [PATCH 2/3] relax test expectations for 8.4
---
tests/038.phpt | 2 +-
@@ -30,5 +30,5 @@ index bac421d..2564aa9 100755
-syntax error, unexpected %s}%c
+syntax error, unexpected %s
--
-2.46.2
+2.50.1
diff --git a/0003-Fix-for-PHP-8.5.patch b/0003-Fix-for-PHP-8.5.patch
new file mode 100644
index 0000000..d38d12d
--- /dev/null
+++ b/0003-Fix-for-PHP-8.5.patch
@@ -0,0 +1,129 @@
+From af27b18c2112114b2dfd18e535ceb1846282823a Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Fri, 18 Jul 2025 10:18:56 +0200
+Subject: [PATCH 3/3] Fix for PHP 8.5
+
+- use zend_ce_exception instead of zend_exception_get_default
+- use ZSTR_ALLOCA_* instead of STR_ALLOCA_*
+- relax test expectation in error message
+---
+ tests/104.phpt | 2 +-
+ yaf_dispatcher.c | 18 +++++++++---------
+ yaf_exception.c | 2 +-
+ yaf_request.c | 2 +-
+ 4 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/tests/104.phpt b/tests/104.phpt
+index 797a35a..6eb545c 100644
+--- a/tests/104.phpt
++++ b/tests/104.phpt
+@@ -174,4 +174,4 @@ string(%s) "Failed opening action script %sindex.php: No such file or directory"
+ string(61) "Action 'IndexAction' is not a subclass of Yaf_Action_Abstract"
+ string(61) "Action 'IndexAction' is not a subclass of Yaf_Action_Abstract"
+
+-Fatal error: Class FooAction contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Yaf_Action_Abstract::execute) in %sfoo.php on line %d
++Fatal error: Class FooAction contains 1 abstract method and must therefore be declared abstract or implement the remaining method%s(Yaf_Action_Abstract::execute) in %sfoo.php on line %d
+diff --git a/yaf_dispatcher.c b/yaf_dispatcher.c
+index 6bf98f9..c585bb0 100644
+--- a/yaf_dispatcher.c
++++ b/yaf_dispatcher.c
+@@ -21,7 +21,7 @@
+ #include "php.h"
+ #include "main/SAPI.h" /* for sapi_module */
+ #include "Zend/zend_interfaces.h" /* for zend_call_method_with_* */
+-#include "Zend/zend_exceptions.h" /* for zend_exception_get_default */
++#include "Zend/zend_exceptions.h" /* for zend_ce_exception */
+
+ #include "php_yaf.h"
+ #include "yaf_namespace.h"
+@@ -355,7 +355,7 @@ static zend_class_entry *yaf_dispatcher_get_controller(zend_string *app_dir, yaf
+ directory_len += yaf_compose_2_pathes(directory + directory_len, module, ZEND_STRL(YAF_CONTROLLER_DIRECTORY_NAME));
+ }
+
+- STR_ALLOCA_ALLOC(lc_name, ZSTR_LEN(controller) + YAF_G(name_separator_len) + sizeof("controller") - 1, use_heap);
++ ZSTR_ALLOCA_ALLOC(lc_name, ZSTR_LEN(controller) + YAF_G(name_separator_len) + sizeof("controller") - 1, use_heap);
+ if (EXPECTED(yaf_is_name_suffix())) {
+ char *p = ZSTR_VAL(lc_name);
+ zend_str_tolower_copy(p, ZSTR_VAL(controller), ZSTR_LEN(controller));
+@@ -381,15 +381,15 @@ static zend_class_entry *yaf_dispatcher_get_controller(zend_string *app_dir, yaf
+ if (yaf_loader_load_internal(l, ZSTR_VAL(controller), ZSTR_LEN(controller), directory, directory_len)) {
+ if (EXPECTED((ce = zend_hash_find_ptr(EG(class_table), lc_name)))) {
+ if (EXPECTED(instanceof_function(ce, yaf_controller_ce))) {
+- STR_ALLOCA_FREE(lc_name, use_heap);
++ ZSTR_ALLOCA_FREE(lc_name, use_heap);
+ return ce;
+ }
+ }
+ }
+- STR_ALLOCA_FREE(lc_name, use_heap);
++ ZSTR_ALLOCA_FREE(lc_name, use_heap);
+ return yaf_dispatcher_get_errors_hub(1, ce, controller, directory, directory_len);
+ }
+- STR_ALLOCA_FREE(lc_name, use_heap);
++ ZSTR_ALLOCA_FREE(lc_name, use_heap);
+ return ce;
+ }
+ /* }}} */
+@@ -417,7 +417,7 @@ static zend_class_entry *yaf_dispatcher_get_action(zend_string *app_dir, yaf_con
+ zend_string *lc_name;
+ ALLOCA_FLAG(use_heap);
+
+- STR_ALLOCA_ALLOC(lc_name, ZSTR_LEN(action) + YAF_G(name_separator_len) + sizeof("action") - 1, use_heap);
++ ZSTR_ALLOCA_ALLOC(lc_name, ZSTR_LEN(action) + YAF_G(name_separator_len) + sizeof("action") - 1, use_heap);
+ if (EXPECTED(yaf_is_name_suffix())) {
+ char *p = ZSTR_VAL(lc_name);
+ memcpy(p, ZSTR_VAL(action), ZSTR_LEN(action));
+@@ -440,7 +440,7 @@ static zend_class_entry *yaf_dispatcher_get_action(zend_string *app_dir, yaf_con
+
+ if ((ce = zend_hash_find_ptr(EG(class_table), lc_name)) != NULL) {
+ if (EXPECTED(instanceof_function(ce, yaf_action_ce))) {
+- STR_ALLOCA_FREE(lc_name, use_heap);
++ ZSTR_ALLOCA_FREE(lc_name, use_heap);
+ return ce;
+ }
+ } else if (((pzval = zend_hash_find_ind(Z_ARRVAL_P(actions_map), action)) != NULL) &&
+@@ -453,13 +453,13 @@ static zend_class_entry *yaf_dispatcher_get_action(zend_string *app_dir, yaf_con
+ if (yaf_loader_import(path, len)) {
+ if ((ce = zend_hash_find_ptr(EG(class_table), lc_name)) != NULL) {
+ if (EXPECTED(instanceof_function(ce, yaf_action_ce))) {
+- STR_ALLOCA_FREE(lc_name, use_heap);
++ ZSTR_ALLOCA_FREE(lc_name, use_heap);
+ return ce;
+ }
+ }
+ }
+ }
+- STR_ALLOCA_FREE(lc_name, use_heap);
++ ZSTR_ALLOCA_FREE(lc_name, use_heap);
+ }
+
+ return yaf_dispatcher_get_errors_hub(2, ce, actions_map, action, controller, path);
+diff --git a/yaf_exception.c b/yaf_exception.c
+index e987756..9e25b5b 100644
+--- a/yaf_exception.c
++++ b/yaf_exception.c
+@@ -73,7 +73,7 @@ zend_class_entry * yaf_get_exception_base(int root) /* {{{ */ {
+ }
+ #endif
+
+- return zend_exception_get_default();
++ return zend_ce_exception;
+ }
+ /* }}} */
+
+diff --git a/yaf_request.c b/yaf_request.c
+index e4869c5..372823a 100644
+--- a/yaf_request.c
++++ b/yaf_request.c
+@@ -21,7 +21,7 @@
+ #include "php.h"
+ #include "main/SAPI.h"
+ #include "standard/php_string.h" /* for php_basename */
+-#include "Zend/zend_exceptions.h" /* for zend_exception_get_default */
++#include "Zend/zend_exceptions.h" /* for zend_ce_exception */
+ #include "Zend/zend_interfaces.h" /* for zend_class_serialize_deny */
+ #include "Zend/zend_smart_str.h"
+
+--
+2.50.1
+
diff --git a/php-pecl-yaf.spec b/php-pecl-yaf.spec
index 3600747..d2f13b7 100644
--- a/php-pecl-yaf.spec
+++ b/php-pecl-yaf.spec
@@ -1,8 +1,8 @@
# remirepo spec file for php-pecl-yaf
#
-# Copyright (c) 2012-2024 Remi Collet
-# License: CC-BY-SA
-# http://creativecommons.org/licenses/by-sa/4.0/
+# SPDX-FileCopyrightText: Copyright 2012-2025 Remi Collet
+# SPDX-License-Identifier: CECILL-2.1
+# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
#
# Please, preserve the changelog entries
#
@@ -24,7 +24,7 @@
Summary: Yet Another Framework
Name: %{?scl_prefix}php-pecl-yaf
Version: 3.3.6
-Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 5%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: PHP-3.01
URL: https://pecl.php.net/package/yaf
Source0: https://pecl.php.net/get/%{sources}%{?prever}.tgz
@@ -33,12 +33,12 @@ Source1: %{pecl_name}.ini
Patch0: %{pecl_name}-upstream.patch
Patch1: 0001-remove-trailing-space.patch
Patch2: 0002-relax-test-expectations-for-8.4.patch
+Patch3: 0003-Fix-for-PHP-8.5.patch
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7.0
BuildRequires: %{?scl_prefix}php-pear
-BuildRequires: pcre-devel
# for tests
BuildRequires: %{?scl_prefix}php-json
@@ -70,6 +70,7 @@ cd %{sources}
%patch -P0 -p1
%patch -P1 -p1
%patch -P2 -p1
+%patch -P3 -p1
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_YAF_VERSION/{s/.*\t"//;s/".*$//;p}' php_yaf.h )
@@ -171,6 +172,14 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Fri Jul 18 2025 Remi Collet <remi@remirepo.net> - 3.3.6-5
+- fix PHP 8.5.0alpha2 build using patch from
+ https://github.com/laruence/yaf/pull/594
+- re-license spec file to CECILL-2.1
+
+* Tue Nov 26 2024 Remi Collet <remi@remirepo.net> - 3.3.6-4
+- drop BR on pcre-devel
+
* Tue Oct 1 2024 Remi Collet <remi@remirepo.net> - 3.3.6-3
- fix PHP 8.4 build using patch from
https://github.com/laruence/yaf/pull/594