Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 1.48 KB

File metadata and controls

47 lines (30 loc) · 1.48 KB

GRPC in PHP, by Swag Industries

An honest attempt to make a library that runs GRPC asynchronously.

This project is currently experimental, it supports only GRPC client and has not been tested in real world.

Prerequisite

Installation

Install GRPC php:

composer require swag-industries/grpc

Generate your GRPC library based on the proto file:

# On macos the path to the PHP plugin may be something like this:
# /opt/homebrew/Cellar/grpc/1.69.0_1/bin/grpc_php_plugin

protoc --proto_path=tests/resources/protos \
  --php_out=tests/protobuf \
   --grpc_out=generate_server:tests/protobuf \
   --plugin=protoc-gen-grpc=/usr/bin/grpc_php_plugin \
    tests/resources/protos/helloworld.proto

Enjoy using the client you just generated. (usage is somehow documented on official documentation)

Note about ALTS

Google has developed its own security transport layer aside of SSL/TLS. GRPC supports ALTS. Which is the name of the custom transport layer of Google. But GRPC also supports the standard TLS.

No package in PHP can interact with ALTS. This is something extremely custom.

This is why there is currently no plan to support ALTS.

Learn more about GRPC authentication here.