2017 © Pedro Peláez
 

library faye-php

This is a PHP wrapper for interacting with the Faye server.

image

anchu/faye-php

This is a PHP wrapper for interacting with the Faye server.

  • Monday, November 18, 2013
  • by anchu
  • Repository
  • 1 Watchers
  • 8 Stars
  • 60 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Faye PHP Library

This is a PHP library for interacting with the Faye server. Faye is a publish-subscribe messaging system based on the Bayeux protocol., (*1)

Installation

You can get the Faye PHP library via composer package. See https://packagist.org/packages/anchu/faye-php, (*2)

Or you can clone or download the library files., (*3)

Faye constructor

Use the Faye server configurations to create a new Faye instance., (*4)

$host = 'YOUR_FAYE_HOST';
$mountPoint = 'YOUR_FAYE_MOUNT_POINT';
$port = 'YOUR_FAYE_PORT'; //by default this will be 8000

$faye = new Faye($host, $mountPoint, $port);

Publishing/Triggering messges

To trigger a message on a channel use the trigger function., (*5)

$faye->trigger( 'my-channel', 'my_event', 'hello world' );

Arrays

Objects are automatically converted to JSON format:, (*6)

$array['status'] = 'success';
$array['action'] = 'continue';

$faye->trigger('my_channel', 'my_event', $array);

The output of this will be:, (*7)

"{'event': 'my_event', 'message': {'status': 'success', 'action': 'continue'}}"

License

Copyright 2013, Harish A. Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php, (*8)

The Versions

18/11 2013

dev-master

9999999-dev

This is a PHP wrapper for interacting with the Faye server.

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-curl *

 

by Harish Anchu

rest events realtime publish trigger php-faye-server faye