fanout/fanout 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fanout/fanout

最新稳定版本:2.1.0

Composer 安装命令:

composer require fanout/fanout

包简介

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

README 文档

README

Author: Konstantin Bokarius kon@fanout.io

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

License

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

Requirements

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

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

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: http://php.net/manual/en/book.pthreads.php

Usage

<?php

$fanout = new Fanout\Fanout('<realm>', '<realmkey>');
$fanout->publish('<channel>', 'Test publish!');

// Use publish_async for async publishing only if pthreads are installed:
// $fanout->publish_async('<channel>', 'Test async publish!', null, null,
//         'callback');
?>

统计信息

  • 总下载量: 68.31k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 7
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-17