Allow more environments |
Currently if you set CI_ENV to anything other than "development", "testing" or "production" you get a 503 error.
Our project has two testing environments. One at our development office, one on the production server, running under a different subdomain. Local development, dev-testing (in docker), production-server testing and real "production" all have differences in either the name or IP address of the database. Currently to work around this we stray from the official versions, because of custom workarounds to this problem. There should really be no issue as to set the environment to any string we want and that environment's configuration files to be loaded from the usual "application/config/myenv".
You have described 3 environments if I am not mistaken.
So why can't you do this? Development office => CI_ENV = "development" Development production server => CI_ENV = "testing" Production server => CI_ENV = "production" (08-02-2017, 09:12 AM)Martin7483 Wrote: You have described 3 environments if I am not mistaken. Four: Code: Local development => CI_ENV = "development" // db ip: localhost, dbname: name1 All it would take is to remove the default case to a 503 error in the ENVIRONMENT switch, but I know changes have to be justified, so I didn't go straight for a pull request.
We would still need to throw some form of error, so the default needs to stay. However, adding a config setting of some form could be a good solution.
You can add additional environments yourself in the top half of the index.php file (the half you can customize):
Code: switch (\ENVIRONMENT)
Actually, looking at the code, there is not any limits placed on what environments are allowed. I think the issue is that the environment variable used was changed a little while back. It's not CI_ENV any longer, it's CI_ENVIRONMENT.
|
Welcome Guest, Not a member yet? Register Sign In |