![]() |
Hook a database config from another system - 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: Hook a database config from another system (/showthread.php?tid=16128) |
Hook a database config from another system - El Forum - 02-25-2009 [eluser]gh0st[/eluser] I'm wanting to "hook" database configuration files from another system so that I only have to change the db details once, in one file. I don't want to be hacking the database config file, so I thought hooks might be able to help; Code: // config hooks.php Code: <?php I've tested the details in the Myfunction and they are working -- but the DB config never changes. I've even outputted the DB config file, ensuring that the original details do not overwrite my hook -- but nothing ever changes. How do I get CI to hook another database config? Thanks Hook a database config from another system - El Forum - 02-25-2009 [eluser]pistolPete[/eluser] [quote author="gh0st" date="1235590162"]I'm wanting to "hook" database configuration files from another system so that I only have to change the db details once, in one file. [/quote] Why don't you just modify ./system/application/config/database.php? It's meant to be changed according to your database settings! Hook a database config from another system - El Forum - 02-25-2009 [eluser]gh0st[/eluser] I thought you weren't meant to -- also I'm doing an include. I did as you said anyway. Hook a database config from another system - El Forum - 02-25-2009 [eluser]xwero[/eluser] The settings in the database.php file are grouped just to allow more than one database configuration. |