{"id":39856327,"url":"https://github.com/dmt-software/ab-middleware","last_synced_at":"2026-01-20T17:57:42.956Z","repository":{"id":260086056,"uuid":"878641510","full_name":"dmt-software/ab-middleware","owner":"dmt-software","description":"PSR-15 ab testing middleware","archived":false,"fork":false,"pushed_at":"2025-10-15T12:08:39.000Z","size":49,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-26T00:47:11.051Z","etag":null,"topics":["ab-testing","psr-15"],"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/dmt-software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-25T19:12:37.000Z","updated_at":"2025-10-15T12:08:32.000Z","dependencies_parsed_at":"2024-12-13T17:26:51.017Z","dependency_job_id":"820ec9d5-782f-4899-9e01-5ef48b98db3b","html_url":"https://github.com/dmt-software/ab-middleware","commit_stats":null,"previous_names":["dmt-software/ab-middleware"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/dmt-software/ab-middleware","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmt-software%2Fab-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmt-software%2Fab-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmt-software%2Fab-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmt-software%2Fab-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmt-software","download_url":"https://codeload.github.com/dmt-software/ab-middleware/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmt-software%2Fab-middleware/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28537205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T13:04:05.990Z","status":"ssl_error","status_checked_at":"2026-01-18T13:01:44.092Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ab-testing","psr-15"],"created_at":"2026-01-18T13:51:39.267Z","updated_at":"2026-01-18T13:51:39.995Z","avatar_url":"https://github.com/dmt-software.png","language":"PHP","readme":"# PSR-15 ab testing middleware\n\nThis PSR-15 middleware allows you to do A/B testing on your application.\n\nCookies are used to keep track of a randomly generated user-id. Based on this cookie, a variant is selected for an experiment.\n\nThe Twig helper can be used to conditionally render the experiment template variants.\n\nAlthough more than one experiment can be defined, only one experiment is supposed to be active at a time.\n\n## Installation\n\n```bash\ncomposer require dmt-software/ab-middleware\n```\n\n## Usage\n\n```php\nuse DMT\\AbMiddleware\\AbService;\nuse DMT\\AbMiddleware\\AbPsrMiddleware;\n\n// define your experiments\n$experiments = [\n    'active-experiment' =\u003e [\n        'variant-1' =\u003e 0.3,\n        'variant-2' =\u003e 0.3,\n        'control' =\u003e 0.4,\n    ],\n    'old-experiment' =\u003e [\n        'variant-1' =\u003e 0.3,\n        'variant-2' =\u003e 0.3,\n        'control' =\u003e 0.4,\n    ],\n];\n\n// instantiate the service\n$service = new AbService($experiments);\n\n// instantiate the middleware\n$abMiddleware = new AbPsrMiddleware($service, 'ab-uid-cookie-name');\n\n// add the middleware to your middleware stack\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmt-software%2Fab-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmt-software%2Fab-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmt-software%2Fab-middleware/lists"}