diff options
author | Valentin Bartenev <vbart@nginx.com> | 2021-05-21 14:41:35 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2021-05-21 14:41:35 +0300 |
commit | 539551c89f4028ed70e5881400fc9151af3d12e8 (patch) | |
tree | 063d7c894798746567e56c2b5f28840f8a2a79b8 /src | |
parent | e50bb120e2a2dfad55d28724133656264ef13dc8 (diff) | |
download | unit-539551c89f4028ed70e5881400fc9151af3d12e8.tar.gz unit-539551c89f4028ed70e5881400fc9151af3d12e8.tar.bz2 |
PHP: adopted "file_handle" to Zend API changes in 8.1.0-dev.
This fixes building module with the development version of PHP after the change:
https://github.com/php/php-src/commit/c732ab400af92c54eee47c487a56009f1d79dd5d
Diffstat (limited to 'src')
-rw-r--r-- | src/nxt_php_sapi.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nxt_php_sapi.c b/src/nxt_php_sapi.c index 23c148c8..3fb3b0db 100644 --- a/src/nxt_php_sapi.c +++ b/src/nxt_php_sapi.c @@ -1101,10 +1101,20 @@ nxt_php_execute(nxt_php_run_ctx_t *ctx, nxt_unit_request_t *r) nxt_memzero(&file_handle, sizeof(file_handle)); file_handle.type = ZEND_HANDLE_FILENAME; +#if (PHP_VERSION_ID >= 80100) + file_handle.filename = zend_string_init((char *) ctx->script_filename.start, + ctx->script_filename.length, 0); + file_handle.primary_script = 1; +#else file_handle.filename = (char *) ctx->script_filename.start; +#endif php_execute_script(&file_handle TSRMLS_CC); +#if (PHP_VERSION_ID >= 80100) + zend_destroy_file_handle(&file_handle); +#endif + /* Prevention of consuming possible unread request body. */ #if (PHP_VERSION_ID < 50600) read_post = sapi_module.read_post; |