@@ -3,4 +3,60 @@ Zend Framework 2 Module - Rollout
33
44[ ![ Build Status] ( https://travis-ci.org/adlogix/zf2-opensoft-rollout.svg?branch=master )] ( https://travis-ci.org/adlogix/zf2-opensoft-rollout ) [ ![ Scrutinizer Code Quality] ( https://scrutinizer-ci.com/g/adlogix/zf2-opensoft-rollout/badges/quality-score.png?b=master )] ( https://scrutinizer-ci.com/g/adlogix/zf2-opensoft-rollout/?branch=master ) [ ![ Total Downloads] ( https://poser.pugx.org/adlogix/zf2-opensoft-rollout/downloads )] ( https://packagist.org/packages/adlogix/zf2-opensoft-rollout ) [ ![ License] ( https://poser.pugx.org/adlogix/zf2-opensoft-rollout/license )] ( https://packagist.org/packages/adlogix/zf2-opensoft-rollout ) [ ![ composer.lock] ( https://poser.pugx.org/adlogix/zf2-opensoft-rollout/composerlock )] ( https://packagist.org/packages/adlogix/zf2-opensoft-rollout ) [ ![ Latest Stable Version] ( https://poser.pugx.org/adlogix/zf2-opensoft-rollout/v/stable )] ( https://packagist.org/packages/adlogix/zf2-opensoft-rollout )
55
6- A ZF2 Module for [ opensoft/rollout] ( https://github.com/opensoft/rollout )
6+ A ZF2 Module for [ opensoft/rollout] ( https://github.com/opensoft/rollout )
7+
8+ # Installation
9+
10+ 1 . Install the module via composer by running:
11+
12+ ``` bash
13+ composer require adlogix/zf2-opensoft-rollout ~ 1.0
14+ ```
15+
16+ 2 . Add the ` Adlogix\Zf2Rollout ` module to the module section of your ` config/application.config.php `
17+
18+ # Configuration
19+
20+ Rollout parameters can be defined in the application configurations:
21+
22+ ``` php
23+ <?php
24+ return [
25+ 'rollout' => [
26+
27+ // Service id to obtain a Opensoft\Rollout\RolloutUserInterface instance
28+ 'user_service' => null,
29+
30+ // Service id to obtain a Opensoft\Rollout\Storage\StorageInterface instance
31+ 'storage_service' => 'zf2_rollout_storage_array',
32+
33+ // Required configuration if storage service is Adlogix\Zf2Rollout\Storage\ZendDbAdapterStorage
34+ 'zend_db_storage' => [
35+ 'table_name' => 'rollout_feature'
36+ ],
37+
38+ // Required configuration if storage service is Adlogix\Zf2Rollout\Storage\Doctrine\DoctrineORMStorage
39+ 'doctrine_storage' => [
40+ 'class_name' => SomeFeatureEntity::class
41+ ]
42+ ],
43+ ]
44+ ```
45+
46+ # Usage
47+
48+ To retrieve the rollout service from a zend controller:
49+
50+ ```
51+ <?php
52+
53+ $rollout = $this->getServiceLocator()->get('zf2_rollout');
54+ ```
55+
56+ Refer to the documentation of [ opensoft/rollout] ( https://github.com/opensoft/rollout ) for more information on how to use the library.
57+
58+ ## Zend Developer Toolbar
59+
60+ The module comes with support for the zend developer toolbar. Currently the toolbar only shows the list of features and enable status for a given user.
61+
62+ ![ zf2-adlogix-rollout zend developer tools] ( docs/rollout-zdt.png )
0 commit comments