allegro / php-protobuf

PHP Protobuf - Google's Protocol Buffers for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

.proto2 - Files instead of .proto3

Balowser opened this issue · comments

Hello,

I want to Create some php classes with .proto - Files of the Version 2, but php-protobuf only works with Version 3 Files.
Is there a workaround to work with .proto 2 Files?

The compiler supports both versions 2 and 3. Can you show code snippet that doesn't work?

Can you show me code example of what you're doing?

Sure.

I just call the generated .php class which I created out of the .proto files.

<?php
namespace tinterface;


require_once 'ApiArray.php';


?>

Can you show me your proto file? Do you use project's master branch to compile your proto file?

Do you have an E-Mail Address?
I don't want to show the file to everybody because it is from an third company

You can send it to hubert.jagodzinski@allegrogroup.com. I'm busy right now I will try to take a look at this shortly.

Okay, send it.

Thanks and no Problem!

@FZUPotato are you sure you posted the comment where you intended to?

@hjagodzinski ,
hello,
i follow the steps of readme file, but i got the error:
image
the content of foo.proto:
image
Is there a workaround to work with .proto 2 Files? Thank you!

@myggithub I haven't used protobuf for very long time it seems you have installed protobuf with native PHP support (it doesn't support .proto2). The compilation would produce code for native implementation, not for php-protobuf. If you still want to use php-protobuf you need to downgrade protobuf to version < 3.

@hjagodzinski ,thanks your reply!

@hjagodzinski ,sorry!I have already delete it.I have the same problem with KalimKaLo.i have already generate php classes, but the class is extend \Google\Protobuf\Internal\Message? what should i do let the generated class extend from ProtobufMessage like the Bar claess

@FZUPotato no problem :) It means you use protoc having native PHP support. Take a look at my previous answer. That problem is somewhat related to yours.

I need to downgrade protobuf to version < 3? But my proto file is proto3,Does it works?