Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

Commit

Permalink
Forcing use of the php-protobuf for protoc >= 3
Browse files Browse the repository at this point in the history
  • Loading branch information
hjagodzinski committed Feb 3, 2018
1 parent 4936b2d commit 6d1da29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ PHP Protobuf comes with Google's protoc compiler plugin. You can run in directly
or pass it to the *protoc*:
protoc --plugin=protoc-gen-php.php --php_out=output_dir foo.proto
Put `protoc-php-gen.php` on the *PATH* or pass absolute path to `protoc`.
protoc --plugin=protoc-gen-allegrophp=protoc-gen-php.php --allegrophp_out=output_dir foo.proto
On Windows use `protoc-gen-php.bat` instead.
Expand Down
6 changes: 3 additions & 3 deletions src/Allegro/Protobuf/Compiler/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private function runProtoc($pluginExecutable)
$this->checkProtoc($protocExecutable);

$cmd[] = $protocExecutable;
$cmd[] = '--plugin=protoc-gen-php=' . escapeshellarg($pluginExecutable);
$cmd[] = '--plugin=protoc-gen-allegrophp=' . escapeshellarg($pluginExecutable);

if ($result->options['proto_path']) {
foreach ($result->options['proto_path'] as $protoPath) {
Expand All @@ -136,7 +136,7 @@ private function runProtoc($pluginExecutable)
}

$customArgs = $this->buildCustomArguments($result);
$cmd[] = '--php_out=' . escapeshellarg($customArgs . ':' . $result->options['out']);
$cmd[] = '--allegrophp_out=' . escapeshellarg($customArgs . ':' . $result->options['out']);

foreach ($result->args['file'] as $file) {
$cmd[] = escapeshellarg($file);
Expand Down Expand Up @@ -200,4 +200,4 @@ private function buildCustomArguments($result)

return http_build_query($args, '', '&');
}
}
}

0 comments on commit 6d1da29

Please sign in to comment.