aztech / event-bus-extra-mixpanel

此包最新版本(v1.0.2)没有可用的许可信息。

aztech/event-bus Mixpanel 发布者提供商

v1.0.2 2014-08-28 15:07 UTC

This package is not auto-updated.

Last update: 2024-09-24 01:23:12 UTC


README

构建状态

Build Status Code Coverage Scrutinizer Quality Score Dependency Status HHVM Status

稳定性

Latest Stable Version Latest Unstable Version

安装

通过 Composer

Composer 是安装 aztech/event-bus-extra-mixpanel 的唯一支持方式。您还不知道 Composer 吗? 了解更多信息

$ composer require "aztech/event-bus-extra-mixpanel":"~1"

自动加载

将以下代码添加到您的 bootstrap 文件中

require_once 'vendor/autoload.php';

依赖项

  • mixpanel/mixpanel-php : ~2

支持元素

  • 持久发布

配置选项及默认值

always-flush 参数在您想在使用插件的长运行过程中非常有用。默认情况下,Mixpanel API 仅在执行周期结束时刷新发送的事件。这对于大多数情况来说是不错的,但在长运行过程中,您可以将此选项设置为 true 以确保 API 在每次发布后都会刷新事件。

初始化

require_once 'vendor/autoload.php';

use \Aztech\Events\Bus\Events;
use \Aztech\Events\Bus\Plugins\Mixpanel\Mixpanel;

Mixpanel::loadPlugin('mix');

// See options chart for actual parameters
$options = array('project-token' => 'YOUR_TOKEN');

$publisher = Events::createPublisher('mix', $options);
$event = Events::create('category', array('property' => 'value'));

$publisher->publish($event);
// ...