dev-0.1.x-dev
dev-0.1.x-dev https://github.com/phpab/storage-aurasessionStore session using Aura libraries.
MIT
The Requires
- php ~5.5|~7.0
- aura/session 2.0.1
- phpab/phpab dev-master
The Development Requires
Store session using Aura libraries.
Session Storage Adapter for PhpAb library based in Aura library., (*1)
Via Composer, (*2)
``` bash $ composer require phpab/storage-aurasession, (*3)
## Usage ``` php use PhpAb\Storage\Adapter\AuraSession; use PhpAb\Storage\Storage; use PhpAb\Participation\Manager; use PhpAb\Analytics\DataCollector\Google; use PhpAb\Event\Dispatcher; use PhpAb\Participation\Filter\Percentage; use PhpAb\Variant\Chooser\RandomChooser; use PhpAb\Engine\Engine; use PhpAb\Test\Test; use PhpAb\Variant\SimpleVariant; use PhpAb\Analytics\Renderer\Google\GoogleUniversalAnalytics; // Create a Storage and its Adapter $adapter = new AuraSession(); $storage = new Storage($adapter); // Create a Participation Manager $manager = new Manager($storage); // Create a Data Collector $analyticsData = new Google(); // Create a Dispatcher $dispatcher = new Dispatcher(); // And append it as a subscriber $dispatcher->addSubscriber($analyticsData); // Create a Participation filter $filter = new Percentage(50); // And a Variant Chooser $chooser = new RandomChooser(); // Create the Engine $engine = new Engine($manager, $dispatcher, $filter, $chooser); // Create a tests and its variants $test = new Test('foo_test', [], [Google::EXPERIMENT_ID => 'exp1']); $test->addVariant(new SimpleVariant('_control')); $test->addVariant(new SimpleVariant('_variant1')); $test->addVariant(new SimpleVariant('_variant2')); // Create a second test and its variants $test2 = new Test('bar_test', [], [Google::EXPERIMENT_ID => 'exp2']); $test2->addVariant(new SimpleVariant('_control')); $test2->addVariant(new SimpleVariant('_variant1')); $test2->addVariant(new SimpleVariant('_variant2')); // Add the tests to the Engine $engine->addTest($test); $engine->addTest($test2); $engine->start(); // Create the Analytics object and pass the Data Collector data to it $analytics = new GoogleUniversalAnalytics($analyticsData->getTestsData()); // Execute the Analytics functionality var_dump($analytics->getScript());
bash
$ composer test
, (*4)
Please see CONTRIBUTING and CONDUCT for details., (*5)
If you discover any security related issues, please email phpab.phpab@gmail.com instead of using the issue tracker., (*6)
The MIT License (MIT). Please see License File for more information., (*7)
Store session using Aura libraries.
MIT