git: 224276f9e357 - main - converters/pecl-igbinary-session: New port: Replacement for the standard PHP serializer (+session support)

Jesús Daniel Colmenares Oviedo <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.ports
Message-ID <[email protected]>
The branch main has been updated by dtxdf:

URL: https://cgit.FreeBSD.org/ports/commit/?id=224276f9e3574431aa26a00615982cd84ba2b27e

commit 224276f9e3574431aa26a00615982cd84ba2b27e
Author:     Jesús Daniel Colmenares Oviedo <[email protected]>
AuthorDate: 2026-08-16 06:00:17 +0000
Commit:     Jesús Daniel Colmenares Oviedo <[email protected]>
CommitDate: 2026-08-16 06:01:53 +0000

    converters/pecl-igbinary-session: New port: Replacement for the standard PHP serializer (+session support)
    
    Igbinary is a drop in replacement for the standard PHP serializer.
    Instead of time and space consuming textual representation, igbinary
    stores PHP data structures in a compact binary form. Savings are
    significant when using memcached or similar memory based storages for
    serialized data.
    
    This port supports sessions, a feature that is only available when the
    session module is statically compiled into PHP. This port patch igbinary
    to use the dynamically compiled session module.
    
    WWW: https://pecl.php.net/package/igbinary
---
 converters/Makefile                                |  1 +
 converters/pecl-igbinary-session/Makefile          | 27 +++++++++
 converters/pecl-igbinary-session/distinfo          |  3 +
 converters/pecl-igbinary-session/files/patch-php85 | 11 ++++
 .../files/patch-src_php7_igbinary.c                | 69 ++++++++++++++++++++++
 converters/pecl-igbinary-session/pkg-descr         |  9 +++
 converters/pecl-igbinary/Makefile                  |  2 +
 7 files changed, 122 insertions(+)

diff --git a/converters/Makefile b/converters/Makefile
index 7c92c2e35959..677b902eaf87 100644
--- a/converters/Makefile
+++ b/converters/Makefile
@@ -138,6 +138,7 @@
     SUBDIR += p5-plutil
     SUBDIR += pear-Services_JSON
     SUBDIR += pecl-igbinary
+    SUBDIR += pecl-igbinary-session
     SUBDIR += php-bsdconv
     SUBDIR += php82-iconv
     SUBDIR += php82-mbstring
