1. protoc-gen-php(1)
  2. Protobuf-PHP
  3. protoc-gen-php(1)

NAME

protoc-gen-php - protoc compiler plugin

SYNOPSIS

protoc-gen-php [-v] [-o directory] [-i directory] file...

DESCRIPTION

protoc-gen-php is a Google's Protocol Buffers compiler plugin for the protoc tool. It generates PHP classes compatible with Protobuf for PHP from .proto files.

REQUIREMENTS

protoc-gen-php is written in PHP using features first found on PHP 5.3. It also requires the Console_CommandLine package from Pear.

Additionally you'll also need to have a working copy of Google Protocol Buffers's protoc command, version 2.3 or above, available on your path.

OPTIONS

The command accepts the following command-line options (switches).

EXAMPLES

Generate a PHP file from a proto file:

$ protoc-gen-php tutorial.proto

Generate PHP files in the "build" directory for each proto file found the "protos" directory:

$ protoc-gen-php -o build protos/*.proto

Generate a PHP file from a proto file using imports from an include path:

$ protoc-gen-php -i ./protos protos/tutorial.proto

Generate a PHP file with a custom extension

$ protoc-gen-php -Dsuffix=pb.php tutorial.proto

BUGS

Please report bugs using GitHub's issue tracker at http://github.com/drslump/protobuf-php/issues

Protobuf for PHP is Copyright (C) 2011 Ivan -DrSlump- Montes http://pollinimini.net

SEE ALSO

protobuf-php(3), protobuf-php(5), http://github.com/drslump/protobuf-php

  1. Ivan -DrSlump- Montes
  2. July 2011
  3. protoc-gen-php(1)