diff options
author | Remi Collet <remi@remirepo.net> | 2021-11-30 10:06:23 +0100 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2021-11-30 10:06:23 +0100 |
commit | cd1dd050d4e079fd3afbadefe5859965b50c59ee (patch) | |
tree | 8a7a3a8a0bf1a3b544eaaf35668f2ccef2552c13 /66.patch | |
parent | 59b4dc422645e45b83ebecca8623d40c4d40bdd1 (diff) |
add patch for PHP 8.1 from https://github.com/laruence/yaconf/pull/66
Diffstat (limited to '66.patch')
-rw-r--r-- | 66.patch | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/66.patch b/66.patch new file mode 100644 index 0000000..beaf8be --- /dev/null +++ b/66.patch @@ -0,0 +1,72 @@ +From 9ecaca42f0d168340e9f064c6756cd2404a090c6 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Tue, 30 Nov 2021 10:01:15 +0100 +Subject: [PATCH] zend_string instead of char * on PHP 8.1 + +--- + yaconf.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/yaconf.c b/yaconf.c +index a4869c7..9431aa7 100644 +--- a/yaconf.c ++++ b/yaconf.c +@@ -613,7 +613,11 @@ PHP_MINIT_FUNCTION(yaconf) + if (S_ISREG(sb.st_mode)) { + yaconf_filenode node; + if ((fh.handle.fp = VCWD_FOPEN(ini_file, "r"))) { ++#if PHP_VERSION_ID >= 80100 ++ fh.filename = zend_string_init(ini_file, strlen(ini_file), 0); ++#else + fh.filename = ini_file; ++#endif + fh.type = ZEND_HANDLE_FP; + ZVAL_UNDEF(&active_ini_file_section); + YACONF_G(parse_err) = 0; +@@ -623,8 +627,14 @@ PHP_MINIT_FUNCTION(yaconf) + YACONF_G(parse_err) = 0; + php_yaconf_hash_destroy(Z_ARRVAL(result)); + free(namelist[i]); ++#if PHP_VERSION_ID >= 80100 ++ zend_string_release(fh.filename); ++#endif + continue; + } ++#if PHP_VERSION_ID >= 80100 ++ zend_string_release(fh.filename); ++#endif + } + + php_yaconf_symtable_update(ini_containers, namelist[i]->d_name, p - namelist[i]->d_name, &result); +@@ -703,7 +713,11 @@ PHP_RINIT_FUNCTION(yaconf) + } + + if ((fh.handle.fp = VCWD_FOPEN(ini_file, "r"))) { ++#if PHP_VERSION_ID >= 80100 ++ fh.filename = zend_string_init(ini_file, strlen(ini_file), 0); ++#else + fh.filename = ini_file; ++#endif + fh.type = ZEND_HANDLE_FP; + ZVAL_UNDEF(&active_ini_file_section); + YACONF_G(parse_err) = 0; +@@ -713,6 +727,9 @@ PHP_RINIT_FUNCTION(yaconf) + YACONF_G(parse_err) = 0; + php_yaconf_hash_destroy(Z_ARRVAL(result)); + free(namelist[i]); ++#if PHP_VERSION_ID >= 80100 ++ zend_string_release(fh.filename); ++#endif + continue; + } + } +@@ -734,6 +751,9 @@ PHP_RINIT_FUNCTION(yaconf) + zend_hash_update_mem(parsed_ini_files, n.filename, &n, sizeof(yaconf_filenode)); + } + free(namelist[i]); ++#if PHP_VERSION_ID >= 80100 ++ zend_string_release(fh.filename); ++#endif + } + free(namelist); + } |