CodeIgniter Forums
Access config from another - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Access config from another (/thread-7765.html)



Access config from another - El Forum - 04-22-2008

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


Access config from another - El Forum - 04-22-2008

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


Access config from another - El Forum - 04-22-2008

[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.


Access config from another - El Forum - 04-22-2008

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


Access config from another - El Forum - 04-22-2008

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