PHPackages                             opensoft/rollout - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. opensoft/rollout

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

opensoft/rollout
================

Feature switches or flags for PHP

2.3.0(7y ago)2571.9M↓26%32[5 issues](https://github.com/opensoft/rollout/issues)[3 PRs](https://github.com/opensoft/rollout/pulls)5MITPHPPHP &gt;=5.3.3

Since Apr 4Pushed 3y ago7 watchersCompare

[ Source](https://github.com/opensoft/rollout)[ Packagist](https://packagist.org/packages/opensoft/rollout)[ RSS](/packages/opensoft-rollout/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (2)Versions (13)Used By (5)

rollout (for php)
=================

[](#rollout-for-php)

[![Build Status](https://camo.githubusercontent.com/a852e76825e5b4249e00d3cfecb49de7f29c5f3052d83a13655d9a2eae35e03b/68747470733a2f2f7472617669732d63692e6f72672f6f70656e736f66742f726f6c6c6f75742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/opensoft/rollout) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/6021367f55809f57c366089d8caace0f0eea27dcec19636c6a5014cb6f1699f7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6f70656e736f66742f726f6c6c6f75742f6261646765732f7175616c6974792d73636f72652e706e673f733d61373565646263383132653062323732373934393665386632663237346636613463353864643961)](https://scrutinizer-ci.com/g/opensoft/rollout/) [![Code Coverage](https://camo.githubusercontent.com/f6f4d9063e0b9ab3f4edba709b5ed65c4d937d1895d8e2484752310e55bb4517/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6f70656e736f66742f726f6c6c6f75742f6261646765732f636f7665726167652e706e673f733d66326537393339656538396238373838646638336263633535366165666564636630336362366534)](https://scrutinizer-ci.com/g/opensoft/rollout/)

Feature flippers for PHP. A port of ruby's [rollout](https://github.com/FetLife/rollout).

Install It
----------

[](#install-it)

```
composer require opensoft/rollout

```

How it works
------------

[](#how-it-works)

Initialize a rollout object:

```
use Opensoft\Rollout\Rollout;
use Opensoft\Rollout\Storage\ArrayStorage;

$rollout = new Rollout(new ArrayStorage());
```

Check if a feature is active for a particular user:

```
$rollout->isActive('chat', $user);  // returns true/false
```

Check if a feature is activated globally:

```
$rollout->isActive('chat'); // returns true/false
```

Storage
-------

[](#storage)

There are a number of different storage implementations for where the configuration for the rollout is stored.

- ArrayStorage - default storage, not persistent
- DoctrineCacheStorageAdapter - requires [doctrine/cache](https://packagist.org/packages/doctrine/cache)
- PDOStorageAdapter - persistent using [PDO](http://php.net/pdo)
- RedisStorageAdapter - persistent using [Redis](http://redis.io)
- MongoDBStorageAdapter - persistent using [Mongo](http://mongodb.org)

All storage adapters must implement `Opensoft\Rollout\Storage\StorageInterface`.

Groups
------

[](#groups)

Rollout ships with one group by default: `all`, which does exactly what it sounds like.

You can activate the `all` group for chat features like this:

```
$rollout->activateGroup('chat', 'all');
```

You may also want to define your own groups. We have one for caretakers:

```
$rollout->defineGroup('caretakers', function(RolloutUserInterface $user = null) {
  if (null === $user) {
    return false;
  }

  return $user->isCaretaker(); // boolean
});
```

You can activate multiple groups per feature.

Deactivate groups like this:

```
$rollout->deactivateGroup('chat');
```

Specific Users
--------------

[](#specific-users)

You may want to let a specific user into a beta test or something. If that user isn't part of an existing group, you can let them in specifically:

```
$rollout->activateUser('chat', $user);
```

Deactivate them like this:

```
$rollout->deactivateUser('chat', $user);
```

Rollout users must implement the `RolloutUserInterface`.

User Percentages
----------------

[](#user-percentages)

If you're rolling out a new feature, you may want to test the waters by slowly enabling it for a percentage of your users.

```
$rollout->activatePercentage('chat', 20);
```

The algorithm for determining which users get let in is this:

```
crc32($user->getRolloutIdentifier()) % 100 < $percentage
```

So, for 20%, users 0, 1, 10, 11, 20, 21, etc would be allowed in. Those users would remain in as the percentage increases.

Deactivate all percentages like this:

```
$rollout->deactivatePercentage('chat');
```

**Note:** Activating a feature for 100% of users will also make it activate `globally`. This is like calling `$rollout->isActive()` without a user object.

Feature is Broken
-----------------

[](#feature-is-broken)

Deactivate everybody at once:

```
$rollout->deactivate('chat');
```

You may wish to disable features programmatically if monitoring tools detect unusually high error rates for example.

Remove a Feature (added in 2.0.0)
---------------------------------

[](#remove-a-feature-added-in-200)

After a feature becomes mainstream or a failed experiment, you may want to remove the feature definition from rollout.

```
$rollout->remove('chat');
```

Note: If there is still code referencing the feature, it will be recreated with default settings.

Symfony2 Bundle
---------------

[](#symfony2-bundle)

A Symfony2 bundle is available to integrate rollout into Symfony2 projects. It can be found at .

Zend Framework 2 Module
-----------------------

[](#zend-framework-2-module)

A Zend Framework 2 module is availabile to intergrate rollout into Zend Framwork 2 projects. It can be found at .

Implementations in other languages
----------------------------------

[](#implementations-in-other-languages)

- Ruby:
- Python:

Copyright
---------

[](#copyright)

Copyright © 2017 James Golick, BitLove, Inc. See LICENSE for details.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity59

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 56.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~155 days

Recently: every ~201 days

Total

12

Last Release

2742d ago

Major Versions

1.0.4 → 2.0.02015-11-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/a39488bf3a486007486e38ab85aef162e86b29be6bc48ed69d68e5186b9a7fad?d=identicon)[richardfullmer](/maintainers/richardfullmer)

---

Top Contributors

[![richardfullmer](https://avatars.githubusercontent.com/u/384602?v=4)](https://github.com/richardfullmer "richardfullmer (29 commits)")[![shadowhand](https://avatars.githubusercontent.com/u/38203?v=4)](https://github.com/shadowhand "shadowhand (3 commits)")[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (3 commits)")[![filipgolonka](https://avatars.githubusercontent.com/u/2419247?v=4)](https://github.com/filipgolonka "filipgolonka (2 commits)")[![timwattenberg](https://avatars.githubusercontent.com/u/120251?v=4)](https://github.com/timwattenberg "timwattenberg (2 commits)")[![snags88](https://avatars.githubusercontent.com/u/9381931?v=4)](https://github.com/snags88 "snags88 (2 commits)")[![tonivdv](https://avatars.githubusercontent.com/u/1267658?v=4)](https://github.com/tonivdv "tonivdv (2 commits)")[![4rthem](https://avatars.githubusercontent.com/u/2180032?v=4)](https://github.com/4rthem "4rthem (1 commits)")[![Zorato](https://avatars.githubusercontent.com/u/2941327?v=4)](https://github.com/Zorato "Zorato (1 commits)")[![baldurrensch](https://avatars.githubusercontent.com/u/871417?v=4)](https://github.com/baldurrensch "baldurrensch (1 commits)")[![mattclements](https://avatars.githubusercontent.com/u/804802?v=4)](https://github.com/mattclements "mattclements (1 commits)")[![Oxicode](https://avatars.githubusercontent.com/u/1320709?v=4)](https://github.com/Oxicode "Oxicode (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")[![securingsincity](https://avatars.githubusercontent.com/u/1388049?v=4)](https://github.com/securingsincity "securingsincity (1 commits)")[![trivoallan](https://avatars.githubusercontent.com/u/23811?v=4)](https://github.com/trivoallan "trivoallan (1 commits)")

---

Tags

featureflagtoggleflipperrolloutswitches

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/opensoft-rollout/health.svg)

```
[![Health](https://phpackages.com/badges/opensoft-rollout/health.svg)](https://phpackages.com/packages/opensoft-rollout)
```

###  Alternatives

[zumba/swivel

Strategy driven feature toggles

208138.1k5](/packages/zumba-swivel)[qandidate/toggle

Feature toggling for your PHP application.

3812.0M9](/packages/qandidate-toggle)[flagception/flagception-bundle

Feature toggle bundle on steroids.

324.0M](/packages/flagception-flagception-bundle)[ajgarlag/feature-flag-bundle

Provides a feature flag mechanism

1419.9k](/packages/ajgarlag-feature-flag-bundle)[francescomalatesta/laravel-feature

A simple package to manage feature flagging in a Laravel project.

212206.7k](/packages/francescomalatesta-laravel-feature)[novaway/feature-flag-bundle

Very KISS bundle to manage features flag

24287.1k](/packages/novaway-feature-flag-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
