crankycyclops / trogdor-pp

A unified engine for building text adventures and MUDs with batteries included.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trogdord: ini file includes

crankycyclops opened this issue · comments

commented

trogdord.ini should be able to include other ini files. Any included ini files should override settings in previously included files (order will be determined alphabetically.) Measures should be taken to prevent circular includes (although, it appears that other applications like nginx don't do this, so maybe it's not something I'll worry about. I can just let it fail.)

This feature would make trogdord more Docker-friendly, since it would then be possible to change some settings without having to use a volume or bind-mount to replace the entire trogdord.ini file.

commented

My thinking is that I can slightly refactor Config::load() so that it recursively includes files without overwriting the existing configuration. This will take a little thought, though, and should be backward compatible with what I have now (all existing unit tests should pass.) Also, don't forget to write new unit tests to cover the new functionality!

Since this is an ini file and has to be of the correct format, includes can maybe be structured like this:

include=/path/to/*.ini
OR
include=/path/to/config.ini in the case of a single file.

I probably need to create a new ini section for this, though, maybe something like [misc] where all random bits and bobs that don't fit into any single category can go.

commented

I won't do this, as there's no really compelling need right now. If I decide I need this later, I can revisit it.