[dokuwiki] Re: Config Cascade and writing config settings

  • From: Andreas Gohr <andi@xxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sun, 19 Jun 2011 12:38:58 +0200

>> Simple use case: the farmer want's to change some values from the
>> default settings (without touching dokuwiki.conf for update safety)
>> but wants to allow animals to override them.
>
> Yes, that scenario was already implied by the question. I would like to know
> a specific use case where you'd need that kind of setup.

Let's say a custom fetchsize in the farmer and some really big
fetchsize in one of the animal.

> Or can a farmer forbid things for all animals?

That should be possible by the protected files.

> If I could configure this in the farmer, it would make things easier.

Yes, that should be doable with multiple protected files

> But I don't want to disable this option in the farmer itself ...

This on the other hand seems not possible currently.

>> This could be done with the following setup (following tips:farm) if I
>> understand the whole thing correctly.
>>
>>     'main' =>  array(
>>         'default'   =>  array(DOKU_INC.'conf/dokuwiki.php'),
>>         'local'     =>  array(DOKU_INC.'local.php',
>> DOKU_CONF.'local.php'),
>>         'protected' =>  array(DOKU_CONF.'local.protected.php'),
>>     ),
>>
>> Or am I completely on the wrong track here?
>
> This is what I would expect as well, but I've never tried it. How does it
> behave? And how should it behave?

I haven't tried it but from looking at the code it should work. My
question still remains if anyone is even using this feature or if we
could/should simplify the whole thing.

But now that we thought about a few scenarios it seems to make sense
the way it is.

> Another way (which is possible right now) would be:
> Copy the farmer's conf/dokuwiki.php to conf/farmer.php and make your changes
> there. Then use this:
>
>    'main' => array(
>        'default'      => array(DOKU_INC.'conf/farmer.php'),
>        'local'        => array(DOKU_CONF.'local.php'),
>        'protected'    => array(DOKU_CONF.'local.protected.php'),
>    ),

You could even use

        'default'      => array(DOKU_INC.'conf/dokuwiki.php',
DOKU_INC.'conf/farmer.php'),

> Which leads to the question you already asked before: Do we need this
> flexibility of having an array there?

exactly.

Andi

-- 
splitbrain.org
--
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: