elephant io symfony2 bundle
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
DependencyInjection add coke Oct 19, 2014
Service fix cs Oct 14, 2016
Tests/Units/Service add coke Oct 19, 2014
.bootstrap.atoum.php fix CS Jun 14, 2015
.coke
.gitignore Added namespace support, elephant io fluent api and some fixes Oct 13, 2016
.travis.yml add coke Oct 19, 2014
NcElephantIOBundle.php first commit Apr 12, 2013
README.md add installation instruction in README Jun 17, 2015
composer.json Upgrade elephantio to 3.1.* Jul 30, 2016

README.md

Elephant IO Bundle

Build Status

knpbundles.com

Sensio insight

Elephant.io library integration in symfony2.

This bundle allows you to communicate with a socket.io server (0.x or 1.x) from a Symfony2 application.

Installation

composer require nc/elephantio-bundle

In your AppKernel

public function registerbundles()
{
    return [
    	...
    	...
    	new Nc\Bundle\ElephantIOBundle\NcElephantIOBundle(),
    ];
}

Configuration sample

nc_elephant_io:
    clients:
        default:
            connection: http://192.168.0.14:3006
            # specify version 0.x for 0.* version and 1.x for 1.0 version
            version: 0.x
        your_key:
            connection: http://192.168.0.14:3000
            version: 1.x

Usage

$client = $this->get('elephantio_client.your_key');
$client->send('event_name', ['foo' => 'test']);

More complex usage

$client = $this->get('elephantio_client.your_key');
$elephantIOClient = $client->getElephantIO();
// Refer to Elephant.io doc

Contribute ?

If you want to improve this bundle, you can use github pull-request and issue