dimgraycat/split-testing 问题修复 & 功能扩展

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

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

dimgraycat/split-testing

最新稳定版本:1.0.5

Composer 安装命令:

composer require --dev dimgraycat/split-testing

包简介

A server-side A/B/n testing tool

README 文档

README

License Latest Stable Version Minimum PHP Version Travis

SplitTesting

A server-side A/B/n testing tool

This library provides a layer to run AB tests on your applications. The "SplitTesting" is useful when you want to change something on the application, but you want to check the optimize by using various variations.

Installation

$ composer require dimgraycat/split-testing
{
    "require": {
        "dimgraycat/split-testing": "^1.0"
    }
}

And install dependencies:

$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install

Usage

Random

<?php
use Ab\SplitTesting;

$params = array(
    'use' => 'random',
    'variation' => array(
        'foo',
        'bar',
        'baz'
    );
);

$result = SplitTesting::get($params);

// $seed is optional
// e.g.) userId, IpAddress
$seed = 1234;
echo SplitTesting::get($params, $seed);

Rate (Roulette)

<?php
use Ab\SplitTesting;

$params = array(
    'use'       => 'rate',
    'variation' => array(
        'rate'  => array(
            // 1 => 0.1%, 50 => 5%, 500 => 50%, 1000 => 100%
            'foo' => 50,
            'bar' => 20,
            'baz' => 500,
        ),
        'list'  => array(
            'default'   => array('hoge'),
            'a'         => '5%',
            'hoge'      => 1234567890,
            'moge'      => '123456789',
        ),
    ),
);
echo SplitTesting::get($params);

PatternMatch

<?php
use Ab\SplitTesting;

$params = array(
    'use'       => 'pattern',
    'variation' => array(
        'pattern'   => array(
            'foo' => '/[0-9]$/',
            'bar' => '/z$/',
        ),
        'list'      => array(
            'default'    => 'default',
            'foo'       => 'hit 1!',
            'bar'       => 'hit 2!'
        ),
    ),
);

$seed = 1234; // required
echo SplitTesting::get($params, $seed); // hit 1!

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-14