PHPackages                             flagception/database-activator - 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. [Database &amp; ORM](/categories/database)
4. /
5. flagception/database-activator

ActiveLib[Database &amp; ORM](/categories/database)

flagception/database-activator
==============================

Activator for manage feature toggles via database

2.0.0(1y ago)2450.9k↓25%12MITPHPPHP ^7.4 || ^8.0

Since Jul 11Pushed 1y agoCompare

[ Source](https://github.com/playox/flagception-database-activator)[ Packagist](https://packagist.org/packages/flagception/database-activator)[ RSS](/packages/flagception-database-activator/feed)WikiDiscussions master Synced 1mo ago

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

Database activator for flagception
==================================

[](#database-activator-for-flagception)

Manage feature flags for [Flagception](https://packagist.org/packages/flagception/flagception) with a sql database (mysql, postgres, sqlite, ...)!

Download the library
--------------------

[](#download-the-library)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this library:

```
$ composer require flagception/database-activator
```

Usage
-----

[](#usage)

Just create a new `DatabaseActivator` instance and commit it to your feature manager:

```
// YourClass.php

class YourClass
{
    public function run()
    {
        $activator = new DatabaseActivator('pdo-mysql://user:secret@localhost/mydb');

        $manager = new FeatureManager($activator);
        if ($manager->isActive('your_feature_name')) {
            // do something
        }
    }
}

```

#### Connection

[](#connection)

This activator use [dbal](https://packagist.org/packages/doctrine/dbal) under the hood. We redirect the first argument directly to dbal - so you can use all known connection options (see [documentation](https://www.doctrine-project.org/projects/doctrine-dbal/en/2.7/reference/configuration.html)):

###### User and password

[](#user-and-password)

```
// YourClass.php

class YourClass
{
    public function run()
    {
        $activator = new DatabaseActivator([
            'dbname' => 'mydb',
            'user' => 'user',
            'password' => 'secret',
            'host' => 'localhost',
            'driver' => 'pdo_mysql'
        ]);

        // ...
    }
}

```

###### Connection string

[](#connection-string)

```
// YourClass.php

class YourClass
{
    public function run()
    {
        $activator = new DatabaseActivator('pdo-mysql://user:secret@localhost/mydb');

        // ...
    }
}

```

###### DBAL instance

[](#dbal-instance)

```
// YourClass.php

class YourClass
{
    public function run()
    {
        $activator = new DatabaseActivator($this->myDbalInstance);

        // ...
    }
}

```

#### Table

[](#table)

The activator will create the sql table if it does not already exist. The default table name is `flagception_features` which contains a `feature` and a `state` column. You can change the table and columns names by the second argument. It expects an array with values for `db_table`, `db_column_feature` and `db_column_state`. Setting one of the fields in optional.

Example:

```
// YourClass.php

class YourClass
{
    public function run()
    {
        $activator = new DatabaseActivator('pdo-mysql://user:secret@localhost/mydb', [
            'db_table' => 'my_feature_table',
            'db_column_feature' => 'foo_feature_name',
            'db_column_state' => 'foo_is_active'
        ]);

        // The activator create a table 'my_feature_table' with the column 'foo_feature_name' and 'foo_is_active'.

        $manager = new FeatureManager($activator);
        if ($manager->isActive('your_feature_name')) {
            // do something
        }
    }
}

```

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance44

Moderate activity, may be stable

Popularity39

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 77.4% 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 ~403 days

Recently: every ~343 days

Total

7

Last Release

446d ago

Major Versions

1.1.4 → 2.0.02025-02-27

PHP version history (5 changes)1.0.0PHP ^5.6||^7.0

1.1.0PHP ^7.3||^8.0

1.1.2PHP ^7.1.3 | ^8.0

1.1.3PHP ^7.1.3 || ^8.0

2.0.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13180135?v=4)[Michel Chowanski](/maintainers/migo315)[@migo315](https://github.com/migo315)

![](https://avatars.githubusercontent.com/u/4624237?v=4)[Thomas Eiling](/maintainers/teiling88)[@teiling88](https://github.com/teiling88)

![](https://www.gravatar.com/avatar/3862ec1e22034e4c59ae1d5b71806f5307e8ed2bf8a7b5f8feb37a0be786b532?d=identicon)[playox](/maintainers/playox)

---

Top Contributors

[![migo315](https://avatars.githubusercontent.com/u/13180135?v=4)](https://github.com/migo315 "migo315 (24 commits)")[![teiling88](https://avatars.githubusercontent.com/u/4624237?v=4)](https://github.com/teiling88 "teiling88 (4 commits)")[![abame](https://avatars.githubusercontent.com/u/2082630?v=4)](https://github.com/abame "abame (1 commits)")[![martingtheodo](https://avatars.githubusercontent.com/u/32163565?v=4)](https://github.com/martingtheodo "martingtheodo (1 commits)")[![morawskim](https://avatars.githubusercontent.com/u/1105278?v=4)](https://github.com/morawskim "morawskim (1 commits)")

---

Tags

databasemysqlsqlitedoctrinepostgresdbalsqlflagceptiondatabase-extensionpssql

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/flagception-database-activator/health.svg)

```
[![Health](https://phpackages.com/badges/flagception-database-activator/health.svg)](https://phpackages.com/packages/flagception-database-activator)
```

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58723.9M36](/packages/scienta-doctrine-json-functions)[nettrine/dbal

Doctrine DBAL for Nette Framework

322.6M19](/packages/nettrine-dbal)[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4572.9M34](/packages/aura-sqlquery)[cycle/database

DBAL, schema introspection, migration and pagination

64690.9k31](/packages/cycle-database)[atlas/query

Object-oriented query builders and performers for MySQL, Postgres, SQLite, and SQLServer.

41249.0k7](/packages/atlas-query)

PHPackages © 2026

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