PHPackages                             fanout/gripcontrol - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. fanout/gripcontrol

Abandoned → [fanout/grip](/?search=fanout%2Fgrip)ArchivedLibrary

fanout/gripcontrol
==================

A GRIP library for PHP.

2.1.1(8y ago)2149.1k—1.4%52MITPHPPHP &gt;=5.3.0

Since Jan 19Pushed 8y ago5 watchersCompare

[ Source](https://github.com/fanout/php-gripcontrol)[ Packagist](https://packagist.org/packages/fanout/gripcontrol)[ Docs](https://github.com/fanout/php-gripcontrol)[ RSS](/packages/fanout-gripcontrol/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (13)Used By (2)

php-gripcontrol
===============

[](#php-gripcontrol)

Author: Konstantin Bokarius

A GRIP library for PHP.

License
-------

[](#license)

php-gripcontrol is offered under the MIT license. See the LICENSE file.

Requirements
------------

[](#requirements)

- openssl
- curl
- pthreads (required for asynchronous publishing)
- firebase/php-jwt &gt;=1.0.0 (retreived automatically via Composer)
- fanout/php-pubcontrol &gt;=1.0.6 (retreived automatically via Composer)

Installation
------------

[](#installation)

Using Composer: 'composer require fanout/gripcontrol'

Manual: ensure that php-jwt and php-pubcontrol have been included and require the following files in php-gripcontrol:

```
require 'php-gripcontrol/src/encoding.php';
require 'php-gripcontrol/src/channel.php';
require 'php-gripcontrol/src/response.php';
require 'php-gripcontrol/src/websocketevent.php';
require 'php-gripcontrol/src/websocketmessageformat.php';
require 'php-gripcontrol/src/httpstreamformat.php';
require 'php-gripcontrol/src/httpresponseformat.php';
require 'php-gripcontrol/src/grippubcontrol.php';
require 'php-gripcontrol/src/gripcontrol.php';
```

Asynchronous Publishing
-----------------------

[](#asynchronous-publishing)

In order to make asynchronous publish calls pthreads must be installed. If pthreads is not installed then only synchronous publish calls can be made. To install pthreads recompile PHP with the following flag: '--enable-maintainer-zts'

Also note that since a callback passed to the publish\_async methods is going to be executed in a separate thread, that callback and the class it belongs to are subject to the rules and limitations imposed by the pthreads extension.

See more information about pthreads here:

Usage
-----

[](#usage)

Examples for how to publish HTTP response and HTTP stream messages to GRIP proxy endpoints via the GripPubControl class.

```
