From 7c8634aff23827ad067965d96dad7959e0a64f0d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 14 Dec 2017 08:31:12 +0100 Subject: add upstream patch to drop timelib_update_ts need --- 4034.patch | 324 ++++++++ REFLECTION | 2006 +++++++++++++++++++++++++++++++++++++++++++++++- php-pecl-protobuf.spec | 6 + 3 files changed, 2334 insertions(+), 2 deletions(-) create mode 100644 4034.patch diff --git a/4034.patch b/4034.patch new file mode 100644 index 0000000..e77070d --- /dev/null +++ b/4034.patch @@ -0,0 +1,324 @@ +From 9f6aceaa8ce8250d9e36225180c218035bd49fe9 Mon Sep 17 00:00:00 2001 +From: Bo Yang +Date: Tue, 12 Dec 2017 12:06:51 -0800 +Subject: [PATCH 1/4] Add PROTOBUF_ENABLE_TIMESTAMP to let user decide whether + timestamp util can be used at install time. + +--- + php/ext/google/protobuf/message.c | 13 ++++++++++++- + php/tests/test.sh | 2 +- + 2 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/php/ext/google/protobuf/message.c b/php/ext/google/protobuf/message.c +index b14c1f0c5a..70080a3b6e 100644 +--- a/php/ext/google/protobuf/message.c ++++ b/php/ext/google/protobuf/message.c +@@ -29,9 +29,12 @@ + // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + #include +-#include + #include + ++#ifdef PROTOBUF_ENABLE_TIMESTAMP ++#include ++#endif ++ + #include "protobuf.h" + #include "utf8.h" + +@@ -1121,6 +1124,7 @@ PHP_PROTO_FIELD_ACCESSORS(Timestamp, timestamp, Seconds, "seconds") + PHP_PROTO_FIELD_ACCESSORS(Timestamp, timestamp, Nanos, "nanos") + + PHP_METHOD(Timestamp, fromDateTime) { ++#ifdef PROTOBUF_ENABLE_TIMESTAMP + zval* datetime; + zval member; + +@@ -1149,9 +1153,13 @@ PHP_METHOD(Timestamp, fromDateTime) { + storage = message_data(self); + memory = slot_memory(self->descriptor->layout, storage, field); + *(int32_t*)memory = 0; ++#else ++ zend_error(E_USER_ERROR, "fromDateTime needs date extension."); ++#endif + } + + PHP_METHOD(Timestamp, toDateTime) { ++#ifdef PROTOBUF_ENABLE_TIMESTAMP + zval datetime; + php_date_instantiate(php_date_get_date_ce(), &datetime TSRMLS_CC); + php_date_obj* dateobj = UNBOX(php_date_obj, &datetime); +@@ -1184,6 +1192,9 @@ PHP_METHOD(Timestamp, toDateTime) { + + zval* datetime_ptr = &datetime; + PHP_PROTO_RETVAL_ZVAL(datetime_ptr); ++#else ++ zend_error(E_USER_ERROR, "toDateTime needs date extension."); ++#endif + } + + // ----------------------------------------------------------------------------- +From 88102eae8f86045307e9d46ad900f91158227f2b Mon Sep 17 00:00:00 2001 +From: Bo Yang +Date: Tue, 12 Dec 2017 13:57:49 -0800 +Subject: [PATCH 2/4] Replace private timelib_update_ts with public + date_timestamp_get + +--- + php/ext/google/protobuf/message.c | 24 +++++++++++++++++++----- + php/tests/memory_leak_test.php | 12 ++++++++++++ + 2 files changed, 31 insertions(+), 5 deletions(-) + +diff --git a/php/ext/google/protobuf/message.c b/php/ext/google/protobuf/message.c +index 70080a3b6e..5b654a78d6 100644 +--- a/php/ext/google/protobuf/message.c ++++ b/php/ext/google/protobuf/message.c +@@ -1133,12 +1133,24 @@ PHP_METHOD(Timestamp, fromDateTime) { + return; + } + +- php_date_obj* dateobj = UNBOX(php_date_obj, datetime); +- if (!dateobj->time->sse_uptodate) { +- timelib_update_ts(dateobj->time, NULL); ++ // Get timestamp from Datetime object. ++ zval* retval_ptr; ++ zval* function_name; ++ int64_t timestamp; ++ ++ MAKE_STD_ZVAL(retval_ptr); ++ MAKE_STD_ZVAL(function_name); ++ ++ ZVAL_STRING(function_name, "date_timestamp_get", 1); ++ ++ if (call_user_function(EG(function_table), NULL, ++ function_name, retval_ptr, 1, ++ &datetime TSRMLS_CC) == SUCCESS) { ++ protobuf_convert_to_int64(retval_ptr, ×tamp); + } + +- int64_t timestamp = dateobj->time->sse; ++ zval_ptr_dtor(&retval_ptr); ++ zval_ptr_dtor(&function_name); + + // Set seconds + MessageHeader* self = UNBOX(MessageHeader, getThis()); +@@ -1146,13 +1158,15 @@ PHP_METHOD(Timestamp, fromDateTime) { + upb_msgdef_ntofz(self->descriptor->msgdef, "seconds"); + void* storage = message_data(self); + void* memory = slot_memory(self->descriptor->layout, storage, field); +- *(int64_t*)memory = dateobj->time->sse; ++ *(int64_t*)memory = timestamp; + + // Set nanos + field = upb_msgdef_ntofz(self->descriptor->msgdef, "nanos"); + storage = message_data(self); + memory = slot_memory(self->descriptor->layout, storage, field); + *(int32_t*)memory = 0; ++ ++ RETURN_NULL(); + #else + zend_error(E_USER_ERROR, "fromDateTime needs date extension."); + #endif + +From fffe8d39f810d147c6db65f90ae4f71f4e0f0116 Mon Sep 17 00:00:00 2001 +From: Bo Yang +Date: Tue, 12 Dec 2017 17:47:04 -0800 +Subject: [PATCH 3/4] Call php method via function name instead of calling + directly. + +This changes the linking error if php extension is not statically linked +to a runtime error. In this way, users who don't need Timestamp can +still use protobuf even if date extension is not statically linked in +php. +--- + php/ext/google/protobuf/message.c | 70 ++++++++++++++++++++++---------------- + php/ext/google/protobuf/protobuf.h | 4 +++ + php/tests/memory_leak_test.php | 8 ++--- + php/tests/test.sh | 2 +- + 4 files changed, 50 insertions(+), 34 deletions(-) + +diff --git a/php/ext/google/protobuf/message.c b/php/ext/google/protobuf/message.c +index 5b654a78d6..7d7d86517a 100644 +--- a/php/ext/google/protobuf/message.c ++++ b/php/ext/google/protobuf/message.c +@@ -31,10 +31,6 @@ + #include + #include + +-#ifdef PROTOBUF_ENABLE_TIMESTAMP +-#include +-#endif +- + #include "protobuf.h" + #include "utf8.h" + +@@ -1124,7 +1120,6 @@ PHP_PROTO_FIELD_ACCESSORS(Timestamp, timestamp, Seconds, "seconds") + PHP_PROTO_FIELD_ACCESSORS(Timestamp, timestamp, Nanos, "nanos") + + PHP_METHOD(Timestamp, fromDateTime) { +-#ifdef PROTOBUF_ENABLE_TIMESTAMP + zval* datetime; + zval member; + +@@ -1134,23 +1129,27 @@ PHP_METHOD(Timestamp, fromDateTime) { + } + + // Get timestamp from Datetime object. +- zval* retval_ptr; +- zval* function_name; ++ zval retval; ++ zval function_name; + int64_t timestamp; + +- MAKE_STD_ZVAL(retval_ptr); +- MAKE_STD_ZVAL(function_name); ++#if PHP_MAJOR_VERSION < 7 ++ INIT_ZVAL(retval); ++ INIT_ZVAL(function_name); ++#endif + +- ZVAL_STRING(function_name, "date_timestamp_get", 1); ++ PHP_PROTO_ZVAL_STRING(&function_name, "date_timestamp_get", 1); + +- if (call_user_function(EG(function_table), NULL, +- function_name, retval_ptr, 1, +- &datetime TSRMLS_CC) == SUCCESS) { +- protobuf_convert_to_int64(retval_ptr, ×tamp); ++ if (call_user_function(EG(function_table), NULL, &function_name, &retval, 1, ++ ZVAL_PTR_TO_CACHED_PTR(datetime) TSRMLS_CC) == FAILURE) { ++ zend_error(E_ERROR, "Cannot get timestamp from DateTime."); ++ return; + } + +- zval_ptr_dtor(&retval_ptr); +- zval_ptr_dtor(&function_name); ++ protobuf_convert_to_int64(&retval, ×tamp); ++ ++ zval_dtor(&retval); ++ zval_dtor(&function_name); + + // Set seconds + MessageHeader* self = UNBOX(MessageHeader, getThis()); +@@ -1167,17 +1166,9 @@ PHP_METHOD(Timestamp, fromDateTime) { + *(int32_t*)memory = 0; + + RETURN_NULL(); +-#else +- zend_error(E_USER_ERROR, "fromDateTime needs date extension."); +-#endif + } + + PHP_METHOD(Timestamp, toDateTime) { +-#ifdef PROTOBUF_ENABLE_TIMESTAMP +- zval datetime; +- php_date_instantiate(php_date_get_date_ce(), &datetime TSRMLS_CC); +- php_date_obj* dateobj = UNBOX(php_date_obj, &datetime); +- + // Get seconds + MessageHeader* self = UNBOX(MessageHeader, getThis()); + const upb_fielddef* field = +@@ -1198,16 +1189,37 @@ PHP_METHOD(Timestamp, toDateTime) { + strftime(formated_time, sizeof(formated_time), "%Y-%m-%dT%H:%M:%SUTC", + utc_time); + +- if (!php_date_initialize(dateobj, formated_time, strlen(formated_time), NULL, +- NULL, 0 TSRMLS_CC)) { +- zval_dtor(&datetime); +- RETURN_NULL(); ++ // Create Datetime object. ++ zval datetime; ++ zval formated_time_php; ++ zval function_name; ++ int64_t timestamp = 0; ++ ++#if PHP_MAJOR_VERSION < 7 ++ INIT_ZVAL(function_name); ++ INIT_ZVAL(formated_time_php); ++#endif ++ ++ PHP_PROTO_ZVAL_STRING(&function_name, "date_create", 1); ++ PHP_PROTO_ZVAL_STRING(&formated_time_php, formated_time, 1); ++ ++ CACHED_VALUE params[1] = {ZVAL_TO_CACHED_VALUE(formated_time_php)}; ++ ++ if (call_user_function(EG(function_table), NULL, ++ &function_name, &datetime, 1, ++ params TSRMLS_CC) == FAILURE) { ++ zend_error(E_ERROR, "Cannot create DateTime."); ++ return; + } + ++ zval_dtor(&formated_time_php); ++ zval_dtor(&function_name); ++ ++#if PHP_MAJOR_VERSION < 7 + zval* datetime_ptr = &datetime; + PHP_PROTO_RETVAL_ZVAL(datetime_ptr); + #else +- zend_error(E_USER_ERROR, "toDateTime needs date extension."); ++ ZVAL_OBJ(return_value, Z_OBJ(datetime)); + #endif + } + +diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h +index f299b4150d..6ab0f13478 100644 +--- a/php/ext/google/protobuf/protobuf.h ++++ b/php/ext/google/protobuf/protobuf.h +@@ -182,6 +182,8 @@ + #define CACHED_TO_ZVAL_PTR(VALUE) (VALUE) + #define CACHED_PTR_TO_ZVAL_PTR(VALUE) (*VALUE) + #define ZVAL_PTR_TO_CACHED_PTR(VALUE) (&VALUE) ++#define ZVAL_PTR_TO_CACHED_VALUE(VALUE) (VALUE) ++#define ZVAL_TO_CACHED_VALUE(VALUE) (&VALUE) + + #define CREATE_OBJ_ON_ALLOCATED_ZVAL_PTR(zval_ptr, class_type) \ + ZVAL_OBJ(zval_ptr, class_type->create_object(class_type TSRMLS_CC)); +@@ -452,6 +454,8 @@ static inline int php_proto_zend_hash_get_current_data_ex(HashTable* ht, + #define CACHED_TO_ZVAL_PTR(VALUE) (&VALUE) + #define CACHED_PTR_TO_ZVAL_PTR(VALUE) (VALUE) + #define ZVAL_PTR_TO_CACHED_PTR(VALUE) (VALUE) ++#define ZVAL_PTR_TO_CACHED_VALUE(VALUE) (*VALUE) ++#define ZVAL_TO_CACHED_VALUE(VALUE) (VALUE) + + #define CREATE_OBJ_ON_ALLOCATED_ZVAL_PTR(zval_ptr, class_type) \ + ZVAL_OBJ(zval_ptr, class_type->create_object(class_type)); + +From 1a549d9a902151e980bfa76093b3d82b7589e158 Mon Sep 17 00:00:00 2001 +From: Bo Yang +Date: Wed, 13 Dec 2017 17:09:55 -0800 +Subject: [PATCH 4/4] Avoid using php_date_get_date_ce() in case date extension + is not available. + +--- + php/ext/google/protobuf/message.c | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +diff --git a/php/ext/google/protobuf/message.c b/php/ext/google/protobuf/message.c +index 7d7d86517a..df5eb408a1 100644 +--- a/php/ext/google/protobuf/message.c ++++ b/php/ext/google/protobuf/message.c +@@ -1123,8 +1123,21 @@ PHP_METHOD(Timestamp, fromDateTime) { + zval* datetime; + zval member; + +- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &datetime, +- php_date_get_date_ce()) == FAILURE) { ++ if (zend_parse_parameters( ++ ZEND_NUM_ARGS() TSRMLS_CC, "z", &datetime) == FAILURE) { ++ return; ++ } ++ ++ zend_class_entry* ce = Z_OBJCE_P(datetime); ++ PHP_PROTO_CE_DECLARE datetime_ce; ++ if (php_proto_zend_lookup_class("\\Datetime", 9, &datetime_ce) == ++ FAILURE) { ++ zend_error(E_ERROR, "Make sure date extension is enabled."); ++ return; ++ } ++ ++ if (!instanceof_function(PHP_PROTO_CE_UNREF(datetime_ce), ce TSRMLS_CC)) { ++ zend_error(E_USER_ERROR, "Expect Datetime."); + return; + } + diff --git a/REFLECTION b/REFLECTION index af9e0d0..a650b5b 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,6 +1,6 @@ -Extension [ extension #117 protobuf version 3.4.0 ] { +Extension [ extension #122 protobuf version 3.5.0.1 ] { - - Classes [14] { + - Classes [54] { Class [ class Google\Protobuf\DescriptorPool ] { - Constants [0] { @@ -608,6 +608,2008 @@ Extension [ extension #117 protobuf version 3.4.0 ] { - Methods [0] { } } + + Class [ class GPBMetadata\Google\Protobuf\Any ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [1] { + Method [ static public method initOnce ] { + } + } + + - Properties [0] { + } + + - Methods [0] { + } + } + + Class [ class GPBMetadata\Google\Protobuf\Api ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [1] { + Method [ static public method initOnce ] { + } + } + + - Properties [0] { + } + + - Methods [0] { + } + } + + Class [ class GPBMetadata\Google\Protobuf\Duration ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [1] { + Method [ static public method initOnce ] { + } + } + + - Properties [0] { + } + + - Methods [0] { + } + } + + Class [ class GPBMetadata\Google\Protobuf\FieldMask ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [1] { + Method [ static public method initOnce ] { + } + } + + - Properties [0] { + } + + - Methods [0] { + } + } + + Class [ class GPBMetadata\Google\Protobuf\GPBEmpty ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [1] { + Method [ static public method initOnce ] { + } + } + + - Properties [0] { + } + + - Methods [0] { + } + } + + Class [ class GPBMetadata\Google\Protobuf\SourceContext ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [1] { + Method [ static public method initOnce ] { + } + } + + - Properties [0] { + } + + - Methods [0] { + } + } + + Class [ class GPBMetadata\Google\Protobuf\Struct ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [1] { + Method [ static public method initOnce ] { + } + } + + - Properties [0] { + } + + - Methods [0] { + } + } + + Class [ class GPBMetadata\Google\Protobuf\Timestamp ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [1] { + Method [ static public method initOnce ] { + } + } + + - Properties [0] { + } + + - Methods [0] { + } + } + + Class [ class GPBMetadata\Google\Protobuf\Type ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [1] { + Method [ static public method initOnce ] { + } + } + + - Properties [0] { + } + + - Methods [0] { + } + } + + Class [ class GPBMetadata\Google\Protobuf\Wrappers ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [1] { + Method [ static public method initOnce ] { + } + } + + - Properties [0] { + } + + - Methods [0] { + } + } + + Class [ class Google\Protobuf\Any implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [2] { + Property [ private $type_url ] + Property [ private $value ] + } + + - Methods [17] { + Method [ public method __construct ] { + } + + Method [ public method getTypeUrl ] { + } + + Method [ public method setTypeUrl ] { + } + + Method [ public method getValue ] { + } + + Method [ public method setValue ] { + } + + Method [ public method pack ] { + } + + Method [ public method unpack ] { + } + + Method [ public method is ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\Api implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [7] { + Property [ private $name ] + Property [ private $methods ] + Property [ private $options ] + Property [ private $version ] + Property [ private $source_context ] + Property [ private $mixins ] + Property [ private $syntax ] + } + + - Methods [24] { + Method [ public method __construct ] { + } + + Method [ public method getName ] { + } + + Method [ public method setName ] { + } + + Method [ public method getMethods ] { + } + + Method [ public method setMethods ] { + } + + Method [ public method getOptions ] { + } + + Method [ public method setOptions ] { + } + + Method [ public method getVersion ] { + } + + Method [ public method setVersion ] { + } + + Method [ public method getSourceContext ] { + } + + Method [ public method setSourceContext ] { + } + + Method [ public method getMixins ] { + } + + Method [ public method setMixins ] { + } + + Method [ public method getSyntax ] { + } + + Method [ public method setSyntax ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\BoolValue implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [1] { + Property [ private $value ] + } + + - Methods [12] { + Method [ public method __construct ] { + } + + Method [ public method getValue ] { + } + + Method [ public method setValue ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\BytesValue implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [1] { + Property [ private $value ] + } + + - Methods [12] { + Method [ public method __construct ] { + } + + Method [ public method getValue ] { + } + + Method [ public method setValue ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\DoubleValue implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [1] { + Property [ private $value ] + } + + - Methods [12] { + Method [ public method __construct ] { + } + + Method [ public method getValue ] { + } + + Method [ public method setValue ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\Duration implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [2] { + Property [ private $seconds ] + Property [ private $nanos ] + } + + - Methods [14] { + Method [ public method __construct ] { + } + + Method [ public method getSeconds ] { + } + + Method [ public method setSeconds ] { + } + + Method [ public method getNanos ] { + } + + Method [ public method setNanos ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\Enum implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [5] { + Property [ private $name ] + Property [ private $enumvalue ] + Property [ private $options ] + Property [ private $source_context ] + Property [ private $syntax ] + } + + - Methods [20] { + Method [ public method __construct ] { + } + + Method [ public method getName ] { + } + + Method [ public method setName ] { + } + + Method [ public method getEnumvalue ] { + } + + Method [ public method setEnumvalue ] { + } + + Method [ public method getOptions ] { + } + + Method [ public method setOptions ] { + } + + Method [ public method getSourceContext ] { + } + + Method [ public method setSourceContext ] { + } + + Method [ public method getSyntax ] { + } + + Method [ public method setSyntax ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\EnumValue implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [3] { + Property [ private $name ] + Property [ private $number ] + Property [ private $options ] + } + + - Methods [16] { + Method [ public method __construct ] { + } + + Method [ public method getName ] { + } + + Method [ public method setName ] { + } + + Method [ public method getNumber ] { + } + + Method [ public method setNumber ] { + } + + Method [ public method getOptions ] { + } + + Method [ public method setOptions ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\Field_Cardinality ] { + + - Constants [4] { + Constant [ integer CARDINALITY_UNKNOWN ] { 0 } + Constant [ integer CARDINALITY_OPTIONAL ] { 1 } + Constant [ integer CARDINALITY_REQUIRED ] { 2 } + Constant [ integer CARDINALITY_REPEATED ] { 3 } + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [0] { + } + } + + Class [ class Google\Protobuf\Field implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [10] { + Property [ private $kind ] + Property [ private $cardinality ] + Property [ private $number ] + Property [ private $name ] + Property [ private $type_url ] + Property [ private $oneof_index ] + Property [ private $packed ] + Property [ private $options ] + Property [ private $json_name ] + Property [ private $default_value ] + } + + - Methods [30] { + Method [ public method __construct ] { + } + + Method [ public method getKind ] { + } + + Method [ public method setKind ] { + } + + Method [ public method getCardinality ] { + } + + Method [ public method setCardinality ] { + } + + Method [ public method getNumber ] { + } + + Method [ public method setNumber ] { + } + + Method [ public method getName ] { + } + + Method [ public method setName ] { + } + + Method [ public method getTypeUrl ] { + } + + Method [ public method setTypeUrl ] { + } + + Method [ public method getOneofIndex ] { + } + + Method [ public method setOneofIndex ] { + } + + Method [ public method getPacked ] { + } + + Method [ public method setPacked ] { + } + + Method [ public method getOptions ] { + } + + Method [ public method setOptions ] { + } + + Method [ public method getJsonName ] { + } + + Method [ public method setJsonName ] { + } + + Method [ public method getDefaultValue ] { + } + + Method [ public method setDefaultValue ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\Field_Kind ] { + + - Constants [19] { + Constant [ integer TYPE_UNKNOWN ] { 0 } + Constant [ integer TYPE_DOUBLE ] { 1 } + Constant [ integer TYPE_FLOAT ] { 2 } + Constant [ integer TYPE_INT64 ] { 3 } + Constant [ integer TYPE_UINT64 ] { 4 } + Constant [ integer TYPE_INT32 ] { 5 } + Constant [ integer TYPE_FIXED64 ] { 6 } + Constant [ integer TYPE_FIXED32 ] { 7 } + Constant [ integer TYPE_BOOL ] { 8 } + Constant [ integer TYPE_STRING ] { 9 } + Constant [ integer TYPE_GROUP ] { 10 } + Constant [ integer TYPE_MESSAGE ] { 11 } + Constant [ integer TYPE_BYTES ] { 12 } + Constant [ integer TYPE_UINT32 ] { 13 } + Constant [ integer TYPE_ENUM ] { 14 } + Constant [ integer TYPE_SFIXED32 ] { 15 } + Constant [ integer TYPE_SFIXED64 ] { 16 } + Constant [ integer TYPE_SINT32 ] { 17 } + Constant [ integer TYPE_SINT64 ] { 18 } + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [0] { + } + } + + Class [ class Google\Protobuf\FieldMask implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [1] { + Property [ private $paths ] + } + + - Methods [12] { + Method [ public method __construct ] { + } + + Method [ public method getPaths ] { + } + + Method [ public method setPaths ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\FloatValue implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [1] { + Property [ private $value ] + } + + - Methods [12] { + Method [ public method __construct ] { + } + + Method [ public method getValue ] { + } + + Method [ public method setValue ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\GPBEmpty implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [10] { + Method [ public method __construct ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\Int32Value implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [1] { + Property [ private $value ] + } + + - Methods [12] { + Method [ public method __construct ] { + } + + Method [ public method getValue ] { + } + + Method [ public method setValue ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\Int64Value implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [1] { + Property [ private $value ] + } + + - Methods [12] { + Method [ public method __construct ] { + } + + Method [ public method getValue ] { + } + + Method [ public method setValue ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\ListValue implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [1] { + Property [ private $values ] + } + + - Methods [12] { + Method [ public method __construct ] { + } + + Method [ public method getValues ] { + } + + Method [ public method setValues ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\Method implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [7] { + Property [ private $name ] + Property [ private $request_type_url ] + Property [ private $request_streaming ] + Property [ private $response_type_url ] + Property [ private $response_streaming ] + Property [ private $options ] + Property [ private $syntax ] + } + + - Methods [24] { + Method [ public method __construct ] { + } + + Method [ public method getName ] { + } + + Method [ public method setName ] { + } + + Method [ public method getRequestTypeUrl ] { + } + + Method [ public method setRequestTypeUrl ] { + } + + Method [ public method getRequestStreaming ] { + } + + Method [ public method setRequestStreaming ] { + } + + Method [ public method getResponseTypeUrl ] { + } + + Method [ public method setResponseTypeUrl ] { + } + + Method [ public method getResponseStreaming ] { + } + + Method [ public method setResponseStreaming ] { + } + + Method [ public method getOptions ] { + } + + Method [ public method setOptions ] { + } + + Method [ public method getSyntax ] { + } + + Method [ public method setSyntax ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\Mixin implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [2] { + Property [ private $name ] + Property [ private $root ] + } + + - Methods [14] { + Method [ public method __construct ] { + } + + Method [ public method getName ] { + } + + Method [ public method setName ] { + } + + Method [ public method getRoot ] { + } + + Method [ public method setRoot ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\NullValue ] { + + - Constants [1] { + Constant [ integer NULL_VALUE ] { 0 } + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [0] { + } + } + + Class [ class Google\Protobuf\Option implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [2] { + Property [ private $name ] + Property [ private $value ] + } + + - Methods [14] { + Method [ public method __construct ] { + } + + Method [ public method getName ] { + } + + Method [ public method setName ] { + } + + Method [ public method getValue ] { + } + + Method [ public method setValue ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\SourceContext implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [1] { + Property [ private $file_name ] + } + + - Methods [12] { + Method [ public method __construct ] { + } + + Method [ public method getFileName ] { + } + + Method [ public method setFileName ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\StringValue implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [1] { + Property [ private $value ] + } + + - Methods [12] { + Method [ public method __construct ] { + } + + Method [ public method getValue ] { + } + + Method [ public method setValue ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\Struct implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [1] { + Property [ private $fields ] + } + + - Methods [12] { + Method [ public method __construct ] { + } + + Method [ public method getFields ] { + } + + Method [ public method setFields ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\Syntax ] { + + - Constants [2] { + Constant [ integer SYNTAX_PROTO2 ] { 0 } + Constant [ integer SYNTAX_PROTO3 ] { 1 } + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [0] { + } + } + + Class [ class Google\Protobuf\Timestamp implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [2] { + Property [ private $seconds ] + Property [ private $nanos ] + } + + - Methods [16] { + Method [ public method __construct ] { + } + + Method [ public method fromDateTime ] { + } + + Method [ public method toDateTime ] { + } + + Method [ public method getSeconds ] { + } + + Method [ public method setSeconds ] { + } + + Method [ public method getNanos ] { + } + + Method [ public method setNanos ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\Type implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [6] { + Property [ private $name ] + Property [ private $fields ] + Property [ private $oneofs ] + Property [ private $options ] + Property [ private $source_context ] + Property [ private $syntax ] + } + + - Methods [22] { + Method [ public method __construct ] { + } + + Method [ public method getName ] { + } + + Method [ public method setName ] { + } + + Method [ public method getFields ] { + } + + Method [ public method setFields ] { + } + + Method [ public method getOneofs ] { + } + + Method [ public method setOneofs ] { + } + + Method [ public method getOptions ] { + } + + Method [ public method setOptions ] { + } + + Method [ public method getSourceContext ] { + } + + Method [ public method setSourceContext ] { + } + + Method [ public method getSyntax ] { + } + + Method [ public method setSyntax ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\UInt32Value implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [1] { + Property [ private $value ] + } + + - Methods [12] { + Method [ public method __construct ] { + } + + Method [ public method getValue ] { + } + + Method [ public method setValue ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\UInt64Value implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [1] { + Property [ private $value ] + } + + - Methods [12] { + Method [ public method __construct ] { + } + + Method [ public method getValue ] { + } + + Method [ public method setValue ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } + + Class [ class Google\Protobuf\Value implements Google\Protobuf\Internal\Message ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [1] { + Property [ private $kind ] + } + + - Methods [23] { + Method [ public method __construct ] { + } + + Method [ public method getNullValue ] { + } + + Method [ public method setNullValue ] { + } + + Method [ public method getNumberValue ] { + } + + Method [ public method setNumberValue ] { + } + + Method [ public method getStringValue ] { + } + + Method [ public method setStringValue ] { + } + + Method [ public method getBoolValue ] { + } + + Method [ public method setBoolValue ] { + } + + Method [ public method getStructValue ] { + } + + Method [ public method setStructValue ] { + } + + Method [ public method getListValue ] { + } + + Method [ public method setListValue ] { + } + + Method [ public method getKind ] { + } + + Method [ public method clear ] { + } + + Method [ public method serializeToString ] { + } + + Method [ public method mergeFromString ] { + } + + Method [ public method serializeToJsonString ] { + } + + Method [ public method mergeFromJsonString ] { + } + + Method [ public method mergeFrom ] { + } + + Method [ protected method readOneof ] { + } + + Method [ protected method writeOneof ] { + } + + Method [ protected method whichOneof ] { + } + } + } } } diff --git a/php-pecl-protobuf.spec b/php-pecl-protobuf.spec index 2d25d67..df92870 100644 --- a/php-pecl-protobuf.spec +++ b/php-pecl-protobuf.spec @@ -28,6 +28,8 @@ Group: Development/Languages URL: http://pecl.php.net/package/%{pecl_name} Source0: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz +Patch0: https://patch-diff.githubusercontent.com/raw/google/protobuf/pull/4034.patch + BuildRequires: %{?scl_prefix}php-devel >= 5.5.9 BuildRequires: %{?scl_prefix}php-pear @@ -98,6 +100,7 @@ sed -e 's/role="test"/role="src"/' \ cd NTS +%patch0 -p5 -b .upstream # Sanity check, really often broken extver=$(sed -n '/#define PHP_PROTOBUF_VERSION/{s/.* "//;s/".*$//;p}' protobuf.h) @@ -215,6 +218,9 @@ fi %changelog +* Thu Dec 14 2017 Remi Collet - 3.5.0.1-1 +- add upstream patch to drop timelib_update_ts need + * Thu Dec 7 2017 Remi Collet - 3.5.0.1-1 - Update to 3.5.0.1 (still broken) -- cgit