PHPackages                             frankfoerster/cakephp-environment - 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. frankfoerster/cakephp-environment

ActiveCakephp-plugin[Database &amp; ORM](/categories/database)

frankfoerster/cakephp-environment
=================================

CakePHP Environment Plugin. Manage multiple environments in your CakePHP application that differ in database setup, configuration settings (Configure) and custom feature flags.

v4.0.0(6y ago)99.0k3[1 issues](https://github.com/frankfoerster/cakephp-environment/issues)MITPHPPHP &gt;=5.6.0

Since Mar 4Pushed 1y ago4 watchersCompare

[ Source](https://github.com/frankfoerster/cakephp-environment)[ Packagist](https://packagist.org/packages/frankfoerster/cakephp-environment)[ Docs](https://github.com/frankfoerster/cakephp-environment)[ RSS](/packages/frankfoerster-cakephp-environment/feed)WikiDiscussions cake3 Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (12)Used By (0)

CakePHP 3.x Environment Plugin
==============================

[](#cakephp-3x-environment-plugin)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/4ce40dd3f09bca12f3a7bd98b8e19c11e2aed14966940fb1df3a6d350e4304d1/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6672616e6b666f6572737465722f63616b657068702d656e7669726f6e6d656e742f63616b65332e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/frankfoerster/cakephp-environment)[![Coverage Status](https://camo.githubusercontent.com/b859f36ee7369b45e5b0671029d97989f3e5588b102ba050030794e1b06da983/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6672616e6b666f6572737465722f63616b657068702d656e7669726f6e6d656e742f63616b65332e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/frankfoerster/cakephp-environment)[![Total Downloads](https://camo.githubusercontent.com/72a8cccf904e86981055adf23e8cc54b3f8ac6628a0d41e4c9174c1bee6911dd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6672616e6b666f6572737465722f63616b657068702d656e7669726f6e6d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/frankfoerster/cakephp-environment)[![Latest Stable Version](https://camo.githubusercontent.com/38d5ed69811b9e7201ee56f4623a2d2e1e6e90888cf80970a7316b052e777a22/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6672616e6b666f6572737465722f63616b657068702d656e7669726f6e6d656e742e7376673f7374796c653d666c61742d737175617265266c6162656c3d737461626c65)](https://packagist.org/packages/frankfoerster/cakephp-environment)

Manage multiple environments in your CakePHP application that differ in, e.g.:

- database setup
- configuration settings (Configure)
- custom feature flags

Requirements
------------

[](#requirements)

- PHP 5.6.0+
- CakePHP 3.x

What it does
------------

[](#what-it-does)

The Environment plugin hooks into your bootstrap process to initialize the database configuration, configuration parameters and additional custom logic for different environments.

An environment is defined and detected either by a set of domains (e.g. [www.domain.com](http://www.domain.com), domain.com, domain.net) or optionally by the absolute app path on a server (cli).

Install and use the plugin
--------------------------

[](#install-and-use-the-plugin)

1. `composer require frankfoerster/cakephp-environment`
2. Copy the example configuration files from `example/config/Environment` to your app `/config/Environment`
3. Add the following lines to your `config/bootstrap.php` file

    ```
    use FrankFoerster\Environment\Environments;

    Environments::init();
    ```

    before

    ```
    ConnectionManager::setConfig(Configure::consume('Datasources'));
    ```

    If you want to setup environment specific settings for any "consumed" configuration option, then make sure your environments are initialized **before** the corresponding `Configure::consume('...')` call.

Tags ~1.0 are releases for CakePHP 2.x support (master branch).
Tags ~3.0 are releases for CakePHP 3.x support (cake3 branch).

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

[](#configuration)

The configuration of your environments is managed with multiple files.

- `config.php` is the global configuration file that is applied to all detected environments.
- `environment.{name}.php` is a single environment file that contains the environment specific `$configure` array

Settings defined in an environment configuration file are deeply merged with the global configuration.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 93.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 ~441 days

Total

5

Last Release

2327d ago

Major Versions

v1.0.0 → v3.0.02015-05-04

v3.0.2 → v4.0.02020-01-03

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.0

v3.0.2PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e283cec64599004f56a995fa747ed73a01870b4131e73a62cbcdfc90db1109c?d=identicon)[frankfoerster](/maintainers/frankfoerster)

---

Top Contributors

[![frankfoerster](https://avatars.githubusercontent.com/u/3206331?v=4)](https://github.com/frankfoerster "frankfoerster (31 commits)")[![stephangonder](https://avatars.githubusercontent.com/u/12038872?v=4)](https://github.com/stephangonder "stephangonder (2 commits)")

---

Tags

cakephpcakephp-plugincakephp3environmentenvironment-detectionconfigurationconfigdatabasecakephpenvironmentconfiguresetup

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/frankfoerster-cakephp-environment/health.svg)

```
[![Health](https://phpackages.com/badges/frankfoerster-cakephp-environment/health.svg)](https://phpackages.com/packages/frankfoerster-cakephp-environment)
```

###  Alternatives

[illuminatech/config

Provides support for Laravel application runtime configuration managed in persistent storage

14921.0k1](/packages/illuminatech-config)[eighty8/laravel-seeder

Versioned, environment-based Seeders in Laravel

1857.1k](/packages/eighty8-laravel-seeder)[cornford/setter

An easy way to integrate Database Settings with Laravel.

131.0k](/packages/cornford-setter)

PHPackages © 2026

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