Welcome Guest, Not a member yet? Register   Sign In
Codeigniter how to conditionally load config files?
#6

[eluser]sabya[/eluser]
Thanks guys!

I got it working, like this: -
Code:
$ci = & get_instance();

if (gethostbyaddr ("127.0.0.1") == 'production.example.com') {
    //Load production configuration
    $ci->load->config('config_production');
} elseif(gethostbyaddr ("127.0.0.1") == 'staging.example.com') {
    //Load staging configuration
    $ci->load->config('config_staging');
} else {
    //Load development configuration
    $ci->load->config('config_development');
}


Messages In This Thread
Codeigniter how to conditionally load config files? - by El Forum - 06-25-2009, 05:09 AM
Codeigniter how to conditionally load config files? - by El Forum - 06-25-2009, 05:15 AM
Codeigniter how to conditionally load config files? - by El Forum - 06-25-2009, 05:25 AM
Codeigniter how to conditionally load config files? - by El Forum - 06-25-2009, 05:29 AM
Codeigniter how to conditionally load config files? - by El Forum - 06-25-2009, 05:36 AM
Codeigniter how to conditionally load config files? - by El Forum - 06-25-2009, 07:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB