CodeIgniter Forums
Setting database values with install script - 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 values with install script (/showthread.php?tid=16347)



Setting database values with install script - El Forum - 03-04-2009

[eluser]spyro[/eluser]
Recently I saw thread that mentioned there was a commit of code in CI that had functionality which would permanently set database variables in database.php. Unfortunately I could not find the thread again.

Does anyone know if this code will be in the next release?

If not, how are you setting these now in your install script?


Setting database values with install script - El Forum - 03-04-2009

[eluser]CroNiX[/eluser]
[quote author="spyro" date="1236169264"]Recently I saw thread that mentioned there was a commit of code in CI that had functionality which would permanently set database variables in database.php. Unfortunately I could not find the thread again.

Does anyone know if this code will be in the next release?

If not, how are you setting these now in your install script?[/quote]
Haven't tried, but couldn't you just read (not parse) the database.php and do preg_replaces for the values you want to change and then save it from within your install script?


Setting database values with install script - El Forum - 03-04-2009

[eluser]spyro[/eluser]
That is what I was planning on doing until I found that post. I also wanted to see if anyone had other suggestions.


Setting database values with install script - El Forum - 03-04-2009

[eluser]CroNiX[/eluser]
Sorry, ignore this.