aboutsummaryrefslogtreecommitdiffhomepage
path: root/php/ext/google/protobuf/protobuf.h
diff options
context:
space:
mode:
authorGravatar Paul Yang <TeBoring@users.noreply.github.com>2018-01-05 13:05:07 -0800
committerGravatar GitHub <noreply@github.com>2018-01-05 13:05:07 -0800
commit3823897475df1a42229b15f970fbbdfa9d714804 (patch)
tree1efda4f74b5ba2aa86bfd9f6103d08908fb38e13 /php/ext/google/protobuf/protobuf.h
parent5aa8f98894523b92b1dadd54062546ede706c9a6 (diff)
Well known types are not initialized properly. (#4139)
Previously, within the same load period of protobuf module, well known types are not initialized correctly for the second request. The reason is that well known type are only initialized if a method local static variable is not set. However, that variable is not reset after request ends. Therefore, when the second request comes, the method local static variable is still set (by previous request) and well types are not initialized in this case.
Diffstat (limited to 'php/ext/google/protobuf/protobuf.h')
-rw-r--r--php/ext/google/protobuf/protobuf.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h
index 6ab0f134..be1de5cf 100644
--- a/php/ext/google/protobuf/protobuf.h
+++ b/php/ext/google/protobuf/protobuf.h
@@ -1172,6 +1172,17 @@ extern zend_class_entry* oneof_descriptor_type;
// Well Known Type.
// -----------------------------------------------------------------------------
+extern bool is_inited_file_any;
+extern bool is_inited_file_api;
+extern bool is_inited_file_duration;
+extern bool is_inited_file_field_mask;
+extern bool is_inited_file_empty;
+extern bool is_inited_file_source_context;
+extern bool is_inited_file_struct;
+extern bool is_inited_file_timestamp;
+extern bool is_inited_file_type;
+extern bool is_inited_file_wrappers;
+
PHP_METHOD(GPBMetadata_Any, initOnce);
PHP_METHOD(GPBMetadata_Api, initOnce);
PHP_METHOD(GPBMetadata_Duration, initOnce);