PHP code example of beekirr / centrifugal-php-client
1. Go to this page and download the library: Download beekirr/centrifugal-php-client 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/ */
beekirr / centrifugal-php-client example snippets
{
" "sl4mmer/phpcent":"dev-master",
}
}
$client = new \phpcent\Client("http://localhost:8000");
$client->setSecret("secret key from Centrifugo");
$client->publish("main_feed", ["message" => "Hello Everybody"]);
$history = $client->history("main_feed");
$client = new \phpcent\Client("https://localhost:8000");
$client->setSecret("secret key from Centrifugo");
$transport = new \phpcent\Transport();
$transport->setCert("/path/to/certificate.pem");
$client->setTransport($transport);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.