Download the PHP package abrouter/abrouter-php-client without Composer
On this page you can find all versions of the php package abrouter/abrouter-php-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download abrouter/abrouter-php-client
More information about abrouter/abrouter-php-client
Files in abrouter/abrouter-php-client
Package abrouter-php-client
Short Description AbrPHPClient :construction_worker_woman: is a PHP library to run ab-tests via ABRouter.
License LGPL-3.0-or-later
Informations about the package abrouter-php-client
PHP A/B Tests - ABRouter-php-client
AbrPHPClient :construction_worker_woman: is a PHP library to run ab-tests via ABRouter. Please, check out ABRouter main repository: https://github.com/abrouter/abrouter
You're welcome to visit the docs.
What is the ABRouter service ?
ABRouter is the service to manage experiments(ab-tests). The service provides easy to manage dashboard to get experiments under control. There you can create experiments, branches and set a percentage for every branch. Then, when you're running an ab-test on PHP you will receive a perfect branch-wise response that following the rules, that you set up.
Can be also used as a feature flag or feature toggle and open-source. Available for free.
:package: Install
Via composer
:rocket: Usage
Client is uses PHP-DI for DI. If you're uses own DI, you must to configure it in a such way as on example below. If you're not uses any DI, let's move php-di from dev-dependency to dependency:
Using with PHP-DI
You can create an experiment and get your token and id of experiment on ABRouter or just read the docs.
Sending the stats
For additional details of sending events please see StatEventBuilder class.
Parallel running
Parallel running is a mode which allows you to run the experiments asynchronous. Main things to make it works are configuring KvStorage and TaskManager. KvStorage and TaskManager are using Redis to store data and tasks.
ABRouter php client has built-in KvStorage and TaskManager, but you can make your own implementation and replace it via DI and contracts. We're highly recommend you to use built-in solution. The implementation is completely tested and works well. Using Parallel running gives you a great growth in speed.
The config for parallel running is a bit different from the default config.
Configuration
Worker
Worker is a supervisor config which running the process which handles your tasks. Make sure supervisor is installed on your machine. The example of supervisor config is located in worker/worker.conf. Please, configure the worker.php before running the supervisor config. You have to put the same configuration of the client there as in your main application. Copy supervisor config to the specific folder which specified in etc/init.d/supervisord.conf. And, please don't forget to adjust the path of worker.php aligned to your application base directory.
:white_check_mark: Testing
Requires docker-compose and docker installed.
:wrench: Contributing
Please feel free to fork and sending Pull Requests. This project follows Semantic Versioning 2 and PSR-2.
:page_facing_up: License
GPL3. Please see License File for more information.
All versions of abrouter-php-client with dependencies
guzzlehttp/guzzle Version ^6.5 || ^7.0
ext-json Version *
art4/json-api-client Version ^1.0
predis/predis Version ^1.0 || ^2.0
abrouter/related-users Version 0.0.5