<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
stanislav-web / zf2-websocket-server-factory example snippets
php composer.phar install -o
// for example
echo $this->socket()->config('host'); // print 127.0.0.1
$result .= isset($row[0]) ? $row[0] . "\n" : '';
src\WebSockets\Aware\ApplicationInterface.php
src\WebSockets\Application\Chat.php
// get factory container
$factory = new ApplicationFactory($this->getServiceLocator());
// applications from response <app>
// get it @see /src/WebSockets/Application/Chat.php etc..
$client = $request->getParam('app');
$app = $factory->dispatch(ucfirst($client));
// bind events from application
// ! must be implements of your every new Application
$app->bind('open', 'onOpen');
$app->bind('message', 'onMessage');
$app->bind('close', 'onClose');
// running server
$app->run();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.