Merge pull request #11271 from stanley-cheung/php-fix-codegen-comments

PHP: Fixed bug in protoc plugin escaping comments
pull/11280/head^2
Stanley Cheung 8 years ago committed by GitHub
commit cf2b01db15
  1. 10
      package.xml
  2. 21
      src/compiler/php_generator.cc
  3. 10
      templates/package.xml.template

@ -10,7 +10,7 @@
<email>grpc-packages@google.com</email>
<active>yes</active>
</lead>
<date>2017-05-05</date>
<date>2017-05-22</date>
<time>16:06:07</time>
<version>
<release>1.4.0dev</release>
@ -23,14 +23,18 @@
<license>BSD</license>
<notes>
- Fixed some memory leaks #9559, #10996
- Disabled cares dependency from gRPC C Core #10940
- De-coupled protobuf dependency #11112
- Fixed extension reported version #10842
- Added config.w32 for Windows support #8161
- Fixed PHP distrib test after cc files were added #11193
- Fixed protoc plugin comment escape bug #11025
</notes>
<contents>
<dir baseinstalldir="/" name="/">
<file baseinstalldir="/" name="config.m4" role="src" />
<file baseinstalldir="/" name="config.w32" role="src" />
<file baseinstalldir="/" name="src/php/README.md" role="src" />
<file baseinstalldir="/" name="src/php/ext/grpc/CREDITS" role="src" />
<file baseinstalldir="/" name="src/php/ext/grpc/LICENSE" role="src" />
<file baseinstalldir="/" name="src/php/ext/grpc/byte_buffer.c" role="src" />
<file baseinstalldir="/" name="src/php/ext/grpc/call.c" role="src" />
<file baseinstalldir="/" name="src/php/ext/grpc/call_credentials.c" role="src" />

@ -67,12 +67,11 @@ void PrintMethod(const MethodDescriptor *method, Printer *out) {
vars["input_type_id"] = MessageIdentifierName(input_type->full_name());
vars["output_type_id"] = MessageIdentifierName(output_type->full_name());
out->Print("/**\n");
out->Print(GetPHPComments(method, " *").c_str());
out->Print(GetPHPComments(method, " //").c_str());
if (method->client_streaming()) {
out->Print(vars,
" * @param array $$metadata metadata\n"
" * @param array $$options call options\n */\n"
" // @param array $$metadata metadata\n"
" // @param array $$options call options\n"
"public function $name$($$metadata = [], "
"$$options = []) {\n");
out->Indent();
@ -87,9 +86,9 @@ void PrintMethod(const MethodDescriptor *method, Printer *out) {
"$$metadata, $$options);\n");
} else {
out->Print(vars,
" * @param \\$input_type_id$ $$argument input argument\n"
" * @param array $$metadata metadata\n"
" * @param array $$options call options\n */\n"
" // @param \\$input_type_id$ $$argument input argument\n"
" // @param array $$metadata metadata\n"
" // @param array $$options call options\n"
"public function $name$(\\$input_type_id$ $$argument,\n"
" $$metadata = [], $$options = []) {\n");
out->Indent();
@ -116,10 +115,10 @@ void PrintService(const ServiceDescriptor *service, Printer *out) {
out->Print(vars, "class $name$Client extends \\Grpc\\BaseStub {\n\n");
out->Indent();
out->Print(
"/**\n * @param string $$hostname hostname\n"
" * @param array $$opts channel options\n"
" * @param \\Grpc\\Channel $$channel (optional) re-use channel "
"object\n */\n"
" // @param string $$hostname hostname\n"
" // @param array $$opts channel options\n"
" // @param \\Grpc\\Channel $$channel (optional) re-use channel "
"object\n"
"public function __construct($$hostname, $$opts, "
"$$channel = null) {\n");
out->Indent();

@ -12,7 +12,7 @@
<email>grpc-packages@google.com</email>
<active>yes</active>
</lead>
<date>2017-05-05</date>
<date>2017-05-22</date>
<time>16:06:07</time>
<version>
<release>${settings.php_version.php()}</release>
@ -25,14 +25,18 @@
<license>BSD</license>
<notes>
- Fixed some memory leaks #9559, #10996
- Disabled cares dependency from gRPC C Core #10940
- De-coupled protobuf dependency #11112
- Fixed extension reported version #10842
- Added config.w32 for Windows support #8161
- Fixed PHP distrib test after cc files were added #11193
- Fixed protoc plugin comment escape bug #11025
</notes>
<contents>
<dir baseinstalldir="/" name="/">
<file baseinstalldir="/" name="config.m4" role="src" />
<file baseinstalldir="/" name="config.w32" role="src" />
<file baseinstalldir="/" name="src/php/README.md" role="src" />
<file baseinstalldir="/" name="src/php/ext/grpc/CREDITS" role="src" />
<file baseinstalldir="/" name="src/php/ext/grpc/LICENSE" role="src" />
% for source in php_config_m4.src + php_config_m4.headers:
<file baseinstalldir="/" name="${source}" role="src" />
% endfor

Loading…
Cancel
Save