定制 dmt-software/ab-middleware 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

dmt-software/ab-middleware

最新稳定版本:0.0.9

Composer 安装命令:

composer require dmt-software/ab-middleware

包简介

ab testing middleware compatible with psr

README 文档

README

This PSR-15 middleware allows you to do A/B testing on your application.

Cookies are used to keep track of a randomly generated user-id. Based on this cookie, a variant is selected for an experiment.

The Twig helper can be used to conditionally render the experiment template variants.

Although more than one experiment can be defined, only one experiment is supposed to be active at a time.

Installation

composer require dmt-software/ab-middleware

Usage

use DMT\AbMiddleware\AbService; use DMT\AbMiddleware\AbPsrMiddleware; // define your experiments $experiments = [ 'active-experiment' => [ 'variant-1' => 0.3, 'variant-2' => 0.3, 'control' => 0.4, ], 'old-experiment' => [ 'variant-1' => 0.3, 'variant-2' => 0.3, 'control' => 0.4, ], ]; // instantiate the service $service = new AbService($experiments); // instantiate the middleware $abMiddleware = new AbPsrMiddleware($service, 'ab-uid-cookie-name'); // add the middleware to your middleware stack

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固