Generating PHP class files from a .proto file for an protocolbuffer problems

时间:2015-11-12 10:49:01

标签: php

Question Does anyone know how to correctly create php classes from the proto files of a protocol buffer on a mac (10.7.5). Or on any other machine. Or could anyone simply give me these for the metro lines in Amsterdam, San Fransico and Vienna?

Context After some days work installing ibprotoc 2.4.1 (because newer versions gave me another error during generation) pear homebrew etcetera, I have not managed to create a working class file. I dowloaded correct working class files for MTA (github.com/pnf/mta) from this guy (dougla...gmail.com on https://groups.google.com/forum/#!searchin/mtadeveloperresources/php/mtadeveloperresources/k2Pl7WdGPRg/4W4koGrJxnsJ) , but I am not able to produce the same results for the other cities, or to replicate these files for MTA.

We need these clases for an interactive art project.

my efforts so far When I use the correct proto files from MTA I can run

protoc-gen-php -i . nyct-subway.proto

which gives me the class files but while doing so generating multiple errors like

WARNING: Non tracked package name found "TripReplacementPeriod"

Running my php programm (fetching the buffers and converting them with these classes) gives me the error

PHP Warning: First parameter must either be an object or the name of an existing class

Which does not surprise me of course ...

0 个答案:

没有答案