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

Commit 6d1da29

Browse files
committed
Forcing use of the php-protobuf for protoc >= 3
1 parent 4936b2d commit 6d1da29

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ PHP Protobuf comes with Google's protoc compiler plugin. You can run in directly
111111
112112
or pass it to the *protoc*:
113113
114-
protoc --plugin=protoc-gen-php.php --php_out=output_dir foo.proto
115-
116-
Put `protoc-php-gen.php` on the *PATH* or pass absolute path to `protoc`.
114+
protoc --plugin=protoc-gen-allegrophp=protoc-gen-php.php --allegrophp_out=output_dir foo.proto
117115
118116
On Windows use `protoc-gen-php.bat` instead.
119117

src/Allegro/Protobuf/Compiler/Compiler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private function runProtoc($pluginExecutable)
127127
$this->checkProtoc($protocExecutable);
128128

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

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

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

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

201201
return http_build_query($args, '', '&');
202202
}
203-
}
203+
}

0 commit comments

Comments
 (0)