Welcome Guest, Not a member yet? Register   Sign In
Load database config from external file.
#1

Hello,

In the company I work, we developed a webapp based on CI, and my boss wants to "skip" the part when he needs to set the database parameters in CI, because we have already another file in another directory (/etc) where all that information is. So my question is: Is there a way to load that file externally instead of setting the database info in every new install?

Thanks in advance.
Reply
#2

You could read your external file from within config/database.php ... it's a PHP script after all.
Reply
#3

(09-01-2015, 01:57 AM)Narf Wrote: You could read your external file from within config/database.php ... it's a PHP script after all.

Yeap, that's what I though, just repaced the database.php content to: 

Code:
require_once('location/database.php');

And in thad file I putted the original content of the file database.php 

Thanks! 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB