EllisLab/CodeIgniter — Issue #1112: Setting ENVIRONMENT configuration via Environment Variable
Author: roberto-butti
Created: 2012-03-03 15:13:31+00:00
State: open

Setting ENVIRONMENT configuration via Environment Variable CI_ENV (in .htacess with SetEnv)

In your .htaccess:
SetEnv CI_ENV development

In your index.php
$env = getenv("CI_ENV");
$env_default = "development";
if ($env === false) { $env = $env_default; }
define('ENVIRONMENT', $env);