forked from bramp/protoc-gen-php
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:bramp/protoc-gen-php
- Loading branch information
Showing
3 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.o | ||
*.pb.cc | ||
*.pb.h | ||
protoc-gen-php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
#CXX=g++ | ||
CXX=/home/bramp/llvm/Debug/bin/clang | ||
CXX=g++ | ||
#CXX=/home/bramp/llvm/Debug/bin/clang | ||
|
||
CXXFLAGS = -Wall -g | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
This is a PHP Google Protocol Buffer Generator Plugin for protoc. It generates PHP code from a .proto file. | ||
by Andrew Brampton (c) 2010 | ||
|
||
It's not finished, but supports most common features, and I'm currently using it in a production system. | ||
|
||
I've only tested the code on Debian Linux. To build just type "make". You may need the following libraries which can be installed from apt: | ||
|
||
libprotobuf-dev | ||
libprotobuf-lite6 | ||
libprotobuf6 | ||
libprotoc-dev | ||
libprotoc6 | ||
|
||
Once compiled you can use it via protoc like so: | ||
|
||
protoc -I. -I/usr/include --php_out . --plugin=protoc-gen-php=./protoc-gen-php your.proto | ||
|
||
This should generate the file "your.proto.php", which should be able to encode and decode protocol buffer messages. When using the generated PHP code you must include the "protocolbuffers.inc.php" file. | ||
|
||
There are many TODOs to finish, for example writing better documentation :) |