Download the PHP package gockets-project/gockets-php without Composer
On this page you can find all versions of the php package gockets-project/gockets-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gockets-project/gockets-php
More information about gockets-project/gockets-php
Files in gockets-project/gockets-php
Package gockets-php
Short Description PHP client for Gockets https://github.com/gockets-project/gockets
License MIT
Informations about the package gockets-php
Gockets
Gockets is daemon written in Golang to give languages, like PHP a middleware for REST-oriented communication with Websockets.
Gockets PHP
This library provides implemented and ready to use interface for gockets daemon.
Installation via Composer
composer require gockets-project/gockets-php
Quickstart
Setup Gockets server
Setup PHP client
Prepare channel
Creates new channel. Can accept optional argument instance of Gockets\Model\ChannelOptions
.
Gockets\Model\Сhannel
example:
Show channel
Returns specific channel.
Show all channels
Returns empty or filled with Gockets\Model\Сhannel
objects array.
Edit channel
Use to modify specific channel attributes (change hook url or tag).
Publish data
Send some data to channel.
In this example $channel
variable contains Gockets\Model\Сhannel
object.
Gockets\Model\Response $response
example:
Always try to ensure that $success
property of response is true
.
Close channel
Closes connection and removes channel.
Error handling
Mostly error handling currently in development, but in case if publisher token was not found library throws Gockets\Exception\ChannelNotFoundException
.
In bin
directory located Gockets builded instance for Linux. For more information about Golang project refer to it's page.