jord-jd/php-bucket-testing
最新稳定版本:v3.0.0
Composer 安装命令:
composer require --dev jord-jd/php-bucket-testing
包简介
This library enables developers to easily redirect users to different URLs, for the purpose of bucket testing. Bucket testing is also known as A/B testing or split testing. This type of testing is used to test two or more versions of a webpage to determine which one performs better based on specfied
关键字:
README 文档
README
This library enables developers to easily redirect users to different URLs, for the purpose of bucket testing. Bucket testing is also known as A/B testing or split testing.
This type of testing is used to test two or more versions of a webpage to determine which one performs better based on specfied key metrics, such as clicks, downloads, purchases or any other form of conversion.
Features
- Random selection of buckets, with optional weights
- Automatic handling of temporary redirects
- Ability to retrieve bucket and manually handle URL redirection
- Easy to use fluent interface syntax
Installation
To install, just run the following composer command.
composer require jord-jd/php-bucket-testing
Remember to include the vendor/autoload.php file if your framework does not already do so.
Usage
use \JordJD\BucketTesting\BucketManager; use \JordJD\BucketTesting\Bucket; // Create a new bucket manager $bucketManager = new BucketManager; // Add buckets, with URLs and optional weights $bucketManager->add(new Bucket('https://google.co.uk/'))->withWeight(25); $bucketManager->add(new Bucket('https://php.net/'))->withWeight(75); // Redirect to a randomly selected URL $bucketManager->redirect(); // Or, if you wish, get a random bucket and manually handle the redirection $bucket = $bucketManager->getRandomBucket(); header('location: '.$bucket->url);
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0-only
- 更新时间: 2026-02-14