utopia-php/ab
最新稳定版本:0.1.2
Composer 安装命令:
composer require utopia-php/ab
包简介
A simple AB Test library to manage server side AB testing
README 文档
README
Utopia AB Tests library is simple and lite library for managing AB tests on the server side. This library is aiming to be as simple and easy to learn and use. This library is maintained by the Appwrite team.
Although this library is part of the Utopia Framework project it is dependency free and can be used as standalone with any other PHP project or framework.
Getting Started
Install using composer:
composer require utopia-php/ab
<?php require_once '../vendor/autoload.php'; use Utopia\AB\Test; $test = new Test('example'); $test ->variation('title1', 'Hello World', 40) // 40% probability ->variation('title2', 'Foo Bar', 30) // 30% probability ->variation('title3', function () { // 30% probability return 'Title from a callback function'; }, 30) ; $debug = []; for($i=0; $i<10000; $i++) { $debug[$test->run()]++; } var_dump($debug);
If no probability value is passed to the variation, all variations with no probability values will be given equal values from the remaining 100% of the test variations.
When passing a closure as value for your variation the callback will be executed only once the test is being run using the Test::run() method.
System Requirements
Utopia Framework requires PHP 7.4 or later. We recommend using the latest PHP version whenever possible.
Copyright and license
The MIT License (MIT) http://www.opensource.org/licenses/mit-license.php
统计信息
- 总下载量: 4.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-05-08