allegro / php-protobuf

PHP Protobuf - Google's Protocol Buffers for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does php-protobuf support extend

yxjsdly opened this issue · comments

I use php-protobuf to deserialize protobuf body from upstream。The proto definition file like this:
syntax="proto2";
message Foo
{
required int32 bar = 1;
optional string baz = 2;
repeated float spam = 3;
extensions 10 to 990;
}

message Qoo
{
extend Foo {
optional int32 test = 11;
}
}

but when I compile it to php class,and use it to deserialize protobuf body,it does not work well。for example it not sopport function getExtension introduce by https://developers.google.com/protocol-buffers/docs/proto#extensions。So I want ask if php-protobuf support extend,If it support how can I use it。
thank you!

The extensions are unfortunately not supported by php-protobuf. I would advice you to use the official Google's implementation if applicable.