How to change the ENVIRONMENT type |
When open the index.php file to change the ENVIRONMENT type I have found the following:
PHP Code: define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development'); In the previous CI version was as the following: PHP Code: define('ENVIRONMENT', 'development'); And I could change the environment by replace "development" word to ("production" or "testing"). How can I do that in CI 3 ?
For production:
PHP Code: define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'production'); For testing: PHP Code: define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'testing'); For development: PHP Code: define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
If I can change it whether
PHP Code: define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'testing'); // testing, production, development Or PHP Code: define('ENVIRONMENT', 'development'); // testing, production, development What is the benefit of the following condition PHP Code: isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV']
I have found the answer of my question.
http://bldn.se/post/codeigniter-introduc...rverci_env http://www.patpohler.com/codeigniter-mul...vironments
If you don't use the CI_ENV variable (which I'm guessing you're not), then there's no benefit from it. As I said - you can do it as previously just fine ... whether you remove the condition or not doesn't make a practical difference.
Code: if(! defined('ENVIRONMENT') ) I'm using the above code for my application. Hope it helps ![]() |
Welcome Guest, Not a member yet? Register Sign In |