From d069dc3d5fb14c394bc0323338b34ae42a497491 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 15 Oct 2020 12:12:59 +0200 Subject: add patch to properly check available command from https://github.com/SkyAPM/SkyAPM-php-sdk/pull/275 add patch to fix build with PHP 8 from https://github.com/SkyAPM/SkyAPM-php-sdk/pull/276 --- 276.patch | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 276.patch (limited to '276.patch') diff --git a/276.patch b/276.patch new file mode 100644 index 0000000..4eb0c88 --- /dev/null +++ b/276.patch @@ -0,0 +1,61 @@ +From ac1b5c26136dac3f0ce81d3e4ee229340b32fe95 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Thu, 15 Oct 2020 12:01:37 +0200 +Subject: [PATCH] fix build with PHP 8.0.0RC2 + +--- + src/sky_predis.cc | 9 ++++++++- + src/sky_utils.cc | 6 +++++- + 2 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/src/sky_predis.cc b/src/sky_predis.cc +index 0e93241..eb3ddd2 100644 +--- a/src/sky_predis.cc ++++ b/src/sky_predis.cc +@@ -32,9 +32,16 @@ Span *sky_predis(zend_execute_data *execute_data, char *class_name, char *functi + + zval *id = (zval *) emalloc(sizeof(zval)); + zval *arguments = (zval *) emalloc(sizeof(zval)); ++#if PHP_VERSION_ID < 80000 + zend_call_method(command, Z_OBJCE_P(command), nullptr, ZEND_STRL("getid"), id, 0, nullptr, nullptr); + zend_call_method(command, Z_OBJCE_P(command), nullptr, ZEND_STRL("getarguments"), arguments, 0, nullptr, + nullptr); ++#else ++ zend_call_method(Z_OBJ_P(command), Z_OBJCE_P(command), nullptr, ZEND_STRL("getid"), id, 0, nullptr, ++ nullptr); ++ zend_call_method(Z_OBJ_P(command), Z_OBJCE_P(command), nullptr, ZEND_STRL("getarguments"), arguments, ++ 0, nullptr, nullptr); ++#endif + + if (id != nullptr && Z_TYPE_P(id) == IS_STRING) { + span->setOperationName(_class_name + "->" + std::string(Z_STRVAL_P(id))); +@@ -118,4 +125,4 @@ static std::string sky_predis_command(zval *id, zval *arguments) { + } + + return nullptr; +-} +\ No newline at end of file ++} +diff --git a/src/sky_utils.cc b/src/sky_utils.cc +index 61c5089..d9053e4 100644 +--- a/src/sky_utils.cc ++++ b/src/sky_utils.cc +@@ -86,7 +86,11 @@ zval *sky_read_property(zval *obj, const char *property, int parent) { + ce = object->ce->parent; + } + ++#if PHP_VERSION_ID < 80000 + return zend_read_property(ce, obj, property, strlen(property), 0, nullptr); ++#else ++ return zend_read_property(ce, object, property, strlen(property), 0, nullptr); ++#endif + } + return nullptr; + } +@@ -97,4 +101,4 @@ std::string sky_get_class_name(zval *obj) { + return ZSTR_VAL(object->ce->name); + } + return ""; +-} +\ No newline at end of file ++} -- cgit