PHP code example of nc / faye-client

1. Go to this page and download the library: Download nc/faye-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nc / faye-client example snippets

 php
$adapter = new \Nc\FayeClient\Adapter\CurlAdapter();

$client = new \Nc\FayeClient\Client($adapter, 'http://127.0.0.1/faye');

$client->send("/channel1", array("name" => "foo"), array("token" => "456454sdqd"));
 php
/**
 * Send message
 * @param  string $channel message channel
 * @param  array  $data    Data to send
 * @param  array  $ext     Extra data
 */
public function send($channel, $data = array(), $ext = array());
 bash
php vendor/bin/atoum -D tests/ -bf tests/bootstrap.php