From dbe46eca8f0b5d47df98fb5ff496c7574186c80d Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Fri, 22 Dec 2023 19:11:55 +0800 Subject: [PATCH] fix php8.3 --- README.md | 4 ++-- {script => bin}/gen.php | 0 {script => bin}/gen_stub.php | 0 {script => bin}/pack.php | 0 build.sh | 2 +- include/phpx.h | 4 ++-- phpinfo.php | 2 -- src/function.cc | 44 +++++++++++++++++++----------------- 8 files changed, 28 insertions(+), 28 deletions(-) rename {script => bin}/gen.php (100%) rename {script => bin}/gen_stub.php (100%) rename {script => bin}/pack.php (100%) delete mode 100644 phpinfo.php diff --git a/README.md b/README.md index 910658f2..6730994a 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ C++ wrapper for Zend API ## Requirements -- PHP 7.2 or later +- PHP 8.0 or later - Linux/MacOS/Windows - GCC 4.8 or later - Composer @@ -35,7 +35,7 @@ phpx create cpp_ext ## Generate ArgInfo & Function Entires ```shell -php script/gen_stub.php your_stub_dir +php bin/gen_stub.php your_stub_dir ``` ## Build extension diff --git a/script/gen.php b/bin/gen.php similarity index 100% rename from script/gen.php rename to bin/gen.php diff --git a/script/gen_stub.php b/bin/gen_stub.php similarity index 100% rename from script/gen_stub.php rename to bin/gen_stub.php diff --git a/script/pack.php b/bin/pack.php similarity index 100% rename from script/pack.php rename to bin/pack.php diff --git a/build.sh b/build.sh index d67e3466..f4ca1b4a 100755 --- a/build.sh +++ b/build.sh @@ -2,4 +2,4 @@ cd console && \ echo "composer update" && \ composer update && \ cd ../ && \ -/usr/bin/env php -d phar.readonly=off script/pack.php +/usr/bin/env php -d phar.readonly=off bin/pack.php diff --git a/include/phpx.h b/include/phpx.h index ae8b858f..c9b4e7e4 100644 --- a/include/phpx.h +++ b/include/phpx.h @@ -26,8 +26,8 @@ extern "C" { #include "php_streams.h" #include "php_network.h" -#if PHP_VERSION_ID < 70200 -#error "only supports PHP7 or later." +#if PHP_VERSION_ID < 80000 +#error "only supports PHP8 or later." #endif #include "zend_interfaces.h" diff --git a/phpinfo.php b/phpinfo.php deleted file mode 100644 index 61ace196..00000000 --- a/phpinfo.php +++ /dev/null @@ -1,2 +0,0 @@ -= 80300 + auto _arg_sep = zend_string_init(arg_sep, strlen(arg_sep), 0); + php_url_encode_hash_ex(HASH_OF(_data.ptr()), + &formstr, + prefix, + prefix_len, + NULL, + NULL, + _arg_sep, + enc_type); + zend_string_release(_arg_sep); +#else + php_url_encode_hash_ex(HASH_OF(_data.ptr()), + &formstr, + prefix, + prefix_len, + NULL, + 0, + NULL, + 0, + (_data.isObject() ? _data.ptr() : NULL), + (char *) arg_sep, + enc_type); #endif if (!formstr.s) {