首页 > 解决方案 > 如何从 Proto 规范中获取 PHP 的服务(服务器文件)?

问题描述

尽管 PHP 服务器不受官方支持,但我不应该从 protoc+grpc_php_plugin 获得服务吗?跑步:

#!/usr/bin/env bash
protoc --proto_path=./ \
       --php_out=./generated \
       --grpc_out=./generated \
       --plugin=protoc-gen-grpc=../../../../grpc/bins/opt/grpc_php_plugin \
       ./greeter.proto

超过:

syntax = "proto3";

// The greeting service definition.
service Greeter {
  // Sends a greeting
  rpc SayHello (HelloRequest) returns (HelloReply) {}
}

// The request message containing the user's name.
message HelloRequest {
  string name = 1;
}

// The response message containing the greetings
message HelloReply {
  string message = 1;
}

我只得到GreeterClient.php. 我不应该也得到一个GreeterService.php吗?

标签: phpprotocol-buffersgrpc

解决方案


推荐阅读