2017 © Pedro Peláez
 

library fire-ws-php

PHP client for FireWS real-time messaging server and store

image

dizard/fire-ws-php

PHP client for FireWS real-time messaging server and store

  • Thursday, April 27, 2017
  • by dizard
  • Repository
  • 1 Watchers
  • 0 Stars
  • 105 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 3 % Grown

The README.md

FireWs-API-PHP

composer require dizard/fire-ws-php, (*1)

For communicate with Fire Web Socket Server, (*2)

Example, (*3)

use FireWSClient\FireWSClient;
$nameSpace = 'nameYouNamePace';
$userId = 5;
$ttl = 60;

try{
    $Client = new FireWSClient('tcp://127.0.0.1:8085');
    $sKeyForNameSpace = $Client->registerNameSpace($nameSpace,'secretKeyForServer');

    $Client->auth($nameSpace, $sKeyForNameSpace);
    $Client->send('channel', ['message' => 'hello world']);

    // Send Message for user with id 5
    $Client->send('@channel', ['message' => 'hello world'], $userId);

    // Send base state for channel
    // the state send user after subscribe there channel
    $Client->setAndSend('channel', ['message' => 'hello world']);
    // the state send user after subscribe there channel
    $Client->setAndSend('@channel', ['message' => 'hello world'], $userId);
    // the state send user after subscribe there channel with lifetime $ttl
    $Client->setAndSend('@channel', ['message' => 'hello world'], $userId, $ttl);

    // get base state channel
    $stateChannel = $Client->get('channel');

    // get base state channel for user with $userId
    $stateChannel = $Client->get('@channel', $userId);

    // Subscribe to private channel
    $Client->subscribe('#privateChannel', $userId);

    // Unsubscribe from private channel
    $Client->unsubscribe('#privateChannel', $userId);

    $channelInf = $Client->channelInfo('channel');
}catch(\FireWSClient\Exceptions\FireWsException $e) {

}

The Versions

27/04 2017

dev-master

9999999-dev https://github.com/dizard/fire-ws-php

PHP client for FireWS real-time messaging server and store

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Mikhail Mankov

websocket firews firewsclient

01/03 2017

dev-ticket_1

dev-ticket_1 https://github.com/dizard/fire-ws-php

PHP client for FireWS real-time messaging server and store

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Mikhail Mankov

websocket firews firewsclient