-
Notifications
You must be signed in to change notification settings - Fork 30
Enable different enviroments #6
Description
We can now enable/disable a development mode with this module, but this only works for the "base configuration". Also if you have more than 2 enviroment, its stuck because some modules are only needed in production.
When using other components which have enviroment settings, this is also not enough:
- DoctrineORMModule -> caching / database
- Zend\Translate -> caching
- Zend\View -> error reporting
- ...
You can achieve this with config/autoload/local.php
...but than you have to it manually currently.
_So my suggestion is:_
- copy needed enviroment
*config/autoload/*.local.php.dist
toconfig/autoload/local.php
- copy needed enviroment
config/*.config.php.dist
toconfig/enviroment.php
_New command (replacing the old):_
php index.php enviroment [none|development|production|testing|....]
- or
php index.php switch [none|development|production|testing|....]
- or
php index.php switch enviroment [none|development|production|testing|....]
- or
php index.php enable enviroment [none|development|production|testing|....]
(if none is provided, just remove the current enabled files)
_the config/autoload folder could look like_
- global.php
- development.local.php.dist
- production.local.php.dist
- testing.local.php.dist
E.g. I you only want to use EdpSuperluminal
modul in production, you can move it to config/production.config.php.dist
which will be copied to config/enviroment.php
(instead of development.config.php) with the command above
Things to keep in mind:
- overwrite existing
config/autoload/local.php
andconfig/enviroment.php
dangerous? Maybe a "force" parameter?
_Good idea / bad idea? Feedback?_
Pinging @akrabat @ezimuel @weierophinney
(sorry for the pings, but since this modules is forket, i though it's a good idea)