A quick search for pb4php turns up

https://code.google.com/p/pb4php/

which in turn has a link to

http://coderpeek.com/2008-07-17-protocol-buffer-for-php

And the example on there is

"""
$book = new AddressBook();
$person = $book->add_person();
$person->set_name('Kordulla');
$person->set_surname('Nikolai');

$phone_number = $person->add_phone();
$phone_number->set_number('49');
$phone_number->set_type(Person_PhoneType::WORK);

$phone_number = $person->add_phone();
$phone_number->set_number('171');
$phone_number->set_type(Person_PhoneType::MOBILE);

// serialize
$string = $book->SerializeToString();
"""

I guess in order for that to work you need to do something like (from
the first url):

"""
require_once('../parser/pb_parser.php');
$test = new PBParser();
$test->parse('./performance.proto');
"""

which creates the classes specified in the proto at runtime,... Can
you clarify what you're confused by?

On Tue, Feb 11, 2014 at 5:51 AM, Joel Zimmerli <vectorcomm...@gmail.com> wrote:
> Hi,
>
> I need to provide data in Protocol buffers format to Google (transportation
> alert) but I cannot instal/configure a compiler on my website (limitation
> due to the hosting solution).
>
> Fortunately, I found "pb4php" and I'm wondering whether this solution is
> still supported?
>
> I downloaded protocolbuf_025.zip and can load a first sample
> "example/protoc.php" with a good result "string(18) "File parsing done!"".
>
> Now I would like to "generate" a file to send it to Google (generate a .pb
> file), but I cannot understand/see how to do that using the different PHP
> scripts available.
>
> Hope someone can help me on this issue.
> Regards
> Joel
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at http://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to