[development] DEP - cascading variable system
    Darrel O'Pry 
    dopry at thing.net
       
    Fri Dec  2 17:07:02 UTC 2005
    
    
  
On Sat, 2005-12-03 at 03:29 +1100, Jeremy Epstein wrote:
> My number one feature request for variable handling in Drupal is this:
> 
> 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).
> 2. Remove that evil second argument from variable_get(). Default
> values should not be repeated every time a variable is used.
> 
> 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.
> 
> Jaza.
I think defining system variables every page load would be a bad idea
performance wise... plus checking each one to make sure you aren't
overwriting data pulled from the database... However adding a
hook_activate, hook_deactivate that is only called when a module is
enabled or disabled respectively, would create a great place for
variable_define...
.darrel.
    
    
More information about the development
mailing list