PHPackages                             electblake/environments - 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. electblake/environments

ActiveCakephp-plugin

electblake/environments
=======================

CakePHP Environments Library as a plugin

1.0.1(13y ago)021PHP

Since Feb 5Pushed 13y ago1 watchersCompare

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

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

cakephp-environments
====================

[](#cakephp-environments)

CakePHP Environments Library as a plugin

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

[](#requirements)

- CakePHP 2.x

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

[](#installation)

*\[Manual\]*

- Download this:
- Unzip that download.
- Copy the resulting folder to `app/Plugin`
- Rename the folder you just copied to `Environments`

*\[GIT Submodule\]*

In your app directory type:

```
git submodule add git://github.com/OctoBear/cakephp-environments.git Plugin/Environments
git submodule init
git submodule update

```

*\[GIT Clone\]*

In your plugin directory type

```
git clone git://github.com/OctoBear/cakephp-environments.git Environments

```

### Enable plugin

[](#enable-plugin)

Before using, you MUST enable the plugin:

```
CakePlugin::load('Environments');

```

If you are already using `CakePlugin::loadAll();` before usage, then this is not necessary.

Usage
-----

[](#usage)

Setup a directory structure as follows:

```
app/Config/bootstrap/environments.php
app/Config/bootstrap/environments/production.php
app/Config/bootstrap/environments/staging.php
app/Config/bootstrap/environments/development.php

```

We specify multiple **environment** files to separate the various configurations and make it easy to inspect a given environment. This is not necessary, but useful if you are configuring a large amount of information.

Your `environments.php` should contain the following:

```
