[dokuwiki] Config Cascade and writing config settings
- From: Andreas Gohr <andi@xxxxxxxxxxxxxx>
- To: DokuWiki Mailinglist <dokuwiki@xxxxxxxxxxxxx>
- Date: Wed, 8 Jun 2011 11:29:56 +0200
Hi,
For a customer I'm currently working on making the confmanager
plugin[1] compatible with farms. The plugin allows to edit files like
the acronyms.local.php
The default config cascade has this:
$config_cascade = array(
...
'acronyms' => array(
'default' => array(DOKU_CONF.'acronyms.conf'),
'local' => array(DOKU_CONF.'acronyms.local.conf'),
),
...
);
As you can see, acronyms/local is an array. AFAIK this is because you
might want to use a local file in the farmer and a local file in the
animal. The animal file would then overwrite settings that might be
set the farmer's local file.
Then I wondered into which file I would need to write back any changes
made in my plugin. If I understand this correctly I should always
write back to the last local file. Interesting point though: our
standard config manager writes to the first local file [2]. This is
wrong IMHO. That way an animal would write to the farmer.
@Chris am I missing something here or is this a bug?
Now let's assume this a bug. If that's the case nobody seems to have
ever noticed. So am I right to assume that nobody uses multiple local
files anyway?
We have an open bug about the user(style,print,*) and acl files in the
config cascade not matching the multiple values allowed array style
like the others do [3].
I'm now wondering if we should drop these last arrays completely and
only allow only one file by type (default, local, protected).
If we want to have a way for the the farmer to override DokuWiki
defaults we could introduce a 4th type between default and local.
What do you think?
Andi
[1] http://www.dokuwiki.org/plugin:confmanager
[2]
https://github.com/splitbrain/dokuwiki/blob/master/lib/plugins/config/settings/config.class.php#L104
[3] http://bugs.dokuwiki.org/index.php?do=details&task_id=1986
--
splitbrain.org
--
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist
Other related posts: