2017 © Pedro Peláez
 

library broadcastt-php-http

PHP library for Broadcastt HTTP API

image

nergal/broadcastt-php-http

PHP library for Broadcastt HTTP API

  • Tuesday, July 24, 2018
  • by nergal
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Broadcastt

codecov , (*1)

Realtime web applications are the future. Broadcastt provides tools to help developers create realtime applications., (*2)

PHP HTTP Library

Be aware that this library is still in beta and not reached the first MAJOR version., (*3)

Semantic Versioning 2.0.0, (*4)

Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable., (*5)

This library is compatible with PHP 7.1+, (*6)

This is a PHP library to interact with the Broadcastt API. If you are looking for a client library or a different server library please check out our list of libraries., (*7)

For tutorials and more in-depth documentation, visit the official site., (*8)

Documentation

First steps

Require this package, with Composer, (*9)

composer require broadcastt/broadcastt-php-http

Configuration

$appId = 'YOUR_APP_ID';
$appKey = 'YOUR_APP_KEY';
$appSecret = 'YOUR_APP_SECRET';
$appCluster = 'YOUR_APP_CLUSTER';

$client = new Broadcastt\BroadcasttClient( $appId, $appKey, $appSecret, $appCluster );
// or
$client = Broadcastt\BroadcasttClient::fromUri("http://{$appKey}:{$appSecret}@{$appCluster}.broadcastt.xyz/apps/{$appId}");

appId (Integer)

The id of the application, (*10)

appKey (String)

The key of the application, (*11)

appSecret (String)

The secret of the application, (*12)

appCluster (String) Optional

The cluster of the application, (*13)

Default value: eu, (*14)

Modifiers

scheme (String)

E.g. http or https, (*15)

Default value: http, (*16)

host (String)

The host e.g. cluster.broadcastt.xyz. No trailing forward slash, (*17)

Default value: eu.broadcasttapp.xyz If the cluster is not set during initialization, (*18)

port (String)

The http port, (*19)

Default value: 80, (*20)

basePath (String)

The base of the path what the request will call. {appId} can be used to automatically parse the app ID in the base path., (*21)

Default value: /apps/{appId}, (*22)

timeout (String)

The http timeout, (*23)

Default value: 30, (*24)

guzzleClient (Mixed[])

Guzzle Client for sending HTTP requests, (*25)

If not set it will be initialized without any parameters on the first request, (*26)

Helpers

fromUri($uri)

Instantiate a new client from the given uri., (*27)

These are methods which help you modify the instance, (*28)

useCluster($cluster)

Modifies the host value for given cluster, (*29)

encrypted()

Short way to change scheme to https and port to 443, (*30)

Usage

trigger($channels, $name, $data, $socketId = null, $jsonEncoded = false)

Trigger an event by providing event name and payload., (*31)

Optionally provide a socket ID to exclude a client (most likely the sender)., (*32)

triggerBatch($batch = [], $encoded = false)

Trigger multiple events at the same time., (*33)

get($path, $params = [])

GET arbitrary REST API resource using a synchronous http client., (*34)

All request signing is handled automatically., (*35)

Contributing

Everyone is welcome who would help to make this library "Harder, Better, Faster, Stronger"., (*36)

The Versions

24/07 2018

dev-master

9999999-dev https://broadcastt.xyz/

PHP library for Broadcastt HTTP API

  Sources   Download

MIT

The Requires

 

rest events realtime messaging push publish trigger real time broadcast real-time broadcastt

24/07 2018

dev-develop

dev-develop https://broadcastt.xyz/

PHP library for Broadcastt HTTP API

  Sources   Download

MIT

The Requires

 

rest events realtime messaging push publish trigger real time broadcast real-time broadcastt

24/07 2018

0.1.0

0.1.0.0 https://broadcastt.xyz/

PHP library for Broadcastt HTTP API

  Sources   Download

MIT

The Requires

 

rest events realtime messaging push publish trigger real time broadcast real-time broadcastt