PHPackages                             lwiesel/feature-checker - 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. lwiesel/feature-checker

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

lwiesel/feature-checker
=======================

Enable and disable functional features in php application.

v1.1.2(11y ago)53741MITPHPPHP &gt;=5.3.0

Since Feb 23Pushed 11y ago1 watchersCompare

[ Source](https://github.com/lwiesel/FeatureChecker)[ Packagist](https://packagist.org/packages/lwiesel/feature-checker)[ Docs](https://github.com/lwiesel/FeatureChecker)[ RSS](/packages/lwiesel-feature-checker/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (3)Versions (8)Used By (1)

FeatureChecker
==============

[](#featurechecker)

[![Packagist](https://camo.githubusercontent.com/bf12df6f5cf4947ff472fcbd7cc5b2aae5d335f78582e61fe819bd565004e7ea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c77696573656c2f666561747572652d636865636b65722e737667)](https://packagist.org/packages/lwiesel/feature-checker)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/6ef4ee5f1c1b5c983de530fd7ea73425b03fe3e21c52030592b32c3bacb53e5b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c77696573656c2f46656174757265436865636b65722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/lwiesel/FeatureChecker)[![Coverage Status](https://camo.githubusercontent.com/42f31b00dbd3bba49d6f4b6bd29b4398b42c36f803285071723192bdc297a86e/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6c77696573656c2f46656174757265436865636b65722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/lwiesel/FeatureChecker/code-structure)[![Quality Score](https://camo.githubusercontent.com/857afaba9d454d817d75172c0ef31c0cfcda2323a439615e4169d6ef37ef649b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c77696573656c2f46656174757265436865636b65722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/lwiesel/FeatureChecker)[![HHVM](https://camo.githubusercontent.com/40c791f067665c823610789ec9a8145ef2b2fa99c34a4b5253be0455ed76184a/68747470733a2f2f696d672e736869656c64732e696f2f6868766d2f6c77696573656c2f666561747572652d636865636b65722e737667)](http://hhvm.h4cc.de/package/lwiesel/feature-checker)[![Total Downloads](https://camo.githubusercontent.com/a076ccb510ac63abc3a87140785dcad229de2570ed5e507c186d79bad069f564/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c77696573656c2f666561747572652d636865636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lwiesel/feature-checker)

[![SensioLabsInsight](https://camo.githubusercontent.com/4a31b55bf4822a542be21f0caa8b9d2b6464339f35c4d6b69d6663bfdce482ba/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f63646665323262632d313838392d343361322d613431362d3361303665326636663264332f6269672e706e67)](https://insight.sensiolabs.com/projects/cdfe22bc-1889-43a2-a416-3a06e2f6f2d3)

Define features, and check if they are activated or not in your php application. Integrates well with Symfony2 bundle [lwiesel/FeatureCheckerBundle](https://github.com/lwiesel/FeatureCheckerBundle).

Install
-------

[](#install)

Via Composer

```
$ composer require lwiesel/feature-checker
```

Usage
-----

[](#usage)

```
$features = array(
    'feature-A' => true,
    'feature-B' => false,
    'feature-set-C' => array(
        'feature-C1' => true,
        'feature-C2' => true,
    ),
    'feature-set-D' => array(
        'feature-D1' => true,
        'feature-set-D2' => array(
            'feature-D2-a' => true,
            'feature-D2-b' => false,
        ),
    ),
);
$checker = new LWI\FeatureChecker($features);

// ...

if ($checker->isFeatureEnabled('feature-A')) {
    // Do something here
}
```

Sub-features can be checked with this notation:

```
$checker->isFeatureEnabled('feature-set-C.feature-C1');// returns true
```

You can also test whole feature sets. A feature set is considered enabled when all sub-features -at any sub-level- is enabled.

```
$checker->isFeatureEnabled('feature-set-C');// returns true
$checker->isFeatureEnabled('feature-set-D');// returns false
```

Testing
-------

[](#testing)

```
$ bin/phpspec run
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email [wiesel.laurent@gmail.com](wiesel.laurent@gmail.com) instead of using the issue tracker.

Credits
-------

[](#credits)

- [Laurent Wiesel](https://github.com/lwiesel)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

7

Last Release

4099d ago

PHP version history (2 changes)v1.0.0-alpha.1PHP &gt;=5.4.0

v1.0.0-alpha.2PHP &gt;=5.3.0

### Community

Maintainers

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

---

Top Contributors

[![lwiesel](https://avatars.githubusercontent.com/u/2276221?v=4)](https://github.com/lwiesel "lwiesel (25 commits)")

---

Tags

feature-checkerFeatureChecker

### Embed Badge

![Health badge](/badges/lwiesel-feature-checker/health.svg)

```
[![Health](https://phpackages.com/badges/lwiesel-feature-checker/health.svg)](https://phpackages.com/packages/lwiesel-feature-checker)
```

PHPackages © 2026

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