CodeIgniter Forums
Setting Database Config Items - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Setting Database Config Items (/showthread.php?tid=29806)



Setting Database Config Items - El Forum - 04-21-2010

[eluser]Kyle Ellman[/eluser]
I'm wanting to make an install script for an application. The script should completely set up the database, without the user having to access config/database.php at all.

I know that codeigniter config items can be set using
Code:
$this->config->set_item('item_name', 'item_value');

Is this possible with database config items? I haven't been able to so far, nor can I find an answer to this.

Thanks.


Setting Database Config Items - El Forum - 04-21-2010

[eluser]skunkbad[/eluser]
That's only for run-time configuration. You'll probably have to fread, fwrite, and all that good stuff on the config file itself. Either that, or you might do like Wordpress. Have the user type in their DB info, test the connection, and then generate a config file download that they drop in place.


Setting Database Config Items - El Forum - 04-21-2010

[eluser]$ilovephp[/eluser]
file handling is the answer...