[PECL-CVS] [pecl-encryption-mcrypt] php86: PHP 8.6 support
[email protected] (Rasmus Lerdorf) Mon, 6 Apr 2026 12:26:09 +0000
| Newsgroups | php.pecl.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: Rasmus Lerdorf (rlerdorf)
Date: 2026-04-06T08:25:53-04:00
Commit: https://github.com/php/pecl-encryption-mcrypt/commit/7c308e7c8c3f12c67b977fee1ff8f9e0956b7293
Raw diff: https://github.com/php/pecl-encryption-mcrypt/commit/7c308e7c8c3f12c67b977fee1ff8f9e0956b7293.diff
PHP 8.6 support
Changed paths:
M .github/workflows/build.yml
M mcrypt_filter.c
Diff:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 6d1c535..388a0df 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -21,7 +21,7 @@ jobs:
id: extension-matrix
uses: php/php-windows-builder/extension-matrix@v1
with:
- php-version-list: '8.0, 8.1, 8.2, 8.3, 8.4, 8.5'
+ php-version-list: '8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6'
arch-list: 'x64'
windows:
@@ -49,7 +49,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- php: [8.0, 8.1, 8.2, 8.3, 8.4, 8.5]
+ php: [8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6]
use-opcache: [true, false]
experimental: [false]
steps:
diff --git a/mcrypt_filter.c b/mcrypt_filter.c
index 2bdb716..85d4138 100644
--- a/mcrypt_filter.c
+++ b/mcrypt_filter.c
@@ -140,6 +140,9 @@ static void php_mcrypt_filter_dtor(php_stream_filter *thisfilter)
static php_stream_filter_ops php_mcrypt_filter_ops = {
php_mcrypt_filter,
+#if PHP_VERSION_ID >= 80600
+ NULL, /* seek */
+#endif
php_mcrypt_filter_dtor,
"mcrypt.*"
};
@@ -147,15 +150,24 @@ static php_stream_filter_ops php_mcrypt_filter_ops = {
/* {{{ php_mcrypt_filter_create
* Instantiate mcrypt filter
*/
+#if PHP_VERSION_ID >= 80600
+static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval *filterparams, bool persistent)
+#else
static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval *filterparams, uint8_t persistent)
+#endif
{
int encrypt = 1, iv_len, key_len, keyl, result;
const char *cipher = filtername + sizeof("mcrypt.") - 1;
zval *tmpzval;
MCRYPT mcrypt_module;
char *iv = NULL, *key = NULL;
+#if PHP_VERSION_ID >= 80600
+ char *algo_dir = zend_ini_string_literal("mcrypt.algorithms_dir");
+ char *mode_dir = zend_ini_string_literal("mcrypt.modes_dir");
+#else
char *algo_dir = INI_STR("mcrypt.algorithms_dir");
char *mode_dir = INI_STR("mcrypt.modes_dir");
+#endif
char *mode = "cbc";
php_mcrypt_filter_data *data;
@@ -265,7 +277,11 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
data->block_used = 0;
data->persistent = persistent;
+#if PHP_VERSION_ID >= 80600
+ return php_stream_filter_alloc(&php_mcrypt_filter_ops, data, persistent, PSFS_SEEKABLE_NEVER);
+#else
return php_stream_filter_alloc(&php_mcrypt_filter_ops, data, persistent);
+#endif
}
/* }}} */