First, install protobuf from source
Second, install php-protocolbuffers
please add following line to your php.ini
Third, install composer.phar
Fourth, install protoc-gen-php
add protocolbuffers/protoc-gen-php entry to your global composer.json ($HOME/.composer/composer.json)
install with composer
set PATH (add this line to your .bashrc or .zshrc.)
Fifth, just make a demo
demo .proto file definition
okay, let’s generate php classes with protoc
when you want to use openviewmobile\Person class, you just do require person.proto.php.
Google Protocol Buffers Official Doc
php-protocolbuffers wiki
Protocol Buffers – Google’s data interchange format