diff options
author | Paul Yang <TeBoring@users.noreply.github.com> | 2017-09-05 14:10:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-05 14:10:32 -0700 |
commit | 7f8b91f552e80964d995712c26306410854d8ad1 (patch) | |
tree | d00ef6869c14f07672f75e23988a3ab1db20dbf7 /php/ext/google/protobuf/protobuf.h | |
parent | 35b852f5b84c4bd3cd49652e9473a001aa00d295 (diff) | |
download | protobuf-7f8b91f552e80964d995712c26306410854d8ad1.tar.gz |
Add native php support for Duration. (#3583)
Diffstat (limited to 'php/ext/google/protobuf/protobuf.h')
-rw-r--r-- | php/ext/google/protobuf/protobuf.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h index 8ad7f6caf..d4ab2ce8e 100644 --- a/php/ext/google/protobuf/protobuf.h +++ b/php/ext/google/protobuf/protobuf.h @@ -519,6 +519,7 @@ static inline int php_proto_zend_lookup_class( struct Any; struct DescriptorPool; struct Descriptor; +struct Duration; struct EnumDescriptor; struct EnumValueDescriptor; struct FieldDescriptor; @@ -536,6 +537,7 @@ struct Timestamp; typedef struct Any Any; typedef struct DescriptorPool DescriptorPool; typedef struct Descriptor Descriptor; +typedef struct Duration Duration; typedef struct EnumDescriptor EnumDescriptor; typedef struct EnumValueDescriptor EnumValueDescriptor; typedef struct FieldDescriptor FieldDescriptor; @@ -560,6 +562,7 @@ ZEND_END_MODULE_GLOBALS(protobuf) // Init module and PHP classes. void any_init(TSRMLS_D); void descriptor_init(TSRMLS_D); +void duration_init(TSRMLS_D); void enum_descriptor_init(TSRMLS_D); void descriptor_pool_init(TSRMLS_D); void internal_descriptor_pool_init(TSRMLS_D); @@ -1034,6 +1037,12 @@ PHP_METHOD(Any, unpack); PHP_METHOD(Any, pack); PHP_METHOD(Any, is); +PHP_METHOD(Duration, __construct); +PHP_METHOD(Duration, getSeconds); +PHP_METHOD(Duration, setSeconds); +PHP_METHOD(Duration, getNanos); +PHP_METHOD(Duration, setNanos); + PHP_METHOD(Timestamp, __construct); PHP_METHOD(Timestamp, fromDateTime); PHP_METHOD(Timestamp, toDateTime); @@ -1043,6 +1052,7 @@ PHP_METHOD(Timestamp, getNanos); PHP_METHOD(Timestamp, setNanos); extern zend_class_entry* any_type; +extern zend_class_entry* duration_type; extern zend_class_entry* timestamp_type; // ----------------------------------------------------------------------------- |