Welcome Guest, Not a member yet? Register   Sign In
Persistent Config?
#1

[eluser]liamstask[/eluser]
Is there a recommended way to programmatically update info in config files? I'm just getting started, but ran into 2 issues:

1. Not all the CI supplied files in the application/config directory can be read with the Config class - bummer!
2. Config items cannot be written back into the files - double bummer!

Specifically I'm hoping to create an installer that will allow users to enter database connection info into a form-based wizard. Everything else I guess I can just read and write from the DB...

Thanks for your thoughts!
#2

[eluser]zdknudsen[/eluser]
With regards to saving to the config files, have a look at this thread:
http://ellislab.com/forums/viewthread/70464/
#3

[eluser]liamstask[/eluser]
Thanks for the pointer. It would be great if the Config class could support both cases - perhaps an additional parameter (false by default) could specify that the changes should be written persistently.

Would also be nice if the stock CI config files could at least be read with the Config class, and ideally written in that ideal future version Smile
#4

[eluser]steelaz[/eluser]
If using database is an option for you, there is very simple extension to the Config class.

http://codeigniter.com/wiki/Config_Extend_to_Database/




Theme © iAndrew 2016 - Forum software by © MyBB