nc / faye-client
Php client for interacting with faye server
Installs: 174 708
Dependents: 4
Suggesters: 0
Security: 0
Stars: 27
Watchers: 4
Forks: 3
Open Issues: 0
Requires
- php: >=5.3.0
Requires (Dev)
- atoum/atoum: dev-master
- guzzle/guzzle: ~3.0
Suggests
- guzzle/guzzle: ~3.0
This package is not auto-updated.
Last update: 2024-12-16 15:02:52 UTC
README
PHP 5.3+ library to push message to a faye server.
Instalation
via composer
{ "require": { "nc/faye-client": "~1.0", # if you want to use guzzle adapter "guzzle/guzzle": "~3.0" } }
Usage
$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"));
Client Send method documentation
/** * 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());
Adapter to post JSON
* CurlAdapter : `Nc\FayeClient\Adapter\CurlAdapter`
* GuzzleAdapter : `Nc\FayeClient\Adapter\GuzzleAdapter`
Run test
php vendor/bin/atoum -D tests/ -bf tests/bootstrap.php