1. Go to this page and download the library: Download superbalist/php-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/ */
/**
* Subscribe a handler to a channel.
*
* @param string $channel
* @param callable $handler
*/
public function subscribe($channel, callable $handler);
/**
* Publish a message to a channel.
*
* @param string $channel
* @param mixed $message
*/
public function publish($channel, $message);
/**
* Publish multiple messages to a channel.
*
* @param string $channel
* @param array $messages
*/
public function publishBatch($channel, array $messages);
bash
composer
bash
$ php examples/LocalExample.php
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.