Using this you can predefine configurations for use in different environments, like development, testing, staging and production.
The main config (
main.php) is extended to include the Yii paths and debug flags.
mode_<environment>.php files for overriding and extending main.php for specific environments.
Additionally, you can overrride the resulting config by using a
local.php config, to make
changes that will only apply to your specific installation.
This class was designed to have minimal impact on the default Yii generated files. Minimal changes to the index/bootstrap and existing config files are needed.
The Environment is determined with PHP's getenv(), which searches
There are multiple ways to set the environment depending on your preference.
Setting the environment variable is trivial on both Windows and Linux, instructions included.
You can optionally override the environment by creating a
mode.php in the config directory.
If you want to customize this class or its config and modes, extend it! (see ExampleEnvironment.php)
All information is available within the GitHub-project: