protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

PHP and proto2

Open mvdstam opened this issue 6 years ago • 23 comments

Hi,

At the time of writing, the PHP implementation of protobuf doesn't support files written in proto2 format. Are there any plans on making the PHP implementation backwards compatible with proto2 files?

Thanks!

mvdstam avatar Sep 12 '17 14:09 mvdstam

My expectation will be early next year. On Tue, Sep 12, 2017 at 07:37 Max van der Stam [email protected] wrote:

Hi,

At the time of writing, the PHP implementation of protobuf doesn't support files written in proto2 format. Are there any plans on making the PHP implementation backwards compatible with proto2 files?

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/protobuf/issues/3623, or mute the thread https://github.com/notifications/unsubscribe-auth/AE9H5QHgEzi0epJQdOqzwqWbZwqA_wZwks5sho_ngaJpZM4PUszk .

TeBoring avatar Sep 12 '17 14:09 TeBoring

Thank you @TeBoring, looking forward to it. 😃

mvdstam avatar Sep 12 '17 16:09 mvdstam

Any updates on this at all?

leearmstrong avatar Feb 24 '18 17:02 leearmstrong

Any updates?

vahidrk avatar Apr 24 '18 17:04 vahidrk

The proto2 support work hasn't started yet as far as I can tell. Given that there are still quite some feature gaps and bugs in proto3 support, I wouldn't expect the proto2 work to start any time soon.

xfxyjwf avatar Apr 24 '18 20:04 xfxyjwf

looking forward to it

mosquitood avatar Apr 26 '18 15:04 mosquitood

looking forward to it

sakura1116vg avatar Apr 27 '18 16:04 sakura1116vg

looking forward to it

atbtavares avatar Apr 27 '18 18:04 atbtavares

Yes please

robeyre avatar May 22 '18 13:05 robeyre

looking forward to it

DrayChou avatar May 24 '18 06:05 DrayChou

looking forward to it

DemonTPx avatar May 24 '18 06:05 DemonTPx

Any update on this?

Since all other packages are practically abandoned, there's currently no way to generate PHP classes from proto2.

rauanmayemir avatar Dec 27 '18 15:12 rauanmayemir

Any updates?

victorquan avatar Jan 04 '19 03:01 victorquan

Any updates?

dignwei avatar Aug 30 '19 08:08 dignwei

Any updates?

Duncan00 avatar Apr 22 '20 05:04 Duncan00

Any updates?

UnderTreeTech avatar May 29 '20 06:05 UnderTreeTech

Urgent need

znau avatar Sep 04 '20 04:09 znau

Any updates?

HunterXuan avatar Oct 16 '20 10:10 HunterXuan

Here is my attempt to add support for proto2 https://github.com/anight/protobuf/tree/proto2_support For now only protobuf.so is supported, protobuf-php/protobuf is not. It works with grpc too.

anight avatar Oct 28 '20 16:10 anight

I too seem to need this.

But I was wondering if anyone can suggest any alternatives. Essentially, I need to access the Google-standard transit protobuf GTFS Realtime Protobuf from a PHP server.

As you can see, it's proto2 (and will not compile as proto3).

Does anyone have any idea what the current solution is to use proto2 in PHP?

mjbaldwin avatar Jan 16 '21 15:01 mjbaldwin

@mjbaldwin There were PHP bindings as part of the gtfs-realtime-bindings project here: https://github.com/MobilityData/gtfs-realtime-bindings-php

You can see how the bindings were generated here: https://github.com/MobilityData/gtfs-realtime-bindings-php/blob/master/UPDATING.md

...but I made the decision to drop support because of the fact that PHP wasn't supported by the official Google protocol buffer tooling - it was too much to keep up with a variety of languages using 3rd party tooling.

So, I too would like to see official support for PHP with proto2.

barbeau avatar Jan 19 '21 17:01 barbeau

This is truly unfortunate as protobuf3 is not compatible with protobuf2 when consuming external resources. While most things translate e.g. the default enum values are a big pain and impossible to resolve from the client's perspective.

kiler129 avatar Feb 19 '22 22:02 kiler129

It's very unfortunate that no progress has been made on this front. PHP is a very popular language and deserves official support for proto2.

josephxanderson avatar Oct 18 '22 11:10 josephxanderson