CodeIgniter Forums
Load settings from database at bootstrap - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Load settings from database at bootstrap (/thread-54605.html)



Load settings from database at bootstrap - El Forum - 09-16-2012

[eluser]Saquib[/eluser]
I want to load some settings from database in my application, I am planing to do that using a model which will be auto-loaded from config.

In model construct i will perform actions like a db query and fetch settings and store it in session for later use.

Quote:Application is allowed access from current ip address
Is App is marked as offline
Setting TimeZone for app

My Question is

Quote:What is the right way to load settings which should be available at very early stage in app (on bootstrap) ?
Is it good to store settings in Session ? what else can be done (Almost 25 columns data)?

Please help !


Load settings from database at bootstrap - El Forum - 09-16-2012

[eluser]Procode[/eluser]
If you dont want to store the data in a database you can always create a custom config file. It tells you exactly how in the user guide.


Load settings from database at bootstrap - El Forum - 09-16-2012

[eluser]Saquib[/eluser]
[quote author="Procode" date="1347848928"]If you dont want to store the data in a database you can always create a custom config file. It tells you exactly how in the user guide.[/quote]

My Settings are saved in Database, i need to use some other way to solve it.

I am going to try below solution :-)

http://ellislab.com/forums/viewthread/223925/


Load settings from database at bootstrap - El Forum - 09-17-2012

[eluser]CroNiX[/eluser]
I just extend the Controller with MY_Controller and have MY_Controller get that data from the database and stick it in an array, which anything else can then use.