CodeIgniter introduces $_SERVER['CI_ENV']

On the 3rd of March last year (2012) ‘roberto-butti’ suggested using a server environment variable to control the value of CodeIgniter’s ENVIRONMENT. The full discussion on the issue can be found at GitHub. And in June Phil Sturgeon added logic for this in index.php (see commit). By using Apache’s SetEnvIf-directive in .htaccess it is possible to set conditional server environment variables. Let’s say you have three different server environments; production, testing, development and they all resides on different hostnames; www....

February 23, 2013 · 1 min · 178 words · Jonas