Welcome Guest, Not a member yet? Register   Sign In
Config class... One Config to Rule Them All.
#1

[eluser]Michael;[/eluser]
The config class as it is seems pretty easy, but at the same time overly complicated. In order to have config files grabbed by other classes as needed, is to have a bunch of different config files lying around... currently, I have 12 in the config folder of one application I am working on. Now obviously a few of them are going to be absolutely required to site in a flat file, like database and maybe a 2-3 others. But why not the option of having one config file that has all of the *required* information in it, and the rest could be stored in a variables table that items can either be retrieved from individually, or you can build a whole array of items if needed.

So - ideas, thoughts, comments, sarcastic remarks on how we might alter the existing setups to accomplish this?

Michael
#2

[eluser]Tom Glover[/eluser]
The reason why they are split into so many is so that similar configs are grouped together making it easier to find the info about one area, for example the Database. To save you loading a non core config file many time in each class, you can auto-load it by typing it's config name into the auto-load config file.
#3

[eluser]Michael;[/eluser]
Yes, I am aware of that... I'm referring to the possibility of extending the current class to allow for using a database to hold config variables. For those of us who develop portals and content management systems built on the CI framework this would be a much, much easier task than to have a dozen or so config files laying around; not to mention ease of updating via an admin panel on a web server.
#4

[eluser]Frank Berger[/eluser]
In the cms 'Sefrengo' and its relatives the config is largely stored in a database. Moving those projects done with that cms from lets say a stage server to a production server, or from one provider to another is always a major pain in the aXX as you are not able to access the application/backend/control-panel unless you have rewritten the settings in the db by hand, or used a tool to do so.

Personally I think the core should not be db-driven or db-dependent at all. I am fairly sure it would be possible to access and write the flat-file configs programmatically with an edit-class, and then build a controller/view around it so one can have an easily accessible config-tool. I mean, typo3 is doing it as well this way with its installer, which is essentially a flatfile php-file parser and modificator.
#5

[eluser]Michael;[/eluser]
I am not advocating the core be db driven, as I stated in my previous post I was looking for ideas on how the config class could be extended to allow for the option of a db driven config system.




Theme © iAndrew 2016 - Forum software by © MyBB