PHP code example of phpdot / realtime
1. Go to this page and download the library: Download phpdot/realtime 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/ */
phpdot / realtime example snippets
use PHPdot\Contracts\Server\ConnectionSenderInterface;
use PHPdot\Realtime\Adapter\TableAdapter;
use PHPdot\Realtime\Contract\Adapter;
use PHPdot\Realtime\Hub;
ConnectionSenderInterface::class => fn ($c) => $c->get(ConnectionRegistry::class),
Adapter::class => fn ($c) => new TableAdapter($c->get(ConnectionSenderInterface::class)),
Hub::class => fn ($c) => new Hub($c->get(Adapter::class), $c->get(ConnectionSenderInterface::class)),