CakePHP Environment Plugn
The configuration switching library by filebase., (*1)
Copyright 2014, ELASTIC Consultants Inc. (http://elasticconsultants.com), (*2)
, (*3)
Installation
git clone, (*4)
git clone http://github.com/nojimage/cakephp-environment app/Plugin/Environment
or use composer, (*5)
composer require nojimage/cakephp-environment:dev-master
How to Setup
1. Create env file dir
Create app/Config/env
direcotry., (*6)
mkdir app/Config/env
2. Create each environments configuration files
Create dirs, (*7)
mkdir app/Config/development app/Config/staging app/Config/production
and create each environments bootstrap file., (*8)
vi app/Config/development/bootstrap.php
vi app/Config/staging/bootstrap.php
vi app/Config/production/bootstrap.php
3. Setup APP/Config/bootstrap.php
in bootstrap.php, (*9)
CakePlugin::load('Environment');
App::uses('Environment', 'Environment.Lib');
Environment::load(); // check env and loading each env bootstrap.php
How to switching environment
Create file in env
dir., (*10)
switch to development:, (*11)
rm app/Config/env/* && touch app/Config/env/development
switch to production:, (*12)
rm app/Config/env/* && touch app/Config/env/production
Usage
Please see Wiki pages., (*13)
License
Licensed under The MIT License.
Redistributions of files must retain the above copyright notice., (*14)
Copyright 2014, ELASTIC Consultants Inc. (http://elasticconsultants.com), (*15)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:, (*16)
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software., (*17)
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE., (*18)