Twirp PHP generator
Installation
go get -u github.com/99designs/protoc-gen-twirp_php
You will also need:
Generating PHP
The twirp Haberdasher example
can be found in example/
:
cd example
protoc --twirp_php_out . --php_out . haberdasher.proto
Using the client
The generated client uses Guzzle v6 for making requests.
A dependency is not ideal, but the PHP standard library is lacking in this department.
$client = new GuzzleHttp\Client([
'base_uri' => $myHost . '/twirp/' // supports soon to be released twirp v6
]);
$haberdasher = new Twirp\Example\Haberdasher\HaberdasherClient($client);
$haberdasher->makeHat(...)