CodeIgniter Forums
Adding things to config.php - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Adding things to config.php (/showthread.php?tid=68306)



Adding things to config.php - doomie22 - 06-21-2017

Hi all,

I am wondering if its safe/best practice to add global variables to the config.php file.  Reason for this is what I am making is for multiple sites and I just want to be able to quickly change the variable in the config file or to put it elsewhere.

Thanks,
Doomie


RE: Adding things to config.php - kilishan - 06-21-2017

I'd make a new app.php file in the config folder, or something like that, and keep your custom ones there. Just protects against any framework upgrades that might change that file.


RE: Adding things to config.php - skunkbad - 06-21-2017

Another good option would be to create an sqlite database, and keep your app config in there. This is nice because you can easily create an admin interface to manage the settings. Config retrieval is quick and painless.