br0sk/yii2-connect 问题修复 & 功能扩展

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

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

br0sk/yii2-connect

最新稳定版本:0.1.1

Composer 安装命令:

composer create-project br0sk/yii2-connect

包简介

The getconnect.io API for Yii2

README 文档

README

A Yii2 extension for http://getconnect.io/

This is an extension for Yii2 that makes it easy to use http://getconnect.io/.

Right now their PHP SDK only supports pushing events.

You can configure it in your application configuration like so:

'connect' => [
	'class' => 'br0sk\connect\Connect',
	'projectId' => 'yourprojectid',
	'pushApiKey' 	=> 'yourpushapikey',
]

note: You can find the project id and push API key in the control panel for you project here.

Adding it to your components array.

Pushing an event is as easy as:

	$event = ['purchase' => ['item' => 'My item 1']];
	Yii::$app->connect->push('purchases', $event);

You can also push multiple events at once like this:

$batch = [
	'purchases' => [
		[
			'customer' => [
			'firstName' => 'Tom',
			'lastName' => 'Smith'
			],
			'product' => '12 red roses',
			'purchasePrice' => 34.95
		],
		[
			'customer' => [
			'firstName' => 'Fred',
			'lastName' => 'Jones'
			],
			'product' => '12 pink roses',
			'purchasePrice' => 38.95
		]
	]
	];

Yii::$app->connect->push($batch);

Exception handling

When pushing events, exceptions could be thrown, so you should either ignore or handle those exceptions gracefully.

Currently, the following exception could be thrown when pushing events:

  • InvalidEventException - the event being pushed is invalid (e.g. invalid event properties)

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-07-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固