[development] DEP - cascading variable system

Adrian Rossouw adrian at bryght.com
Sat Dec 3 08:13:01 UTC 2005

On 02 Dec 2005, at 6:29 PM, Jeremy Epstein wrote:
> 1. Every variable has its default value defined in ONE place (e.g.
> perhaps inside hook_init() for each module, have function calls such
> as "variable_define('some_value', 42);", where 42 is the default
> value).
i'm not opposed to the idea, but what I have in mind is that each  
module during
install can set up defaults into the bottom layer.

Each install profile can then set up defaults which are in a layer  
above the module
specified defaults.

I also believe we need a code based set of defaults. kind of like we  
use $conf now.
Not sure where that would fit in.

> 2. Remove that evil second argument from variable_get(). Default
> values should not be repeated every time a variable is used.
I kind of like it. =)

> Regarding the actual proposal of a cascading variable system, sounds
> good to me! If variables can be overridden in multiple layers, in such
> a way that module authors don't get really confused, that will
> certainly improve the system.
Well, i'm thinking we could pull it off in a few simple api  
functions. It would make
a lot of modules simpler. take the content settings for instance.

Adrian Rossouw
Drupal developer and Bryght Guy
http://drupal.org | http://bryght.com

More information about the development mailing list