承接 breinify/brein-engine-api 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

breinify/brein-engine-api

Composer 安装命令:

composer require breinify/brein-engine-api

包简介

A PHP library to exchange data through the API of the Brein Engine.

README 文档

README

Breinify API PHP Library

Breinify's DigitalDNA API puts dynamic behavior-based, people-driven data right at your fingertips.

Step By Step Introduction

What is Breinify's DigitialDNA

Breinify's DigitalDNA API puts dynamic behavior-based, people-driven data right at your fingertips. We believe that in many situations, a critical component of a great user experience is personalization. With all the data available on the web it should be easy to provide a unique experience to every visitor, and yet, sometimes you may find yourself wondering why it is so difficult.

Thanks to Breinify's DigitalDNA you are now able to adapt your online presence to your visitors needs and provide a unique experience. Let's walk step-by-step through a simple example.

Quick start

Step1: Configure the library

In order to use the library you need a valid API-key, which you can get for free at https://www.breinify.com. In this example, we assume you have the following api-key:

772A-47D7-93A3-4EA9-9D73-85B9-479B-16C6

// configure the library
$apiKey = "772A-47D7-93A3-4EA9-9D73-85B9-479B-16C6";
$breinify = new \Breinify\API\Breinify($apiKey);

The Breinify object is now configured with a valid configuration.

Step 2: Start using the library

Placing activity triggers

The engine powering the DigitalDNA API provides two endpoints. The first endpoint is used to inform the engine about the activities performed by visitors of your site. The activities are used to understand the user's current interest and infer the intent. It becomes more and more accurate across different users and verticals as more activities are collected. It should be noted, that any personal information is not stored within the engine, thus each individual's privacy is well protected. The engine understands several different activities performed by a user, e.g., landing, login, search, item selection, or logout.

// create a user 
$user = new \Breinify\API\BreinUser();
$user.setFirstName("Diane");
$user.setLastName("Keng");
$user.setEmail("diane.keng@breinify.com");

// create an activity
$activity = new \Breinify\API\BreinActivity();
$activity.setUser($user);
$activity->addActivity("login");

// send a request
$breinify->sendActivity($activity);

That's it!

Placing temporalData triggers

Temporal Intelligence API provides temporal triggers and visualizes patterns enabling you to predict a visitor’s dynamic activities. Currently this will cover:

  • Current Weather
  • Upcoming Holidays
  • Time Zone
  • Regional Events

They can be requested like this:

// create a user 
$user = new \Breinify\API\BreinUser();
$user.setEmail("diane.keng@breinify.com");
$user->setLocalDateTime("Sun Dec 25 2016 18:15:48 GMT-0800 (PST)");
$user->setTimezone("America/Los_Angeles");

// create temporalData object and invoke the request
$temporalData = new \Breinify\API\BreinTemporalData();
$result = $breinify->temporalData($temporalData);

A more detailed introduction

Requirements

This library is used to integrate the Brein Engine (more specific, the API's end-points: activity and lookup) into a given PHP based web-platform. The library requires PHP 5 or higher.

Communicating with the Brein Engine

The communication with the Brein Engine can be performed from back-end side, i.e.,:

In addition, the communication can also be performed through injected JavaScript on client-side.

In the former case, it is necessary that the PHP back-end infrastructure allows the communication with the Brein Engine (i.e., outgoing POST-traffic should not be blocked). In the latter case, the communication with the Brein Engine might be blocked by the client. Thus, we recommend the usage of a back-end to back-end communication based on file-streams or cURL.

Troubleshooting

Using back-end calls utilizing file-streams

If the communication between the back-end and the Brein Engine is performed with file-streams the back-end must fulfill the following requirements:

Using back-end calls utilizing cURL

If the communication between the back-end and the Brein Engine is performed using cURL the back-end must fulfill the following requirements:

  • POST calls to the Brein Engine must not be blocked by the firewall (i.e., outgoing traffic should be possible), and
  • the cURL module must be available, i.e., the functions curl_init, curl_setopt, curl_exec, curl_getinfo, and curl_close must be available.

IDE Configuration

Further information regarding the configuration of the IDE can be found here.

breinify/brein-engine-api 适用场景与选型建议

breinify/brein-engine-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18 次下载、GitHub Stars 达 0, 最近一次更新时间为 2016 年 02 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「breinify」 「brein engine」 「collective intelligence」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 breinify/brein-engine-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 breinify/brein-engine-api 我们能提供哪些服务?
定制开发 / 二次开发

基于 breinify/brein-engine-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-09