yagobski / phpcent

Php library to communicate with Centrifuge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Phpcent

Php library to communicate with Centrifuge

Library is published on the Composer: https://packagist.org/packages/sl4mmer/phpcent

{
    "require": {
        "sl4mmer/phpcent":"dev-master",
    }
}

For old Centrifuge versions (<0.8) require "sl4mmer/phpcent":"0.5.0"

Full Centrifuge documentation http://centrifuge.readthedocs.org/en/latest/

Basic Usage

        
        $client = new \phpcent\Client("http://localhost:8000");
        $client->setProject("projectKey", "projectSecret");
        $client->publish("basic:main_feed", ["message" => "Hello Everybody"]);
        $history = $client->history("basic:main_feed")];
        

All api methods for managing channels has shortends. You can call other methods trough Client::send()

$client->send("namespace_create",["name"=>"newnamespace"])

You can use phpcent to create frontend token

	$token = $client->setProject($pKey, $pSecret)->buildSign($user . $timestamp);         

About

Php library to communicate with Centrifuge

License:MIT License


Languages

Language:PHP 100.0%