HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Why are all of the configuration settings stored in a file?

SudoCatSudoCat Drowning under a Sea of Clients New

This has really confused me from the begin; of course certain things should remain in a hardcoded file, but it certainly feels like a vast quantity of these things would work a lot better if they were stored in a database? (e.g. the module ordering).

I was just wondering what the thinking behind this decision was, and what benefits this actually provides? I figured there must be a good reason for it.

Thanks :)


  • Options
    hgtonighthgtonight ∞ · New MVP

    While I can't speak for the devs, I think it comes down to separation of concerns.

    Database is for storing content, configuration is for storing configurations. You will always need some type of storage outside of the db for the db connection information so why not store configuration data there to?

    I can't think of anything Vanilla core stores in the config that should be in the db off the top of my head.

    I know of plenty of plugins (some of mine too) that store data in the configuration, but that can't be really be controlled.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options
    LincLinc Detroit Admin

    It also adds simplicity for viewing & editing. We don't necessarily have a UI for every config setting, so assuming someone is comfortable editing the database is a bigger leap than opening a text file. And, it's faster to read a file than do 1 or more DB queries.

    The big risk to our setup is that we're opening the whole config everytime and loading it to memory, so storing a lot of stuff in there is bad. I actually need to get Profile Extender using the UserMeta table exclusively rather than storing its giant structure in the config.

  • Options

    I think readability and simplicity.

    Certain thing should not be in there is also Gnd::Set(), Gnd::Get() which I have used for global stats

    grep is your friend.

Sign In or Register to comment.