From e2dd3d55a95ec6b0b63ce9b56bc95f4ea1229ff3 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 13 Nov 2020 09:02:51 +0100 Subject: update to 4.1.0 drop patches merged upstream add patch to fix build with PHP 8 from https://github.com/SkyAPM/SkyAPM-php-sdk/pull/294 --- 294.patch | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 294.patch (limited to '294.patch') diff --git a/294.patch b/294.patch new file mode 100644 index 0000000..ba47917 --- /dev/null +++ b/294.patch @@ -0,0 +1,109 @@ +From 4f50ecec5a1cfda6689c41fd0691526cf74cdde7 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 13 Nov 2020 08:49:03 +0100 +Subject: [PATCH] fix for PHP 8 + +--- + skywalking.cc | 7 +++++-- + src/sky_plugin_hyperf_guzzle.cc | 16 ++++++++++++++-- + src/sky_plugin_redis.cc | 8 ++++---- + 3 files changed, 23 insertions(+), 8 deletions(-) + +diff --git a/skywalking.cc b/skywalking.cc +index 31eda51..e27808f 100644 +--- a/skywalking.cc ++++ b/skywalking.cc +@@ -190,8 +190,11 @@ zend_module_dep skywalking_deps[] = { + ZEND_MOD_END + }; + ++ZEND_BEGIN_ARG_INFO_EX(arginfo_skywalking_trace_id, 0, 0, 0) ++ZEND_END_ARG_INFO() ++ + const zend_function_entry skywalking_functions[] = { +- PHP_FE (skywalking_trace_id, NULL) ++ PHP_FE (skywalking_trace_id, arginfo_skywalking_trace_id) + PHP_FE_END + }; + +@@ -215,4 +218,4 @@ zend_module_entry skywalking_module_entry = { + ZEND_TSRMLS_CACHE_DEFINE() + #endif + ZEND_GET_MODULE(skywalking) +-#endif +\ No newline at end of file ++#endif +diff --git a/src/sky_plugin_hyperf_guzzle.cc b/src/sky_plugin_hyperf_guzzle.cc +index ad851e0..68ded0a 100644 +--- a/src/sky_plugin_hyperf_guzzle.cc ++++ b/src/sky_plugin_hyperf_guzzle.cc +@@ -29,18 +29,30 @@ Span *sky_plugin_hyperf_guzzle(zend_execute_data *execute_data, const std::strin + if (arg_count >= 1) { + zval *request = ZEND_CALL_ARG(execute_data, 1); + zval uri; ++#if PHP_VERSION_ID < 80000 + zend_call_method(request, Z_OBJCE_P(request), nullptr, ZEND_STRL("geturi"), &uri, 0, nullptr, nullptr); ++#else ++ zend_call_method(Z_OBJ_P(request), Z_OBJCE_P(request), nullptr, ZEND_STRL("geturi"), &uri, 0, nullptr, nullptr); ++#endif + + if (!Z_ISUNDEF(uri)) { + zval scheme, host, port, path, query, to_string; + int _port = 80; ++#if PHP_VERSION_ID < 80000 + zend_call_method(&uri, Z_OBJCE_P(&uri), nullptr, ZEND_STRL("getscheme"), &scheme, 0, nullptr, nullptr); + zend_call_method(&uri, Z_OBJCE_P(&uri), nullptr, ZEND_STRL("gethost"), &host, 0, nullptr, nullptr); + zend_call_method(&uri, Z_OBJCE_P(&uri), nullptr, ZEND_STRL("getport"), &port, 0, nullptr, nullptr); + zend_call_method(&uri, Z_OBJCE_P(&uri), nullptr, ZEND_STRL("getpath"), &path, 0, nullptr, nullptr); + zend_call_method(&uri, Z_OBJCE_P(&uri), nullptr, ZEND_STRL("getquery"), &query, 0, nullptr, nullptr); + zend_call_method(&uri, Z_OBJCE_P(&uri), nullptr, ZEND_STRL("__tostring"), &to_string, 0, nullptr, nullptr); +- ++#else ++ zend_call_method(Z_OBJ(uri), Z_OBJCE(uri), nullptr, ZEND_STRL("getscheme"), &scheme, 0, nullptr, nullptr); ++ zend_call_method(Z_OBJ(uri), Z_OBJCE(uri), nullptr, ZEND_STRL("gethost"), &host, 0, nullptr, nullptr); ++ zend_call_method(Z_OBJ(uri), Z_OBJCE(uri), nullptr, ZEND_STRL("getport"), &port, 0, nullptr, nullptr); ++ zend_call_method(Z_OBJ(uri), Z_OBJCE(uri), nullptr, ZEND_STRL("getpath"), &path, 0, nullptr, nullptr); ++ zend_call_method(Z_OBJ(uri), Z_OBJCE(uri), nullptr, ZEND_STRL("getquery"), &query, 0, nullptr, nullptr); ++ zend_call_method(Z_OBJ(uri), Z_OBJCE(uri), nullptr, ZEND_STRL("__tostring"), &to_string, 0, nullptr, nullptr); ++#endif + if (!Z_ISUNDEF(scheme) && Z_TYPE(scheme) == IS_STRING) { + + if (strcmp(Z_STRVAL(scheme), "http") == 0 || strcmp(Z_STRVAL(scheme), "https") == 0) { +@@ -74,4 +86,4 @@ Span *sky_plugin_hyperf_guzzle(zend_execute_data *execute_data, const std::strin + } + + return nullptr; +-} +\ No newline at end of file ++} +diff --git a/src/sky_plugin_redis.cc b/src/sky_plugin_redis.cc +index 450e5d7..003b517 100644 +--- a/src/sky_plugin_redis.cc ++++ b/src/sky_plugin_redis.cc +@@ -80,8 +80,8 @@ std::string sky_plugin_redis_peer(zend_execute_data *execute_data) { + zend_call_method(command, Z_OBJCE_P(command), nullptr, ZEND_STRL("gethost"), &host, 0, nullptr, nullptr); + zend_call_method(command, Z_OBJCE_P(command), nullptr, ZEND_STRL("getport"), &port, 0, nullptr, nullptr); + #else +- zend_call_method(Z_OBJCE_P(command), Z_OBJCE_P(command), nullptr, ZEND_STRL("gethost"), &host, 0, nullptr, nullptr); +- zend_call_method(Z_OBJCE_P(command), Z_OBJCE_P(command), nullptr, ZEND_STRL("getport"), &port, 0, nullptr, nullptr); ++ zend_call_method(Z_OBJ_P(command), Z_OBJCE_P(command), nullptr, ZEND_STRL("gethost"), &host, 0, nullptr, nullptr); ++ zend_call_method(Z_OBJ_P(command), Z_OBJCE_P(command), nullptr, ZEND_STRL("getport"), &port, 0, nullptr, nullptr); + #endif + + if (!Z_ISUNDEF(host) && !Z_ISUNDEF(port) && Z_TYPE(host) == IS_STRING) { +@@ -136,7 +136,7 @@ std::string sky_plugin_redis_bit_count_cmd(zend_execute_data *execute_data, std: + uint32_t arg_count = ZEND_CALL_NUM_ARGS(execute_data); + + if (arg_count >= 1) { +- for (int i = 1; i <= 3; ++i) { ++ for (uint32_t i = 1; i <= 3; ++i) { + if (i <= arg_count) { + zval *value = ZEND_CALL_ARG(execute_data, i); + if (Z_TYPE_P(value) == IS_LONG) { +@@ -154,4 +154,4 @@ std::string sky_plugin_redis_bit_count_cmd(zend_execute_data *execute_data, std: + return cmd; + } + return ""; +-} +\ No newline at end of file ++} -- cgit