frankfoerster/cakephp-environment
最新稳定版本:v4.0.0
Composer 安装命令:
composer require 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.
README 文档
README
Manage multiple environments in your CakePHP application that differ in, e.g.:
- database setup
- configuration settings (Configure)
- custom feature flags
Requirements
- PHP 5.6.0+
- CakePHP 3.x
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, domain.com, domain.net) or optionally by the absolute app path on a server (cli).
Install and use the plugin
-
composer require frankfoerster/cakephp-environment -
Copy the example configuration files from
example/config/Environmentto your app/config/Environment -
Add the following lines to your
config/bootstrap.phpfileuse 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
The configuration of your environments is managed with multiple files.
config.phpis the global configuration file that is applied to all detected environments.environment.{name}.phpis a single environment file that contains the environment specific$configurearray
Settings defined in an environment configuration file are deeply merged with the global configuration.
统计信息
- 总下载量: 9.04k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-04