Socket.io PHP client
PHP JavaScript
Switch branches/tags
Nothing to show
Pull request Compare This branch is 59 commits ahead, 144 commits behind Wisembly:master.
Latest commit 26cb17c Jun 29, 2013 @bazo bazo Example update
Permalink
Failed to load latest commit information.
example
lib/Tembo
test Refactoring Jun 29, 2013
.gitignore Example update Jun 29, 2013
.travis.yml
composer.json
license.txt Updated license and readme Jun 29, 2013
phpunit.xml Updated license and readme Jun 29, 2013
readme.md

readme.md

Tembo

MIT Licensed - Copyright © 2013. Martin Bažík

About

Tembo is a rough socket.io client written in PHP. Its goal is to ease communications between your PHP application and a socket.io server. Protocol version of socket.io currently supported is 1. Only websocket transport is available at the moment.

Usage

Sending messages

use Tembo\Message;
use Tembo\SocketIOClient;

$client = new SocketIOClient('http://localhost:8000');

$client->connect();

//send message
$client->message($message);

//emit event
$args = [...];
$client->emit($event, $args);

$client->disconnect();

Listening to incoming messages

use Tembo\Message;

$callback = function($eventType, Message $message) {
	$eventName = $message->getName();
	$args = $message->getArgs();
};

$client->listen($callback);

Licence

This software is distributed under MIT License. See license.txt file for more info.

Special Thanks

Special thanks goes to Wisembly team authors of Elephant.io