CodeIgniter Forums

Full Version: Access config from another
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]louis w[/eluser]
Can I access the site config (/config/config.php) from the database config?

El Forum

[eluser]xwero[/eluser]
I think the only possibility is to include it.

El Forum

[eluser]louis w[/eluser]
It would be nice to be able to do this. That way in the site config I can do a check to see if the site is development or production (if (strpos(strtolower($_SERVER['HTTP_HOST']), 'local') === false) {) and then use it throughout the entire app to switch settings.

El Forum

[eluser]xwero[/eluser]
I saw some posts where people showed their solution for what you want. You should do a forum search.

El Forum

[eluser]webthink[/eluser]
maybe set a constant in config which you can then read in database