From 22319315df18526277873058f79cf69e77d8b4a2 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Wed, 10 May 2017 15:59:59 -0700 Subject: Fix c extension for php7.1. (#3077) --- php/ext/google/protobuf/message.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'php/ext/google/protobuf/message.c') diff --git a/php/ext/google/protobuf/message.c b/php/ext/google/protobuf/message.c index cabc3987..48b87b10 100644 --- a/php/ext/google/protobuf/message.c +++ b/php/ext/google/protobuf/message.c @@ -116,7 +116,11 @@ static void message_set_property(zval* object, zval* member, zval* value, return; } +#if PHP_MAJOR_VERSION < 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION == 0) if (Z_OBJCE_P(object) != EG(scope)) { +#else + if (Z_OBJCE_P(object) != zend_get_executed_scope()) { +#endif // User cannot set property directly (e.g., $m->a = 1) zend_error(E_USER_ERROR, "Cannot access private property."); return; @@ -146,7 +150,11 @@ static zval* message_get_property(zval* object, zval* member, int type, return PHP_PROTO_GLOBAL_UNINITIALIZED_ZVAL; } +#if PHP_MAJOR_VERSION < 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION == 0) if (Z_OBJCE_P(object) != EG(scope)) { +#else + if (Z_OBJCE_P(object) != zend_get_executed_scope()) { +#endif // User cannot get property directly (e.g., $a = $m->a) zend_error(E_USER_ERROR, "Cannot access private property."); return PHP_PROTO_GLOBAL_UNINITIALIZED_ZVAL; -- cgit v1.2.3 From 3b1a87518cead7403b8e13c41945e41a30d602e4 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Sat, 17 Jun 2017 11:01:16 -0700 Subject: Remove inclusion of ext/json/php_json.h. (#3241) That implementation of json is not being used - this extension is using a json encoder/decoder provided by 'upb'. --- php/ext/google/protobuf/message.c | 1 - 1 file changed, 1 deletion(-) (limited to 'php/ext/google/protobuf/message.c') diff --git a/php/ext/google/protobuf/message.c b/php/ext/google/protobuf/message.c index 48b87b10..1162a5f8 100644 --- a/php/ext/google/protobuf/message.c +++ b/php/ext/google/protobuf/message.c @@ -30,7 +30,6 @@ #include #include -#include #include "protobuf.h" -- cgit v1.2.3