PHPackages                             davispeixoto/featuretoggle - 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. davispeixoto/featuretoggle

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

davispeixoto/featuretoggle
==========================

A PHP Feature Toggle library

1.0.4(9y ago)118.1k↓40%2MITPHPPHP &gt;=5.4.0

Since Aug 17Pushed 9y ago1 watchersCompare

[ Source](https://github.com/davispeixoto/FeatureToggler)[ Packagist](https://packagist.org/packages/davispeixoto/featuretoggle)[ RSS](/packages/davispeixoto-featuretoggle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

PHP Feature Toggle
==================

[](#php-feature-toggle)

This package provides a simple feature toggle mechanism for PHP applications.

[![Latest Stable Version](https://camo.githubusercontent.com/90733fb1fea3f0caa6c55375a92f21fbf97cbf4c2b0dd84b5352a3ca7cdf6d5a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6461766973706569786f746f2f66656174757265746f67676c652e737667)](https://packagist.org/packages/davispeixoto/featuretoggle)[![Total Downloads](https://camo.githubusercontent.com/8bf9b23fa4f694913b61a819b5d7545e0ccdaa3161532b355b1b966c4742db53/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6461766973706569786f746f2f66656174757265746f67676c652e737667)](https://packagist.org/packages/davispeixoto/featuretoggle)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a687ad862714709323a50eebaec0122c7bac82cdc350a83bc52d91a9a72e9224/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6461766973706569786f746f2f46656174757265546f67676c65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/davispeixoto/FeatureToggler/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/7245ffe775490dde828bc235d06d4778f31bcd39df45b61b7833d7cb8d8d468b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6461766973706569786f746f2f46656174757265546f67676c65722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/davispeixoto/FeatureToggler/?branch=master)[![Build Status](https://camo.githubusercontent.com/d1700601982a1f619fb3400cb9f750dc58c8fda0a08d67e7c7c84017fbab5ec6/68747470733a2f2f7472617669732d63692e6f72672f6461766973706569786f746f2f46656174757265546f67676c65722e737667)](https://travis-ci.org/davispeixoto/FeatureToggler)[![SensioLabsInsight](https://camo.githubusercontent.com/086c3b1ba2e9fcaffcbb24515a354b9b68f7d2f5d9c43f99625bd300d00fb583/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f65646138616536372d643830352d343433362d383338612d6664663430633765373038382f6269672e706e67)](https://insight.sensiolabs.com/projects/eda8ae67-d805-4436-838a-fdf40c7e7088)

Installation
------------

[](#installation)

The package can be installed via [Composer](http://getcomposer.org) by requiring the `davispeixoto/featuretoggle` package in your project's `composer.json`.

```
{
    "require": {
        "davispeixoto/featuretoggle": "~1.0"
    }
}
```

And running a composer update from your terminal:

```
php composer.phar update
```

Configuration
-------------

[](#configuration)

Just put your features into the config file, with their respective state (true or false):

```
return [
    'my_feature' => true,
    'my_other_feature' => [
        'pt_br' => true,
        'en_us' => true,
        'es_es' => false
    ],
    ...
];
```

Usage
-----

[](#usage)

That's it! You're all set to go. Just use:

```
    Davispeixoto\FeatureToggler\FeatureToggler;
    ...

    $toggler = new FeatureToggler('path/to/my_config_file.php');

    if($toggler->isEnabled('my_feature')) {
        // do the feature here
    }

    ...
    // for multidimensional config array
    if($toggler->isEnabled('my_other_feature.en_us')) {
        // new code here
    } else {
        // old code here
    }
```

License
-------

[](#license)

This software is licensed under the [MIT license](http://opensource.org/licenses/MIT)

Versioning
----------

[](#versioning)

This project follows the [Semantic Versioning](http://semver.org/)

Thanks
------

[](#thanks)

An amazing "Thank you, guys!" for [Jetbrains](https://www.jetbrains.com/) folks, who kindly empower this project with a free open-source license for [PhpStorm](https://www.jetbrains.com/phpstorm/) which can bring a whole new level of joy for coding.

[![Jetbrains](https://camo.githubusercontent.com/e587725eb6fa1bcaa58f3a064c2d5ee1da5160886d694fff14c4ad3b5c3939ec/68747470733a2f2f7777772e6a6574627261696e732e636f6d2f636f6d70616e792f646f63732f6c6f676f5f6a6574627261696e732e706e67)](https://www.jetbrains.com/)

[![PhpStorm](https://camo.githubusercontent.com/e32c61f7eb5653957b4572800397cff97a37a4999054b7b48bb3610cb4c762ce/68747470733a2f2f64336e6d7435766c7a756e6f61312e636c6f756466726f6e742e6e65742f70687073746f726d2f66696c65732f323031352f31322f50687053746f726d5f343030783430305f547769747465725f6c6f676f5f77686974652e706e67)](https://www.jetbrains.com/phpstorm/)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 60% 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 ~90 days

Total

5

Last Release

3567d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/77ce0bed19c054d8812aedfbd93a6d3a9e40935a818917fa4c6c5427bb447d3b?d=identicon)[davispeixoto](/maintainers/davispeixoto)

---

Top Contributors

[![davispeixoto](https://avatars.githubusercontent.com/u/1113230?v=4)](https://github.com/davispeixoto "davispeixoto (3 commits)")[![trizotter](https://avatars.githubusercontent.com/u/18149628?v=4)](https://github.com/trizotter "trizotter (2 commits)")

---

Tags

feature togglefeature flagfeature switchfeature flipperconditional feature

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/davispeixoto-featuretoggle/health.svg)

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

###  Alternatives

[flagception/flagception-bundle

Feature toggle bundle on steroids.

283.8M](/packages/flagception-flagception-bundle)

PHPackages © 2026

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