{"id":20540571,"url":"https://github.com/utopia-php/ab","last_synced_at":"2025-04-14T08:38:43.539Z","repository":{"id":46654755,"uuid":"185554537","full_name":"utopia-php/ab","owner":"utopia-php","description":"Lite \u0026 fast micro PHP AB Tests library that is **easy to use**.","archived":false,"fork":false,"pushed_at":"2023-10-11T06:27:06.000Z","size":34,"stargazers_count":12,"open_issues_count":2,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-27T22:11:12.537Z","etag":null,"topics":["hacktoberfest","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/utopia-php.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"Contributing.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-05-08T07:26:37.000Z","updated_at":"2023-10-05T04:10:53.000Z","dependencies_parsed_at":"2023-10-11T08:23:03.794Z","dependency_job_id":null,"html_url":"https://github.com/utopia-php/ab","commit_stats":{"total_commits":28,"total_committers":5,"mean_commits":5.6,"dds":0.3214285714285714,"last_synced_commit":"c5a17195eb9d69bccfb440165ea222b2d85aa542"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utopia-php%2Fab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utopia-php%2Fab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utopia-php%2Fab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utopia-php%2Fab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/utopia-php","download_url":"https://codeload.github.com/utopia-php/ab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248564657,"owners_count":21125408,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","php"],"created_at":"2024-11-16T01:16:17.267Z","updated_at":"2025-04-14T08:38:43.517Z","avatar_url":"https://github.com/utopia-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Utopia AB Tests\n\n[![Build Status](https://travis-ci.org/utopia-php/ab.svg?branch=master)](https://travis-ci.com/utopia-php/ab)\n![Total Downloads](https://img.shields.io/packagist/dt/utopia-php/ab.svg)\n[![Discord](https://img.shields.io/discord/564160730845151244?label=discord)](https://appwrite.io/discord)\n\nUtopia 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](https://appwrite.io).\n\nAlthough this library is part of the [Utopia Framework](https://github.com/utopia-php/framework) project it is dependency free and can be used as standalone with any other PHP project or framework.\n\n## Getting Started\n\nInstall using composer:\n```bash\ncomposer require utopia-php/ab\n```\n\n```php\n\u003c?php\n\nrequire_once '../vendor/autoload.php';\n\nuse Utopia\\AB\\Test;\n\n$test = new Test('example');\n\n$test\n    -\u003evariation('title1', 'Hello World', 40) // 40% probability\n    -\u003evariation('title2', 'Foo Bar', 30) // 30% probability\n    -\u003evariation('title3', function () { // 30% probability\n        return 'Title from a callback function';\n    }, 30)\n;\n    \n$debug  = [];\n    \nfor($i=0; $i\u003c10000; $i++) {\n    $debug[$test-\u003erun()]++;\n}\n    \nvar_dump($debug);\n    \n```\n\nIf 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.\n\nWhen 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.\n\n## System Requirements\n\nUtopia Framework requires PHP 7.4 or later. We recommend using the latest PHP version whenever possible.\n\n## Copyright and license\n\nThe MIT License (MIT) [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futopia-php%2Fab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futopia-php%2Fab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futopia-php%2Fab/lists"}