[PECL-CVS] [pecl-file_formats-lzf] master: fix for extended php_stream_filter_ops with seek method in PHP 8.6

[email protected] (Remi Collet) Fri, 17 Jul 2026 08:28:39 +0000
Newsgroups php.pecl.cvs
Message-ID <[email protected]>
Author: Remi Collet (remicollet)
Date: 2026-07-17T10:28:31+02:00

Commit: https://github.com/php/pecl-file_formats-lzf/commit/f965c93e51d261b2b48f5a8bcf5c76f2d847c202
Raw diff: https://github.com/php/pecl-file_formats-lzf/commit/f965c93e51d261b2b48f5a8bcf5c76f2d847c202.diff

fix for extended php_stream_filter_ops with seek method in PHP 8.6

Changed paths:
  M  filter.c
  M  package.xml


Diff:

diff --git a/filter.c b/filter.c
index f3e9117..4d11963 100644
--- a/filter.c
+++ b/filter.c
@@ -235,17 +235,27 @@ static void lzf_filter_state_dtor(php_stream_filter *thisfilter)
 
 static php_stream_filter_ops lzf_compress_ops = {
 	lzf_compress_filter,
+#if PHP_VERSION_ID >= 80600
+	NULL,
+#endif
 	lzf_filter_state_dtor,
 	"lzf.compress"
 };
 
 static php_stream_filter_ops lzf_decompress_ops = {
 	lzf_decompress_filter,
+#if PHP_VERSION_ID >= 80600
+	NULL,
+#endif
 	lzf_filter_state_dtor,
 	"lzf.decompress"
 };
 
+#if PHP_VERSION_ID >= 80600
+static php_stream_filter *lzf_compress_filter_create(const char *filtername, zval *filterparams, bool persistent)
+#else
 static php_stream_filter *lzf_compress_filter_create(const char *filtername, zval *filterparams, uint8_t persistent)
+#endif
 {
 	php_lzf_filter_state *inst;
 
@@ -258,10 +268,18 @@ static php_stream_filter *lzf_compress_filter_create(const char *filtername, zva
 		return NULL;
 	}
 
+#if PHP_VERSION_ID >= 80600
+	return php_stream_filter_alloc(&lzf_compress_ops, inst, persistent, PSFS_SEEKABLE_NEVER, PSFS_SEEKABLE_NEVER);
+#else
 	return php_stream_filter_alloc(&lzf_compress_ops, inst, persistent);
+#endif
 }
 
+#if PHP_VERSION_ID >= 80600
+static php_stream_filter *lzf_decompress_filter_create(const char *filtername, zval *filterparams, bool persistent)
+#else
 static php_stream_filter *lzf_decompress_filter_create(const char *filtername, zval *filterparams, uint8_t persistent)
+#endif
 {
 	php_lzf_filter_state *inst;
 
@@ -274,7 +292,11 @@ static php_stream_filter *lzf_decompress_filter_create(const char *filtername, z
 		return NULL;
 	}
 
+#if PHP_VERSION_ID >= 80600
+	return php_stream_filter_alloc(&lzf_decompress_ops, inst, persistent, PSFS_SEEKABLE_NEVER, PSFS_SEEKABLE_NEVER);
+#else
 	return php_stream_filter_alloc(&lzf_decompress_ops, inst, persistent);
+#endif
 }
 
 php_stream_filter_factory php_lzf_compress_filter_factory = {
diff --git a/package.xml b/package.xml
index 805bb3b..56fd28a 100644
--- a/package.xml
+++ b/package.xml
@@ -20,7 +20,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
   <email>[email protected]</email>
   <active>yes</active>
  </lead>
- <date>2022-01-04</date>
+ <date>2026-07-17</date>
  <version>
   <release>1.7.1dev</release>
   <api>1.7.0</api>
@@ -31,7 +31,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
  </stability>
  <license uri="http://www.php.net/license">PHP License</license>
  <notes>
--
+- fix for extended php_stream_filter_ops with seek method in PHP 8.6
  </notes>
  <contents>
   <dir name="/">