Welcome Guest, Not a member yet? Register   Sign In
$_SERVER['CI_ENV'] -- where is and ENVIRONMENT this set?
#11

(03-14-2016, 07:21 AM)kilishan Wrote: One way that I've handled this in other situations where CI_ENV wasn't available, or the client wasn't tech-savvy enough to set it keep it set Smile was something like this in CI's index.php file:

Code:
$domain = ! empty($_SERVER['HTTP_HOST']) ? strtolower($_SERVER['HTTP_HOST']) : 'cli';

if (strpos($domain, '.dev') !== false || $domain == 'cli')
{
   define('ENVIRONMENT', 'development');
}
else {
   define('ENVIRONMENT', 'production');
}

Don't do this. It allows any user to force 'development' as the ENVIRONMENT value.
Reply


Messages In This Thread
RE: $_SERVER['CI_ENV'] -- where is and ENVIRONMENT this set? - by Narf - 03-14-2016, 07:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB