https://github.com/opensoft/opensoftrolloutbundle
A Symfony2 Bundle for opensoft/rollout
https://github.com/opensoft/opensoftrolloutbundle
Last synced: 8 months ago
JSON representation
A Symfony2 Bundle for opensoft/rollout
- Host: GitHub
- URL: https://github.com/opensoft/opensoftrolloutbundle
- Owner: opensoft
- License: mit
- Created: 2014-04-04T02:00:03.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2023-03-24T15:47:24.000Z (over 3 years ago)
- Last Synced: 2025-08-12T21:43:50.915Z (11 months ago)
- Language: PHP
- Homepage:
- Size: 340 KB
- Stars: 42
- Watchers: 3
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
OpensoftRolloutBundle
=====================
A Symfony3 Bundle for [opensoft/rollout](http://github.com/opensoft/rollout)
[](https://travis-ci.org/opensoft/OpensoftRolloutBundle) [](https://scrutinizer-ci.com/g/opensoft/OpensoftRolloutBundle/) [](https://scrutinizer-ci.com/g/opensoft/OpensoftRolloutBundle/) [](https://packagist.org/packages/opensoft/rollout-bundle) [](https://packagist.org/packages/opensoft/rollout-bundle)
### Obligatory Screenshot

Installation
------------
### 1) Install via composer
Add the bundle via composer
composer require opensoft/rollout-bundle
And activate it inside your `app\AppKernel.php`
```php
new Opensoft\RolloutBundle\OpensoftRolloutBundle(),
```
### 2) Configuration
Add the following to your configuration (supports auto-wiring)
```yaml
opensoft_rollout:
user_provider_service: [YOUR USER PROVIDER SERVICE]
storage_service: [YOUR STORAGE SERVICE FOR ROLLOUT]
```
* `user_provider_service`: Add the service id (generally the FQDN with auto-wiring) of the UserProvider to which you added the Rollout `UserProviderInterface`
* `storage_service`: Defaults to `Opensoft\Rollout\Storage\ArrayStorage`, but you can also use the included `Opensoft\RolloutBundle\Storage\Doctrine\DoctrineORMStorage` or create your own (see below for implementation)
### 3) Implement Interfaces
#### RolloutUserInterface
Any rollout user _must_ implement the `RolloutUserInterface`. Often, this will be your main user object in the application.
```php
email;
}
}
```
#### UserProviderInterface
Expose individual users to the rollout interface by implementing the `UserProviderInterface`
```php
findOneBy(array('email' => $id));
}
}
```
#### GroupDefinitionInterface
Provide different groups of users to your rollout.
Tag all of your group definitions with the DIC tag `rollout.group` to expose them to the rollout interface
```php
getEmail(), 'acme.com') !== false;
};
}
}
```
#### StorageInterface
Implement a custom storage solution.
**Note:** The rollout `StorageInterface` [changed](https://github.com/opensoft/rollout/releases/tag/2.0.0) in version `2.0.0`.
```php
get('rollout')->isActive('chat', $this->getUser())) {
// do some chat related feature work
}
```
Twig example:
```
{% if rollout_is_active('chat', app.user) %}
{% endif %}
```
## Further Reading
* https://github.com/FetLife/rollout
* http://blog.travis-ci.com/2014-03-04-use-feature-flags-to-ship-changes-with-confidence/
* http://code.flickr.net/2009/12/02/flipping-out/
* http://en.wikipedia.org/wiki/Feature_toggle