1. Go to this page and download the library: Download gbksoft/phpcent 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/ */
gbksoft / phpcent example snippets
{
" "gbksoft/phpcent":"~1.0.5",
}
}
$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.