PHP code example of wechaty / php-grpc

1. Go to this page and download the library: Download wechaty/php-grpc library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wechaty / php-grpc example snippets




$client = new \Wechaty\PuppetClient("localhost:8788", [
    'credentials' => Grpc\ChannelCredentials::createInsecure()
]);
$request = new \Wechaty\Puppet\DingRequest();
list($response, $status) = $client->Ding($request)->wait();
echo sprintf("code: %s, msg: %s \n", $status->code, $status->details);
shell script
sudo yum install php72-php-pecl-grpc
sudo yum install php72-php-pecl-protobuf