Skip to content

Commit 7c308e7

Browse files
committed
PHP 8.6 support
1 parent 9f4289a commit 7c308e7

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
id: extension-matrix
2222
uses: php/php-windows-builder/extension-matrix@v1
2323
with:
24-
php-version-list: '8.0, 8.1, 8.2, 8.3, 8.4, 8.5'
24+
php-version-list: '8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6'
2525
arch-list: 'x64'
2626

2727
windows:
@@ -49,7 +49,7 @@ jobs:
4949
strategy:
5050
fail-fast: false
5151
matrix:
52-
php: [8.0, 8.1, 8.2, 8.3, 8.4, 8.5]
52+
php: [8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6]
5353
use-opcache: [true, false]
5454
experimental: [false]
5555
steps:

mcrypt_filter.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,22 +140,34 @@ static void php_mcrypt_filter_dtor(php_stream_filter *thisfilter)
140140

141141
static php_stream_filter_ops php_mcrypt_filter_ops = {
142142
php_mcrypt_filter,
143+
#if PHP_VERSION_ID >= 80600
144+
NULL, /* seek */
145+
#endif
143146
php_mcrypt_filter_dtor,
144147
"mcrypt.*"
145148
};
146149

147150
/* {{{ php_mcrypt_filter_create
148151
* Instantiate mcrypt filter
149152
*/
153+
#if PHP_VERSION_ID >= 80600
154+
static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval *filterparams, bool persistent)
155+
#else
150156
static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval *filterparams, uint8_t persistent)
157+
#endif
151158
{
152159
int encrypt = 1, iv_len, key_len, keyl, result;
153160
const char *cipher = filtername + sizeof("mcrypt.") - 1;
154161
zval *tmpzval;
155162
MCRYPT mcrypt_module;
156163
char *iv = NULL, *key = NULL;
164+
#if PHP_VERSION_ID >= 80600
165+
char *algo_dir = zend_ini_string_literal("mcrypt.algorithms_dir");
166+
char *mode_dir = zend_ini_string_literal("mcrypt.modes_dir");
167+
#else
157168
char *algo_dir = INI_STR("mcrypt.algorithms_dir");
158169
char *mode_dir = INI_STR("mcrypt.modes_dir");
170+
#endif
159171
char *mode = "cbc";
160172
php_mcrypt_filter_data *data;
161173

@@ -265,7 +277,11 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
265277
data->block_used = 0;
266278
data->persistent = persistent;
267279

280+
#if PHP_VERSION_ID >= 80600
281+
return php_stream_filter_alloc(&php_mcrypt_filter_ops, data, persistent, PSFS_SEEKABLE_NEVER);
282+
#else
268283
return php_stream_filter_alloc(&php_mcrypt_filter_ops, data, persistent);
284+
#endif
269285
}
270286
/* }}} */
271287

0 commit comments

Comments
 (0)