diff --git a/converters/pecl-igbinary-session/Makefile b/converters/pecl-igbinary-session/Makefile
new file mode 100644
index 000000000000..49614a73939e
--- /dev/null
+++ b/converters/pecl-igbinary-session/Makefile
@@ -0,0 +1,27 @@
+PORTNAME=	igbinary-session
+DISTVERSION=	3.2.16
+CATEGORIES=	converters
+DISTNAME=	igbinary-${DISTVERSION}
+
+MAINTAINER=	[email protected]
+COMMENT=	Replacement for the standard PHP serializer (+session support)
+WWW=		https://pecl.php.net/package/igbinary \
+		https://github.com/igbinary/igbinary
+
+LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/COPYING
+
+BUILD_DEPENDS=	${PECL_PKGNAMEPREFIX}APCu>=0:devel/pecl-APCu@${PHP_FLAVOR}
+
+USES=		php:pecl
+USE_PHP=	session:build
+
+PHP_MODNAME=	igbinary
+
+CONFLICTS=	pecl-igbinary
+
+post-patch:
+	@${CP} ${WRKSRC}/src/php7/igbinary.h ${WRKSRC}/igbinary.h
+	@${CP} ${WRKSRC}/src/php7/php_igbinary.h ${WRKSRC}/php_igbinary.h
+
+.include <bsd.port.mk>
diff --git a/converters/pecl-igbinary-session/distinfo b/converters/pecl-igbinary-session/distinfo
new file mode 100644
index 000000000000..d10849c30e53
--- /dev/null
+++ b/converters/pecl-igbinary-session/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1786856364
+SHA256 (PECL/igbinary-3.2.16.tgz) = 8bf25d465abc7973d9e2c9a3039a5f8eea635b23bc1477017ff3999ff95836da
+SIZE (PECL/igbinary-3.2.16.tgz) = 103279
diff --git a/converters/pecl-igbinary-session/files/patch-php85 b/converters/pecl-igbinary-session/files/patch-php85
new file mode 100644
index 000000000000..dad6450cd9f5
--- /dev/null
+++ b/converters/pecl-igbinary-session/files/patch-php85
@@ -0,0 +1,11 @@
+--- src/php7/php_igbinary.h.orig	2024-08-10 16:55:30 UTC
++++ src/php7/php_igbinary.h
+@@ -32,7 +32,7 @@ ZEND_END_MODULE_GLOBALS(igbinary)
+ #include "TSRM.h"
+ #endif
+ 
+-#include "ext/standard/php_smart_string.h"
++#include "Zend/zend_smart_string.h"
+ 
+ /** Module init function. */
+ PHP_MINIT_FUNCTION(igbinary);
diff --git a/converters/pecl-igbinary-session/files/patch-src_php7_igbinary.c b/converters/pecl-igbinary-session/files/patch-src_php7_igbinary.c
new file mode 100644
index 000000000000..07583ea78e05
--- /dev/null
+++ b/converters/pecl-igbinary-session/files/patch-src_php7_igbinary.c
@@ -0,0 +1,69 @@
+--- src/php7/igbinary.c.orig	2026-08-16 05:00:40 UTC
++++ src/php7/igbinary.c
+@@ -28,7 +28,7 @@
+ #include "Zend/zend_enum.h"
+ #endif
+ 
+-#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
++#if HAVE_PHP_SESSION
+ # include "ext/session/php_session.h"
+ #endif
+ 
+@@ -69,10 +69,10 @@
+ #include "zend_alloc.h"
+ #include "igbinary_zend_hash.h"
+ 
+-#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
++#if HAVE_PHP_SESSION
+ /** Session serializer function prototypes. */
+ PS_SERIALIZER_FUNCS(igbinary);
+-#endif /* HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) */
++#endif /* HAVE_PHP_SESSION */
+ 
+ #if defined(HAVE_APCU_SUPPORT)
+ /** Apc serializer function prototypes */
+@@ -353,7 +353,7 @@ static const zend_module_dep igbinary_module_deps[] = 
+ /* {{{ igbinary dependencies */
+ static const zend_module_dep igbinary_module_deps[] = {
+ 	ZEND_MOD_REQUIRED("standard")
+-#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
++#if HAVE_PHP_SESSION
+ 	ZEND_MOD_REQUIRED("session")
+ #endif
+ #if defined(HAVE_APCU_SUPPORT)
+@@ -409,7 +409,7 @@ PHP_MINIT_FUNCTION(igbinary) {
+ 	(void)module_number;
+ 	ZEND_INIT_MODULE_GLOBALS(igbinary, php_igbinary_init_globals, NULL);
+ 
+-#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
++#if HAVE_PHP_SESSION
+ 	php_session_register_serializer("igbinary",
+ 		PS_SERIALIZER_ENCODE_NAME(igbinary),
+ 		PS_SERIALIZER_DECODE_NAME(igbinary));
+@@ -460,7 +460,7 @@ PHP_MINFO_FUNCTION(igbinary) {
+ #else
+ 	php_info_print_table_row(2, "igbinary APCu serializer ABI", "no");
+ #endif
+-#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
++#if HAVE_PHP_SESSION
+ 	php_info_print_table_row(2, "igbinary session support", "yes");
+ #else
+ 	php_info_print_table_row(2, "igbinary session support", "no");
+@@ -855,7 +855,7 @@ PHP_FUNCTION(igbinary_serialize) {
+ 	efree(string);
+ }
+ /* }}} */
+-#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
++#if HAVE_PHP_SESSION
+ /* {{{ Serializer encode function */
+ /**
+  * This provides a serializer encode function for PHP's session module (using igbinary),
+@@ -974,7 +974,7 @@ deinit:
+ 	return SUCCESS;
+ }
+ /* }}} */
+-#endif /* HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) */
++#endif /* HAVE_PHP_SESSION */
+ 
+ #if defined(HAVE_APCU_SUPPORT)
+ /* {{{ apc_serialize function */
diff --git a/converters/pecl-igbinary-session/pkg-descr b/converters/pecl-igbinary-session/pkg-descr
new file mode 100644
index 000000000000..259132a96c61
--- /dev/null
+++ b/converters/pecl-igbinary-session/pkg-descr
@@ -0,0 +1,9 @@
+Igbinary is a drop in replacement for the standard PHP serializer.
+Instead of time and space consuming textual representation, igbinary
+stores PHP data structures in a compact binary form. Savings are
+significant when using memcached or similar memory based storages for
+serialized data.
+
+This port supports sessions, a feature that is only available when the
+session module is statically compiled into PHP. This port patch igbinary
+to use the dynamically compiled session module.
diff --git a/converters/pecl-igbinary/Makefile b/converters/pecl-igbinary/Makefile
index a008161cd662..9b0e699c6e91 100644
--- a/converters/pecl-igbinary/Makefile
+++ b/converters/pecl-igbinary/Makefile
@@ -12,6 +12,8 @@ LICENSE_FILE=	${WRKSRC}/COPYING
 
 USES=		php:pecl
 
+CONFLICTS=	pecl-igbinary-session
+
 post-patch:
 # Install the real header files
 	@${CP} ${WRKSRC}/src/php7/igbinary.h ${WRKSRC}/igbinary.h
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.