PHPackages                             fanout/fanout - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. fanout/fanout

Abandoned → [fanout/grip](/?search=fanout%2Fgrip)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

fanout/fanout
=============

A PHP convenience library for publishing messages to Fanout.io using the EPCP protocol.

2.1.0(8y ago)068.5k↓25%33MITPHPPHP &gt;=5.3.0

Since Jan 17Pushed 8y ago4 watchersCompare

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

READMEChangelogDependencies (3)Versions (10)Used By (3)

php-fanout
==========

[](#php-fanout)

Author: Konstantin Bokarius

A PHP convenience library for publishing messages to Fanout.io using the EPCP protocol.

License
-------

[](#license)

php-fanout 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/fanout'

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

```
require 'php-fanout/src/jsonobjectformat.php';
require 'php-fanout/src/fanout.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)

```
