An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

OpensoftRolloutBundle
=====================

A Symfony3 Bundle for [opensoft/rollout](http://github.com/opensoft/rollout)

[![Build Status](https://travis-ci.org/opensoft/OpensoftRolloutBundle.svg?branch=master)](https://travis-ci.org/opensoft/OpensoftRolloutBundle) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/opensoft/OpensoftRolloutBundle/badges/quality-score.png?s=4980d55f8407070251ca97ba3b92f855cfce67ce)](https://scrutinizer-ci.com/g/opensoft/OpensoftRolloutBundle/) [![Code Coverage](https://scrutinizer-ci.com/g/opensoft/OpensoftRolloutBundle/badges/coverage.png?s=2a11bb9fe02adb950f1b446311c6044a70a2e1fd)](https://scrutinizer-ci.com/g/opensoft/OpensoftRolloutBundle/) [![Total Downloads](https://poser.pugx.org/opensoft/rollout-bundle/downloads.png)](https://packagist.org/packages/opensoft/rollout-bundle) [![Latest Stable Version](https://poser.pugx.org/opensoft/rollout-bundle/v/stable.png)](https://packagist.org/packages/opensoft/rollout-bundle)

### Obligatory Screenshot

![Screenshot](https://github.com/opensoft/OpensoftRolloutBundle/raw/master/Resources/doc/screenshot-extended.png)

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