5 ms·
Just wait till someone uses an ORM library for configuration.
by mdg 16y ago
Just wait till someone uses an ORM library for configuration.
- rlpb 16y agoBut how would one represent a configuration like "don't require auth for /, but do require auth for /foo/*.jpeg" in a table? It would be great to just use a row for each possible URL, but with overlapping wildcards, folder hierarchies and multiple levels of allow/deny it gets very complicated very quickly. Granted, the allow/deny and order that Apache uses isn't great, but at least a configuration is understandable by reading it because the admin can lay out the configuration file with whitespace and comments in a way that makes sense. The equivalent might be achievable in sqlite, but it would be very challenging. It's basically a step backwards towards a poorly featured, confusing GUI configuration mechanism like the old IIS configuration used to be.
- grandalf 16y agowell you could always just represent it as: insert into rules (rule) values('don\'t require auth for /, but do require auth for /foo/*.jpg') The use of a db is more to create a standard networkable interface for other clients to read/modify the config than a statement about the semantics of the config syntax.
- rlpb 16y agoYou could do that, but would it really be much different from this? data = config_file.read() "insert into config (config) values ('%s')" % data
- rue 16y ago> But how would one represent a configuration like "don't require auth for /, but do require auth for /foo/.jpeg" in a table?* Are you confusing offline representation with a runtime structure?
- mdg 16y agoI was only being half serious (or half joking, depending on how you look at it).