www/pecl-yaf: Fix build with php84

Obtained from:	b1d252c944
This commit is contained in:
Po-Chuan Hsieh
2024-07-30 03:03:02 +08:00
parent 6ecf81cce5
commit 906e82b403
2 changed files with 46 additions and 1 deletions

View File

@@ -13,6 +13,5 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
USES= localbase php:pecl
CFLAGS+= -DZEND_HOT=
IGNORE_WITH_PHP=84
.include <bsd.port.mk>

View File

@@ -0,0 +1,46 @@
Obtained from: https://github.com/laruence/yaf/commit/b1d252c944a8d70f0dc28415b3d67a7b3bbbf7ce
--- routes/yaf_route_regex.c.orig 2024-06-25 03:13:57 UTC
+++ routes/yaf_route_regex.c
@@ -204,11 +204,18 @@ static int yaf_route_regex_match(yaf_route_regex_objec
#if PHP_VERSION_ID < 70400
php_pcre_match_impl(pce_regexp, (char*)uri, len, &matches, &subparts /* subpats */,
0/* global */, 0/* ZEND_NUM_ARGS() >= 4 */, 0/*flags PREG_OFFSET_CAPTURE*/, 0/* start_offset */);
-#else
+#elif PHP_VERSION_ID < 80400
{
zend_string *tmp = zend_string_init(uri, len, 0);
php_pcre_match_impl(pce_regexp, tmp, &matches, &subparts /* subpats */,
0/* global */, 0/* ZEND_NUM_ARGS() >= 4 */, 0/*flags PREG_OFFSET_CAPTURE*/, 0/* start_offset */);
+ zend_string_release(tmp);
+ }
+#else
+ {
+ zend_string *tmp = zend_string_init(uri, len, 0);
+ php_pcre_match_impl(pce_regexp, tmp, &matches, &subparts /* subpats */,
+ 0/* global */, 0/*flags PREG_OFFSET_CAPTURE*/, 0/* start_offset */);
zend_string_release(tmp);
}
#endif
--- routes/yaf_route_rewrite.c.orig 2024-06-25 03:13:57 UTC
+++ routes/yaf_route_rewrite.c
@@ -209,11 +209,18 @@ static int yaf_route_rewrite_match(yaf_route_rewrite_o
#if PHP_VERSION_ID < 70400
php_pcre_match_impl(pce_regexp, (char*)uri, len, &matches, &subparts /* subpats */,
0/* global */, 0/* ZEND_NUM_ARGS() >= 4 */, 0/*flags PREG_OFFSET_CAPTURE*/, 0/* start_offset */);
-#else
+#elif PHP_VERSION_ID <80400
{
zend_string *tmp = zend_string_init(uri, len, 0);
php_pcre_match_impl(pce_regexp, tmp, &matches, &subparts /* subpats */,
0/* global */, 0/* ZEND_NUM_ARGS() >= 4 */, 0/*flags PREG_OFFSET_CAPTURE*/, 0/* start_offset */);
+ zend_string_release(tmp);
+ }
+#else
+ {
+ zend_string *tmp = zend_string_init(uri, len, 0);
+ php_pcre_match_impl(pce_regexp, tmp, &matches, &subparts /* subpats */,
+ 0/* global */, 0/*flags PREG_OFFSET_CAPTURE*/, 0/* start_offset */);
zend_string_release(tmp);
}
#endif