1. Go to this page and download the library: Download huangzonglong/pubsub 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/ */
huangzonglong / pubsub example snippets
$client = new Pubsub\PubSubClient('localhost:9900', [
'credentials' => Grpc\ChannelCredentials::createInsecure(),
]);
$Identity = new \Pubsub\Identity();
$Identity->setClientId($clientId);
$Subscription= new \Pubsub\Subscription();
$Subscription->setTopic($topic);
$SubscribeRequest = new \Pubsub\SubscribeRequest();
$SubscribeRequest->setSubscription($Subscription);
$SubscribeRequest->setIdentity($Identity);